That's what I've been experimenting on too in regards to React. Admittedly it's way harder to do with React, as we have to evaluate raw JS.
-
-
Replying to @trueadm @dan_abramov and
It's worth exploring in react but much harder to get right because it's hard to enforce restrictions in "just js"
2 replies 0 retweets 3 likes -
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
You execute it once when appending and only check if the condition is still valid thereafter.
-
-
Yep, that's what lit-html does
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
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.