e.g. if a rendering routine always returns <div id=foo><div id=bar>…</div></div>, detect that and statically cache foo and bar so you don’t have to diff the tree at runtime.
-
-
Show this thread
-
Despite initial hype around React, classic ‘90s retained mode UI really is the most resource-efficient way to write apps. But it’s not much fun to write compared to React. Best solution: Keep the developer ergonomics of React/etc. but compile to old-school UI code under the hood.
Show this thread
End of conversation
New conversation -
-
-
Should be easy if always the same instance is returned, then comparing with `===` should be enough. I don't know React, but Angular compares bound values this way and knows if it needs to invalidate the node. If the values are equal but the references differ it treats it as chang
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Various babel plugins do this already for JS. For rust, I’ve prototyped jsx in rust with proc macros that do this exact kind of build time optimizations back in 2017. Happy to chat more.
- 1 more reply
New conversation -
-
-
Not quite exactly, but Vue@3 are leveraging a template compiler to reduce diff process. IMO it’s impossible to archive similar optimization using JSX as the dynamic nature of JavaScript but it’s doable in a template solution.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Sounds like Svelte, but surely a better compiler could help with React too
Thanks. 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.