It's worth exploring in react but much harder to get right because it's hard to enforce restrictions in "just js"
-
-
Not really... template literals just do that for you
1 reply 0 retweets 0 likes -
Replying to @justinfagnani @trueadm and
JSX is not the same thing as template literals. And stitching together JS loops / conditionals with templates also doesn't work.
3 replies 0 retweets 2 likes -
Replying to @wycats @justinfagnani and
let items = http://list.map (item => jsx`<li>${item}</li>`); return jsx`<ul>${items}</ul>`
1 reply 0 retweets 1 like -
Replying to @wycats @justinfagnani and
This is the sort of very simple thing people do all the time and like as "just JS" that starts to make it hard to do this optimization.
2 replies 0 retweets 1 like -
That works great in lit-html, what's the difficulty?
1 reply 0 retweets 0 likes -
Replying to @justinfagnani @trueadm and
It means you can't statically see the conditional and have to compare more.
1 reply 0 retweets 1 like -
Replying to @wycats @justinfagnani and
The full optimization does no comparing at update time of anything, and also doesn't keep any repr at all of the anything other than {{}}
1 reply 0 retweets 1 like -
I'm not exactly sure what comparing you're referring to, but if there a conditional in the template you have to execute it.
2 replies 0 retweets 1 like -
Replying to @justinfagnani @wycats and
If you're referring to constant folding, DCE, etc. you can get that from being in JS. Compilers will also optimize templates
1 reply 0 retweets 0 likes
This isn't going to work on Twitter but strongly disagree with what it sounds like you're saying.
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.