Skip to content

astrofrans/react-compiler

Repository files navigation

React compiler

This repository demonstrates how the React compliler can be invoked through the babel toolchain for a sample application.

Running locally

Note: This project was built using node@20 and npm@10 and hasn't been tested for other versions.

To run the application locally run

npm i --legacy-peer-deps

Note legacy-peer-deps as react router has unmet peer depenency for beta version of react 19

Then run

npm run start

By default the application run on https://dev.reactcompiler.io:3000/app. To access the application from this URL, add the following line to your /etc/hosts:

127.0.0.1    dev.reactcompiler.io

The dev server creates self signed certificates which needs to be added to your keychain in order to run https. Open {workspaceroot}/.ca/primary.crt and locate the cert parceljs.org in you keychain application. Double click the certificate and under the collapsible section "Trust" select "Always trust" in the select menu labelled "When using this certificate".

Invoking the react compiler

By the default, this project does not invoke the react compiler. To enable this feature, through react compiler babel plugin, add the following line to babel.config.json:

{
  "plugins": ["babel-plugin-react-compiler"]
}

About

Sample application for demonstrating use of the react compiler

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published