3 ms·
What's a react compiler? Not JS or TS?
by BretonForearm 27d ago
What's a react compiler? Not JS or TS?
- francislavoie 27d agohttps://react.dev/learn/react-compiler/introduction https://react.dev/learn/react-compiler/introduction
- throw_m239339 26d agoHand written React code is relatively slow when running so the React team made a React compiler to make it run faster. You might not see the difference with a toy app, but with a fairly large app, with a lot of IO it's a catastrophe if not compiled and optimized. It's the definition of overengineering IMHO. The problem is React at first place. Some other frameworks have in theory no compilation or optimization step while delivering constant performance as the app grows, like SolidJS. Since writing a compiler in JS also make compilation itself slow, then the React compiler was re-written in Rust... At the end of the day, React has a larger community and ecosystem so it's the industry "standard" for JS applications...
- pzmarzly 26d agoWhy do people say SolidJS has no compilation? SolidJS 1.0 was already doing much more at transpilation time than just changing <h1> to h("h1"), and SolidJS 2.0 has a package called @solidjs/compiler: https://npmx.dev/package/@solidjs/compiler https://npmx.dev/package/@solidjs/compiler
- deleted 26d ago[deleted]