Skip to content

chore(next): switch apps to Rust React Compiler - #490

Merged
BleedingDev merged 4 commits into
masterfrom
chore/rust-react-compiler-next-apps
Jun 30, 2026
Merged

BleedingDev merged 4 commits into
masterfrom
chore/rust-react-compiler-next-apps

Conversation

@BleedingDev

@BleedingDev BleedingDev commented Jun 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • enable experimental.turbopackRustReactCompiler for the four Next 16.3 apps
  • remove direct babel-plugin-react-compiler dependencies from those apps after local production builds passed without direct package resolution
  • keep Medusa admin compiler dependencies untouched

Closes #485

Validation

  • mise exec -- pnpm install --frozen-lockfile
  • mise exec -- bunx biome check --write apps/frontend-demo/next.config.js apps/frontend-demo/package.json apps/n1/next.config.ts apps/n1/package.json apps/payload/next.config.mjs apps/payload/package.json
  • mise exec -- pnpm -C apps/frontend-demo exec next build
  • mise exec -- pnpm -C apps/herbatika build
  • mise exec -- pnpm -C libs/analytics build && mise exec -- pnpm -C apps/n1 build
  • mise exec -- env PAYLOAD_SECRET=local-build-secret DATABASE_URL=postgresql://payload:payload@127.0.0.1:5432/payload S3_ENDPOINT=http://127.0.0.1:9000 S3_REGION=us-east-1 S3_BUCKET=payload-media S3_ACCESS_KEY_ID=payload S3_SECRET_ACCESS_KEY=payload-secret pnpm -C apps/payload build
  • mise exec -- ./node_modules/.bin/nubx --node nx affected -t lint test --files="<changed files>"

Summary by CodeRabbit

  • New Features
    • Enabled the Rust-based React compiler experimental path across multiple Next.js app configurations.
  • Chores
    • Switched local development and build scripts to use Turbopack (--turbopack) across affected apps and the development container.
    • Removed the babel-plugin-react-compiler dependency from the relevant app package(s).

@semanticdiff-com

semanticdiff-com Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  apps/herbatika/next.config.ts  20% smaller
  .github/workflows/ci.yml  0% smaller
  apps/frontend-demo/next.config.js  0% smaller
  apps/frontend-demo/package.json  0% smaller
  apps/herbatika/package.json  0% smaller
  apps/n1/next.config.ts  0% smaller
  apps/n1/package.json  0% smaller
  apps/payload/next.config.mjs  0% smaller
  apps/payload/package.json  0% smaller
  docker/development/herbatika/Dockerfile Unsupported file format
  docker/development/n1/Dockerfile Unsupported file format
  pnpm-lock.yaml  0% smaller

@vercel

vercel Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
new-engine-ui-storybook Ready Ready Preview, Comment Jun 30, 2026 7:35pm

@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@BleedingDev, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e0de5a98-b507-4680-b1b6-0b724d2ab8a3

📥 Commits

Reviewing files that changed from the base of the PR and between 362288f and 7bdf2a8.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • apps/herbatika/next.config.ts
  • docker/development/n1/Dockerfile

Walkthrough

Across four Next.js apps, experimental.turbopackRustReactCompiler: true is added to each app config, the babel-plugin-react-compiler dependency is removed where present, and the affected app and Docker commands are updated to run Next with --turbopack.

Changes

Turbopack Rust React Compiler switch

Layer / File(s) Summary
Enable the Rust compiler flag
apps/frontend-demo/next.config.js, apps/herbatika/next.config.ts, apps/n1/next.config.ts, apps/payload/next.config.mjs, apps/frontend-demo/package.json, apps/herbatika/package.json, apps/payload/package.json
Adds experimental.turbopackRustReactCompiler: true to each app's Next.js config and removes babel-plugin-react-compiler from the affected manifests.
Switch app and Docker commands to Turbopack
apps/frontend-demo/package.json, apps/herbatika/package.json, apps/n1/package.json, apps/payload/package.json, docker/development/herbatika/Dockerfile
Updates the Next.js dev and build scripts to pass --turbopack, and changes the herbatika Docker dev and build commands to use Turbopack.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarises the main change: switching the Next apps to the Rust React Compiler path.
Linked Issues check ✅ Passed The four Next apps enable experimental.turbopackRustReactCompiler, remove the compiler plugin, and leave Medusa admin untouched.
Out of Scope Changes check ✅ Passed All changes stay within the Next app compiler switch and related script or Docker updates; no unrelated areas are shown.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/rust-react-compiler-next-apps
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch chore/rust-react-compiler-next-apps

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Storybook A11y Report

⚠️ Non-blocking mode: violations will NOT fail CI (A11Y_REPORT_FAIL_ON_VIOLATIONS=false).

