This repository demonstrates how the React compliler can be invoked through the babel toolchain for a sample application.
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".
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"]
}