-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: tansform jsx to html #1304
Conversation
再测一下 JSXSpreadAttribute 试试: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed
after merge sibling string benchmark (use className, about 1000 nodes) mean:0.634ms
React#renderToString x 1,578 ops/sec ±5.26% (82 runs sampled)
mean:0.070ms
Rax#renderToString x 14,249 ops/sec ±1.54% (83 runs sampled)
mean:0.187ms
Inferno#renderToString x 5,357 ops/sec ±1.56% (83 runs sampled)
mean:0.073ms
Marko#renderToString x 13,758 ops/sec ±1.81% (84 runs sampled)
mean:0.095ms
Xtpl#renderFile x 10,551 ops/sec ±9.05% (66 runs sampled) |
__html: "<div>" | ||
}, "a ", props.index, { | ||
__html: "</div>" | ||
}], { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
README 可以更新下
{ | ||
"name": "babel-plugin-transform-jsx-to-html", | ||
"version": "0.1.0", | ||
"description": "Transform JSX to Html.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Html -> HTML
}], [{ | ||
__html: "<div>b</div>" | ||
}]);`); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[{ __html: "<div>a</div>" }], [{ __html: "<div>b</div>" }]
优化为 [{ __html: "<div>a</div>" }, { __html: "<div>b</div>" }]
是不是更好?
pre tansform jsx to html for better ssr performance.
input
output
benchmark (use inline style, about 1000 nodes)
benchmark (use className, about 1000 nodes))