Light

No a11y report JSON found for light. Storybook test-runner likely failed before reporting.

Dark

No a11y report JSON found for dark. Storybook test-runner likely failed before reporting.

@greptile-apps

greptile-apps Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR migrates four Next.js 16.3 apps (frontend-demo, herbatika, n1, payload) from Babel-based React Compiler (babel-plugin-react-compiler) to the Turbopack Rust React Compiler (experimental.turbopackRustReactCompiler). All dev/build scripts and Docker build stages gain the --turbopack flag, the direct babel-plugin-react-compiler dependencies are dropped, and the Payload app loses its now-unnecessary webpack extensionAlias callback.

  • experimental.turbopackRustReactCompiler: true is added to all four next.config.* files; reactCompiler: true is retained for any webpack fallback path, maintaining dual-mode coverage.
  • babel-plugin-react-compiler is removed from four package.json files and the corresponding lockfile entries; the package still resolves transitively through Next.js optional peer dependencies hoisted from Medusa admin.
  • CI (ci.yml) and both Docker build stages (herbatika, n1) are updated to pass TURBOPACK=1 / --turbopack to next typegen and build commands.

Confidence Score: 5/5

Safe to merge — all four apps confirmed building with Turbopack in production, the lockfile reflects only the four direct-dependency removals, and CI / Docker stages are consistently updated.

The change is a straightforward experimental-flag toggle plus build-script flag addition. The two concerns raised in previous review rounds (Turbopack being suppressed by withPayload, and lockfile drift beyond stated scope) were both addressed and confirmed by the author. No new functional regressions are visible in the changed files.

No files require special attention.

Important Files Changed

Filename Overview
apps/frontend-demo/next.config.js Added experimental.turbopackRustReactCompiler: true; retains top-level reactCompiler: true for webpack fallback. Consistent with other apps.
apps/herbatika/next.config.ts Added turbopackRustReactCompiler: true; removed webpack-only cpus: 1 and webpackMemoryOptimizations: true which are no longer relevant with Turbopack.
apps/n1/next.config.ts Added turbopackRustReactCompiler: true to the existing experimental block alongside typedEnv: true. No other changes.
apps/payload/next.config.mjs Removed the webpack extensionAlias callback (no longer needed by Turbopack) and added experimental.turbopackRustReactCompiler: true. Author confirmed withPayload does not suppress Turbopack for this build.
docker/development/herbatika/Dockerfile Switched dev CMD and build RUN step from --webpack to --turbopack; cache mount target .next/cache is compatible with Turbopack.
docker/development/n1/Dockerfile Added TURBOPACK=1 before next typegen in the build stage; production build runs via the updated package.json build script which already carries --turbopack.
.github/workflows/ci.yml Added TURBOPACK=1 to the next typegen step for n1 to match the Turbopack-only configuration; no other CI changes.
pnpm-lock.yaml Removes the four direct babel-plugin-react-compiler importer entries. Package still appears in peer-resolution strings via Next.js optional peer hoisting from Medusa admin — expected and benign.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[next build --turbopack] --> B{Turbopack active?}
    B -->|Yes - all 4 apps| C[experimental.turbopackRustReactCompiler: true]
    B -->|No - fallback| D[reactCompiler: true]
    C --> E[Rust React Compiler]
    D --> E2[Babel React Compiler via hoisting]
    subgraph Apps migrated
        F[frontend-demo]
        G[herbatika]
        H[n1]
        I[payload]
    end
    A --> F & G & H & I
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[next build --turbopack] --> B{Turbopack active?}
    B -->|Yes - all 4 apps| C[experimental.turbopackRustReactCompiler: true]
    B -->|No - fallback| D[reactCompiler: true]
    C --> E[Rust React Compiler]
    D --> E2[Babel React Compiler via hoisting]
    subgraph Apps migrated
        F[frontend-demo]
        G[herbatika]
        H[n1]
        I[payload]
    end
    A --> F & G & H & I
Loading

Reviews (6): Last reviewed commit: "chore: remove stale herbatika webpack tu..." | Re-trigger Greptile

Comment thread apps/payload/next.config.mjs
Comment thread pnpm-lock.yaml

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c2bfd0a2c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/herbatika/next.config.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 362288fd38

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/n1/next.config.ts
@BleedingDev
BleedingDev merged commit 309c7d4 into master Jun 30, 2026
8 of 9 checks passed
@BleedingDev
BleedingDev deleted the chore/rust-react-compiler-next-apps branch June 30, 2026 19:53
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.19.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

This branch was successfully deployed

1 active deployment
Preview — 7bdf2a8c Deployed Jun 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(next): switch Next apps to the Turbopack Rust React Compiler

1 participant