What can be expected regarding the upcoming React 19 Compiler

In several Blog Posts it was announced that React 19 will include it’s own optimizing compiler.
I was wondering how this will fit into the bigger picture in projects that use rescript and didn’t manage to find any existing discussions about this.
Are they mutually exclusive? Are they sequential?
If I adopt rescript for a react project - will I be able to benefit from React 19 once it comes out or will I be locked down to React 18 forever?

Thank’s a lot for clearing this up.

1 Like

The core of the compiler is almost completely decoupled from Babel, and the core compiler API is (roughly) old AST in, new AST out (while retaining source location data). 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.

I wonder if that core is binary or JS. I mean, whatever is done via a Babel plugin can be redone as a PPX, but reusing the logic vendored by React team is likely much better.

1 Like