Skip to content

rsc: strip server route exports from optimizeDeps scan#15005

Open
KimHyeongRae0 wants to merge 2 commits intoremix-run:mainfrom
KimHyeongRae0:fix/14934-rsc-optimize-deps
Open

rsc: strip server route exports from optimizeDeps scan#15005
KimHyeongRae0 wants to merge 2 commits intoremix-run:mainfrom
KimHyeongRae0:fix/14934-rsc-optimize-deps

Conversation

@KimHyeongRae0
Copy link
Copy Markdown

Fixes #14934.

Adds a scanner-only Rolldown transform so RSC route entries drop server exports before Vite 8's client optimizeDeps scan follows imports.

Validation:

  • pnpm test -- packages/react-router-dev/__tests__/rsc-virtual-route-modules-test.ts --runInBand
  • pnpm --filter @react-router/dev typecheck
  • pnpm playwright:integration --project=chromium integration/vite-dev-test.ts -g "does not prebundle RSC server-only route imports"
  • pnpm exec prettier --check packages/react-router-dev/vite/rsc/plugin.ts packages/react-router-dev/vite/rsc/virtual-route-modules.ts packages/react-router-dev/vite/vite.ts packages/react-router-dev/__tests__/rsc-virtual-route-modules-test.ts integration/vite-dev-test.ts packages/react-router-dev/.changes/unstable.rsc-optimize-deps-route-scan.md

@remix-cla-bot
Copy link
Copy Markdown
Contributor

remix-cla-bot Bot commented Apr 27, 2026

Hi @KimHyeongRae0,

Welcome, and thank you for contributing to React Router!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run.

Thanks!

- The Remix team

@remix-cla-bot
Copy link
Copy Markdown
Contributor

remix-cla-bot Bot commented Apr 27, 2026

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RSC: client optimizeDeps scanner prebundles server-only dependencies from route modules

2 participants