You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use Vite's native Oxc-based React Compiler integration now that it is available in @vitejs/plugin-react, removing the separate Babel transform from the affected Petrinaut builds.
Upgrades @vitejs/plugin-react from 6.0.1 to 6.1.0 in @apps/petrinaut-website, @hashintel/petrinaut, and @hashintel/refractive.
Replaces @rolldown/plugin-babel and babel-plugin-react-compiler with oxc-transform-react 0.145.0.
Moves the existing React Compiler options onto the Vite React plugin's native compiler option.
Excludes generated .d.ts files in the two library builds so the native transform does not interfere with rolldown-plugin-dts output.
Keeps the existing exclusions for prebuilt workspace output and @hashintel/ds-components.
Build performance compared with main
Package
Main median
Native compiler median
Peak RSS change
@hashintel/refractive
1.32s
1.05s
—
@hashintel/petrinaut
10.72s
6.35s
approximately 17% lower
@apps/petrinaut-website
9.16s
3.47s
approximately 46% lower
Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
does not modify any publishable blocks or libraries, or modifications do not need publishing
📜 Does this require a change to the docs?
The changes in this PR:
are internal and do not require a docs change
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
do not affect the execution graph
⚠️ Known issues
The native compiler emits non-fatal experimental bailout diagnostics for some existing Petrinaut components and hooks. Those files remain valid and are skipped by the compiler where unsupported; builds complete successfully with panicThreshold: "critical_errors".
🐾 Next steps
Consider reducing the remaining compiler bailout diagnostics independently where the refactors improve the source code.
🛡 What tests cover this?
yarn install --immutable
yarn constraints
yarn lint:format
yarn exec turbo run build --filter @apps/petrinaut-website
TypeScript and lint checks for all three affected packages
202 Petrinaut unit tests
2 Petrinaut website unit tests
❓ How to test this?
Install dependencies with the immutable lockfile.
Build the three affected packages through Turborepo.
Confirm the builds complete and the expected non-fatal Oxc bailout diagnostics do not become critical errors.
Medium Risk
Build-time behavior changes for all compiled React in three packages; runtime output should match but compiler bailouts and edge-case transforms differ from Babel until validated in CI and manual builds.
Overview
Switches petrinaut-website, @hashintel/petrinaut, and @hashintel/refractive from a separate Babel React Compiler pipeline to @vitejs/plugin-react 6.1.0’s built-in compiler option backed by oxc-transform-react.
Dependencies: drops @rolldown/plugin-babel and babel-plugin-react-compiler; bumps the React plugin and lockfile accordingly. Petrinaut docs now reference Oxc instead of Babel for the compiler stack.
Vite config: each app/library uses a single react({ compiler: { target: "19", compilationMode: "infer", panicThreshold: "critical_errors" } }) plugin instead of react() + babel({ presets: [reactCompilerPreset(...)] }). Existing exclude rules are preserved or tightened: @hashintel/ds-components / prebuilt jsx() output on the website and petrinaut builds; library builds also skip \.d\.ts$ so rolldown-plugin-dts output is not run through the native transform.
Reviewed by Cursor Bugbot for commit 85eeab9. Bugbot is set up for automated code reviews on this repo. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
area/appsarea/depsRelates to third-party dependencies (area)area/infraRelates to version control, CI, CD or IaC (area)area/libsRelates to first-party libraries/crates/packages (area)type/eng > frontendOwned by the @frontend team
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🌟 What is the purpose of this PR?
Use Vite's native Oxc-based React Compiler integration now that it is available in
@vitejs/plugin-react, removing the separate Babel transform from the affected Petrinaut builds.🔗 Related links
🚫 Blocked by
🔍 What does this change?
@vitejs/plugin-reactfrom 6.0.1 to 6.1.0 in@apps/petrinaut-website,@hashintel/petrinaut, and@hashintel/refractive.@rolldown/plugin-babelandbabel-plugin-react-compilerwithoxc-transform-react0.145.0.compileroption..d.tsfiles in the two library builds so the native transform does not interfere withrolldown-plugin-dtsoutput.@hashintel/ds-components.Build performance compared with main
@hashintel/refractive@hashintel/petrinaut@apps/petrinaut-websitePre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
The native compiler emits non-fatal experimental bailout diagnostics for some existing Petrinaut components and hooks. Those files remain valid and are skipped by the compiler where unsupported; builds complete successfully with
panicThreshold: "critical_errors".🐾 Next steps
🛡 What tests cover this?
yarn install --immutableyarn constraintsyarn lint:formatyarn exec turbo run build --filter @apps/petrinaut-website❓ How to test this?