With htm in the mode here the author writes JSX & React consumes a data structure that looks like JSX, so this doesn’t seems like something that React the library (same API) nor React the programming model (author writes same code) should care about. Optimization similar to DCE
-
-
Replying to @cramforce @_developit
I don’t say I care about whether people use HTM or not. Only about misleading marketing.
1 reply 0 retweets 3 likes -
Replying to @dan_abramov @_developit
Your tweet sounds like you are assuming people would write tagged templates instead of JSX, where tagged templates are just an implementation detail of the optimizing compiler for JSX.
1 reply 0 retweets 1 like -
Replying to @cramforce @_developit
Ahh I misunderstood. My impression was that this tweet was promoting a one-time codebase conversion from JSX to HTM because it brings “sweet gainzz”. I see what Jason meant more now (although haven’t seen convincing evidence of “gainzz” yet).
2 replies 0 retweets 3 likes -
It’s pretty counter-intuitive that HTM promotes compiling to createElement as an optimization but also promotes compiling JSX to HTM as an optimization.
1 reply 0 retweets 6 likes -
yeah i am confused how template literals would be more efficient than, like, an AST with the static stuff lifted into the outer scope
1 reply 0 retweets 0 likes -
Replying to @modernserf @dan_abramov and
I guess an *entirely* static htm block would be a single string and therefore efficient to cache?
1 reply 0 retweets 0 likes -
It's the JS parse time. A tagged template can be parsed extremely quickly and most engines have specific optimizations in place to take advantage of this. A sufficiently fast runtime parser for the template's DSL can fall within the gap left by this improvement.
3 replies 0 retweets 7 likes -
HTM might not be the most efficient representation though. So if you go far enough you’ll get to bytecode.
Which is something @trueadm was/is experimenting with for months and he’d probably love to hear more on your findings.2 replies 0 retweets 5 likes -
Replying to @dan_abramov @_developit and
Stealing his thunder
with something soneone is working on? Ouch1 reply 0 retweets 1 like
Dominic has been working on React compiler and bytecode stuff for over a year, this has nothing to do with "stealing thunder" https://github.com/facebook/prepack/pulls?q=is%3Apr+author%3Atrueadm+is%3Aclosed …
-
-
Replying to @sebmck @cactusanddove and
I’ve been working on a React compiler on the side for a while now. It’s a based on Babel and doesn’t use Prepack. Rather than focusing on component inlining, it instead compiles components to a static IR, where render functions become compute functions for the static templates.
2 replies 0 retweets 10 likes -
It requires type annotations to properly determine how to optimize React templates. It also requires a new reconciler to understand and process the IR.
2 replies 0 retweets 3 likes - 4 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 