Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

What can be expected regarding the upcoming React 19 Compiler

$
0
0

I was curious to see how the latest version of Rescript works with the new React compiler, so I’ve managed to setup a minimal project with Next (raw js, typescript added some build complexities). So far it seems that compiled rescript components won’t be memo’d by the new compiler, unfortunately. I assume it happens due to them being compiled to jsx-runtime, which React can’t apply performance updates to. Maybe if we could preserve JSX output from Rescript it might’ve worked.

Here’s the link to the project: long-sandbox-link. Running steps:

  1. npm install --force because Rescript dependencies point to React 18.
  2. npx rescript build to generate .jsx component
  3. npm run dev to start the next project.
  4. if you are forking the sandbox - open the page in the new window, otherwise CodeSandbox won’t show new compiler messages. If you are running it locally - just open the project url.

Using react component tab in chrome you can see that all components except Rescript were successfully memo’d by the compiler.


Viewing all articles
Browse latest Browse all 2592

Trending Articles