3 ms·
Jsx is expressive but it comes with a deviation from html. And loses optimization opportunities. Templates are closer to html, can be better optimized but lack
by rk06 4y ago
Jsx is expressive but it comes with a deviation from html. And loses optimization opportunities.
Templates are closer to html, can be better optimized but lack expressiveness.
Is there a third option which has both? Not yet for sure. Right now, you need to compromise somewhere.
The only pragmatic option is to support both template and jsx (Vue approach) but then people complain about "complexity" and "multiple ways to do same thing"
- SebastianKra 4y agoReacts performance problems don't come from JSX, but rather how single updates can affect the entire tree below it. Solid uses fine-grained observability like Svelte and achieves similar performance [1]. SwiftUI uses static diffing, fine-grained observability, and avoids re-renders by comparing view dependencies [2]. It is performant even on watches. [1]: https://krausest.github.io/js-framework-benchmark/current.html https://krausest.github.io/js-framework-benchmark/current.ht... [2]: https://developer.apple.com/videos/play/wwdc2021/10022/ https://developer.apple.com/videos/play/wwdc2021/10022/