Skip to content

Comments

feat(modern-js-plugin-v3): port RSC bridge support into core#4467

Open
ScriptedAlchemy wants to merge 9 commits intomainfrom
feat/modernjs-rsc
Open

feat(modern-js-plugin-v3): port RSC bridge support into core#4467
ScriptedAlchemy wants to merge 9 commits intomainfrom
feat/modernjs-rsc

Conversation

@ScriptedAlchemy
Copy link
Member

Summary

  • port modernjs-v3 RSC bridge runtime support into core, including rsc-bridge-runtime-plugin, rsc-bridge-expose, and client callback bootstrap wiring
  • add async startup loader integration and guarded @modern-js/server-core/node strategy registration for compatibility with published server-core types
  • merge modern.js parity updates across config/SSR/static middleware and add RSC/contract test coverage under packages/modernjs-v3

Test plan

  • npx nx format:check
  • npx nx run modern-js-plugin-v3:test
  • npx nx run modern-js-plugin-v3:build
  • npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4
  • npx nx affected -t test --parallel=3 --exclude='*,!tag:type:pkg'
  • npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4 --skip-nx-cache --exclude=chrome-devtools
  • npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4 --skip-nx-cache (fails on unrelated chrome-devtools:build TS2305 for @module-federation/sdk exports)

Made with Cursor

Port the modernjs-v3 RSC bridge runtime, async startup loader, and config/SSR wiring into core.
Add parity tests plus static middleware hardening for stable manifest serving and action routing.

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot
Copy link

changeset-bot bot commented Feb 21, 2026

🦋 Changeset detected

Latest commit: b7d17c6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 43 packages
Name Type
@module-federation/modern-js-v3 Patch
@module-federation/sdk Patch
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
@module-federation/devtools Patch
@module-federation/cli Patch
@module-federation/data-prefetch Patch
@module-federation/dts-plugin Patch
@module-federation/enhanced Patch
@module-federation/esbuild Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/metro Patch
@module-federation/modern-js Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/retry-plugin Patch
@module-federation/rsbuild-plugin Patch
@module-federation/rspack Patch
@module-federation/rspress-plugin Patch
@module-federation/runtime-core Patch
@module-federation/runtime Patch
@module-federation/storybook-addon Patch
@module-federation/utilities Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
shared-tree-shaking-no-server-host Patch
shared-tree-shaking-no-server-provider Patch
@module-federation/metro-plugin-rnc-cli Patch
@module-federation/metro-plugin-rnef Patch
remote5 Patch
remote6 Patch
website-new Patch
@module-federation/runtime-tools Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/bridge-shared Patch
@module-federation/error-codes Patch
create-module-federation Patch
@module-federation/treeshake-server Patch
@module-federation/treeshake-frontend Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Feb 21, 2026

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit b7d17c6
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/699a32bfc0a2880008c7a9a8
😎 Deploy Preview https://deploy-preview-4467--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link

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

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: ede7e89a78

ℹ️ 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 on lines 765 to 769
chain.resolve.conditionNames
.clear()
.add('require')
.add('import')
.add('default');

Choose a reason for hiding this comment

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

P1 Badge Preserve server resolve conditions when enabling RSC

patchBundlerConfig currently clears chain.resolve.conditionNames for every server RSC build and re-adds only require/import/default. That drops existing server conditions (notably node), so packages that use conditional exports can resolve to non-Node entries in SSR (for example falling back to default/browser builds), which can break runtime behavior as soon as such a dependency is present. Keep the existing condition set and append react-server instead of resetting the list.

Useful? React with 👍 / 👎.

Comment on lines +51 to +54
runBundle(
localModule.exports,
require,
localModule,

Choose a reason for hiding this comment

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

P1 Badge Use bundle-scoped require when executing async startup code

The VM wrapper is invoked with this module's require, not a require bound to filepath. If the async-startup bundle (or its runtime chunk loader) performs relative imports like require('./<chunk>.js'), resolution happens relative to asyncStartupLoader.ts and fails with MODULE_NOT_FOUND, causing the strategy to return undefined and leaving async-startup bundles uninitialized. Use a filepath-scoped loader (e.g. module.createRequire(filepath)) when calling runBundle.

Useful? React with 👍 / 👎.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 21, 2026

Open in StackBlitz

@module-federation/devtools

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/devtools@b7d17c6

@module-federation/cli

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/cli@b7d17c6

create-module-federation

pnpm add https://pkg.pr.new/module-federation/core/create-module-federation@b7d17c6

@module-federation/data-prefetch

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/data-prefetch@b7d17c6

@module-federation/dts-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/dts-plugin@b7d17c6

@module-federation/enhanced

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/enhanced@b7d17c6

@module-federation/error-codes

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/error-codes@b7d17c6

@module-federation/managers

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/managers@b7d17c6

@module-federation/manifest

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/manifest@b7d17c6

@module-federation/metro

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/metro@b7d17c6

@module-federation/metro-plugin-rnc-cli

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/metro-plugin-rnc-cli@b7d17c6

@module-federation/metro-plugin-rnef

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/metro-plugin-rnef@b7d17c6

@module-federation/modern-js-v3

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/modern-js-v3@b7d17c6

@module-federation/retry-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/retry-plugin@b7d17c6

@module-federation/rsbuild-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/rsbuild-plugin@b7d17c6

@module-federation/rspack

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/rspack@b7d17c6

@module-federation/rspress-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/rspress-plugin@b7d17c6

@module-federation/runtime

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/runtime@b7d17c6

@module-federation/runtime-core

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/runtime-core@b7d17c6

@module-federation/runtime-tools

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/runtime-tools@b7d17c6

@module-federation/sdk

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/sdk@b7d17c6

@module-federation/third-party-dts-extractor

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/third-party-dts-extractor@b7d17c6

@module-federation/treeshake-frontend

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/treeshake-frontend@b7d17c6

@module-federation/treeshake-server

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/treeshake-server@b7d17c6

@module-federation/webpack-bundler-runtime

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/webpack-bundler-runtime@b7d17c6

@module-federation/bridge-react

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/bridge-react@b7d17c6

@module-federation/bridge-react-webpack-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/bridge-react-webpack-plugin@b7d17c6

@module-federation/bridge-shared

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/bridge-shared@b7d17c6

@module-federation/bridge-vue3

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/bridge-vue3@b7d17c6

@module-federation/inject-external-runtime-core-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/inject-external-runtime-core-plugin@b7d17c6

commit: b7d17c6

@github-actions
Copy link
Contributor

github-actions bot commented Feb 21, 2026

Bundle Size Report

4 package(s) changed, 37 unchanged.

Package Total dist Delta ESM gzip Delta
modern-js-plugin-v3 392.5 kB +206.3 kB (+110.7%) 900 B no change
sdk 109.4 kB +4.9 kB (+4.6%) 8.7 kB +596 B (+7.2%)
bridge-react 363.9 kB +4.4 kB (+1.2%) 1.3 kB +4 B (+0.3%)
vue3-bridge 161.5 kB +2.6 kB (+1.6%) 23.7 kB +442 B (+1.9%)

Total dist: 7.10 MB (+218.1 kB (+3.1%))
Total ESM gzip: 139.6 kB (+1.0 kB (+0.7%))

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.

1 participant