mohebifar / react-unforget

DEPRECATED | ⚠️ Use React Compiler instead ⚠️ | A compiler for automatic optimization of React apps
https://react-unforget.vercel.app/
MIT License
391 stars 4 forks source link

Idea: inline JSX calls #32

Open romgrk opened 4 months ago

romgrk commented 4 months ago

On top of all the nice optimizations done here, I think inlining JSX calls would fit nicely as a feature of this project. I've created a proof-of-concept here: https://github.com/romgrk/babel-plugin-fast-jsx, feel free to pick up anything you want from there.

mohebifar commented 4 months ago

This is so cool and thanks for sharing. I'll think about how it can fit into this project. I believe they should remain as separate babel plugins, but it can be an extension to the unforget toolchain under the @react-unforget npm scope.

romgrk commented 4 months ago

Sure, feel free to use it or not as you wish, it's released to the public domain. I unfortunately can't use either on the projects I'm working on at the moment, but if I was building the kind of stuff that benefits from unforget I'd definitely be interested in the JSX transform as well. For some cases that are mount-heavy (mounts more often that re-renders), the JSX calls do add up to a significant amount.

Sidenote but it feels so great to be able to compile React performance cliffs away. And it feels like with a few strategic breaking changes, React plus a compiler could get near SolidJS level performance.