feat(modern-js-plugin-v3): port RSC bridge support into core#4467
feat(modern-js-plugin-v3): port RSC bridge support into core#4467ScriptedAlchemy wants to merge 9 commits intomainfrom
Conversation
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 detectedLatest commit: b7d17c6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 43 packages
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 |
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 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".
| chain.resolve.conditionNames | ||
| .clear() | ||
| .add('require') | ||
| .add('import') | ||
| .add('default'); |
There was a problem hiding this comment.
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 👍 / 👎.
| runBundle( | ||
| localModule.exports, | ||
| require, | ||
| localModule, |
There was a problem hiding this comment.
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 👍 / 👎.
@module-federation/devtools
@module-federation/cli
create-module-federation
@module-federation/data-prefetch
@module-federation/dts-plugin
@module-federation/enhanced
@module-federation/error-codes
@module-federation/managers
@module-federation/manifest
@module-federation/metro
@module-federation/metro-plugin-rnc-cli
@module-federation/metro-plugin-rnef
@module-federation/modern-js-v3
@module-federation/retry-plugin
@module-federation/rsbuild-plugin
@module-federation/rspack
@module-federation/rspress-plugin
@module-federation/runtime
@module-federation/runtime-core
@module-federation/runtime-tools
@module-federation/sdk
@module-federation/third-party-dts-extractor
@module-federation/treeshake-frontend
@module-federation/treeshake-server
@module-federation/webpack-bundler-runtime
@module-federation/bridge-react
@module-federation/bridge-react-webpack-plugin
@module-federation/bridge-shared
@module-federation/bridge-vue3
@module-federation/inject-external-runtime-core-plugin
commit: |
Bundle Size Report4 package(s) changed, 37 unchanged.
Total dist: 7.10 MB (+218.1 kB (+3.1%)) |
Align server-side RSC bridge resolution and dev asset serving with pre-move modern.js behavior. This prevents host SSR from loading browser remote entries and unblocks dev/build rsc-mf flows. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
rsc-bridge-runtime-plugin,rsc-bridge-expose, and client callback bootstrap wiring@modern-js/server-core/nodestrategy registration for compatibility with published server-core typespackages/modernjs-v3Test plan
npx nx format:checknpx nx run modern-js-plugin-v3:testnpx nx run modern-js-plugin-v3:buildnpx nx run-many --targets=build --projects=tag:type:pkg --parallel=4npx 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-devtoolsnpx nx run-many --targets=build --projects=tag:type:pkg --parallel=4 --skip-nx-cache(fails on unrelatedchrome-devtools:buildTS2305 for@module-federation/sdkexports)Made with Cursor