3 ms·
I think they're doing a little bit more. I should've linked the article I quoted since it's not in the submission post but a link the submission post, from marc
by preommr 3y ago
I think they're doing a little bit more. I should've linked the article I quoted since it's not in the submission post but a link the submission post, from march of last year.[0]
They go on to explain :
> Under the hood we use a custom code representation and transformation pipeline in order to do low-level semantic analysis. However, the primary public interface to the compiler will be via Babel and other build system plugins. For ease of testing we currently have a Babel plugin which is a very thin wrapper that calls the compiler to generate a new version of each function and swap it in.
> As we refactored the compiler over the last few months, we wanted to focus on refining the core compilation model to ensure we could handle complexities such as conditionals, loops, reassignment, and mutation. However, JavaScript has a lot of ways to express each of those features: if/else, ternaries, for, for-in, for-of, etc.
[0]https://react.dev/blog/2023/03/22/react-labs-what-we-have-been-working-on-march-2023#react-optimizing-compiler https://react.dev/blog/2023/03/22/react-labs-what-we-have-be...
- diggan 3y agoOh wow, yeah, that definitely sounds like more magic that I thought at first. Thanks for expanding the context a bit :)