Conversation
|
This is like the Babel plugin, right? The only concern here is that different JSX runtimes may treat these differently, hence why I didn't do this. Another thing is we have the auto-memoized JSX. Hoisted JSX doesn't really offer any wins besides maybe saving creation time that's just probably a minor perf improvement. But, like I mentioned, I'm probably looking at what violations would this affect. |
ae617af to
080d1ab
Compare
080d1ab to
c19f1f6
Compare
The hoisted JSX can reduce the unnecessary branch call inside the component and reduce the output code size, by making hoisted JSX bailing out As for downsides, a potential downside would be the hoisted JSX expressions are not stored inside React/Preact's component life cycle and thus will not be thrown away when the component unmounts.
Maybe we can make it an option, and |
6068e69 to
67b51c9
Compare
Still adding test cases.