Skip to content

feat(remix2): add isolated native Remix 2 compiler mode - #162

Closed
ScriptedAlchemy wants to merge 1 commit into
mainfrom
feat/remix2-runtime
Closed

ScriptedAlchemy wants to merge 1 commit into
mainfrom
feat/remix2-runtime

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Collaborator

Why

Remix 2 applications need the native React Router 6 compiler protocol without changing their framework imports or application entries.
Add a dedicated rsbuild-plugin-react-router/remix2 entry instead of compatibility aliases to React Router 7.

What changed

  • Export pluginRemix2, independent ESM and CommonJS bundles, declarations, and native manifest and route transforms.
  • Make framework peers optional and validate the selected mode. Move @react-router/node out of production dependencies; root-mode applications must install it for the default server entry.
  • Publish paired development builds, retain immutable browser assets until server close, and add isolated package, HTTP, browser, and lifecycle tests.

Scope

  • Support the pinned Remix 2.11.2 and React Router 6.26.1 runtime. Existing root React Router 7, React Router 8, and RSC modes remain.
  • Single-fetch and lazy route discovery are unsupported. Fatal compiler-hook errors retain the last complete build but require a development-server restart.
  • TTArk and GuluX integration remain separate work. This PR does not establish monorepo approval or external file-watcher compatibility.

Blast Radius

Native applications keep their actual framework modules and unchanged custom entries. Optional peer metadata changes package installation for all modes; startup checks report missing or incompatible mode packages.
Development memory grows with distinct immutable assets until close, so slow documents can hydrate after rebuilds.

Verification

  • Current pnpm install --frozen-lockfile, serial pnpm build and pack, source and test typechecks, eight native unit tests, package interop, scoped formatting, and diff checks pass. All 200 packed files match the independently reviewed artifact.
  • The final packed node scripts/test-remix2-isolated.mts plugin run passed native isolation, declarations, development and production Chromium, five HTTP tests, aliases, retention, and prior regressions. Independent follow-up probes passed supersession, failed publication, and close ownership. See the fixture evidence.
  • Earlier fix-stage runs passed 857 core tests, full plugin and integration typechecks, 13 selected React Router 7 browser tests, and React Router 8 acceptance. Those broad suites were not repeated for the final native-only retention fix.

@pkg-pr-new

pkg-pr-new Bot commented Oct 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/rsbuild-plugin-react-router@7defe8c

commit: 7defe8c

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark results

Case Base Head Delta
build-256-ssr 2121.1 ms 2091.2 ms -1.4%
dev-48-ssr 934.4 ms 910.7 ms -2.5%

@codspeed

codspeed Bot commented Oct 22, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 1 untouched benchmark
⏩ 2 skipped benchmarks1


Comparing feat/remix2-runtime (7defe8c) with main (a09dd6a)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@ScriptedAlchemy

Copy link
Copy Markdown
Collaborator Author

Closing: the Remix 2 / React Router 6 support for TTArk will live as a TTArk-owned package in its monorepo instead of in this plugin. Keeping the branch for reference.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant