test(integration): add rsc-mf fixture for module federation + RSC#1
test(integration): add rsc-mf fixture for module federation + RSC#1ScriptedAlchemy wants to merge 320 commits intomainfrom
Conversation
|
Cursor Agent can help with this pull request. Just |
|
Rsdoctor Bundle Diff Analysis📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 bundle-diffPath:
📦 Download Diff Report: bundle-diff Bundle Diff Generated by Rsdoctor GitHub Action |
Avoid calling string methods on non-string remote `external` values while replacing localhost URLs, so object remotes without an external string no longer throw at runtime. Co-authored-by: Cursor <cursoragent@cursor.com>
…sc-build-a6af Module federation rsc build
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Prevent static middleware path traversal-by-reset by resolving requests under the bundles root with explicit containment checks, and make bridge loading dedupe atomic by caching a pending promise before triggering remote load side effects. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a comprehensive integration test fixture (rsc-mf) demonstrating Module Federation with full React Server Components (RSC) support in Modern.js. The fixture includes host and remote applications with server actions, client components, and server-only modules, along with extensive contract tests validating configuration behavior.
Changes:
- New
rsc-mfintegration fixture with host/remote apps supporting RSC + Module Federation - Contract tests for module federation config, Modern.js config, and tsconfig alignment
- Runtime implementation for RSC bridge, action ID resolution, and async startup loading
- Server-side static file serving and bundle loading strategies
- Updates to i18n MF fixtures to use workspace references
- Rspack canary version pinning for MF + RSC experimental support
Reviewed changes
Copilot reviewed 119 out of 125 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/integration/rsc-mf/** | New integration test fixture with host/remote apps, comprehensive contract tests |
| packages/modernjs-v3/** | New Modern.js v3 plugin package with RSC + MF runtime, server plugins, and configuration |
| packages/server/core/src/adapters/node/plugins/resource.ts | Bundle loader strategy registration system for custom bundle formats |
| packages/runtime/render/src/client/callServer.ts | Pluggable action ID resolver for Module Federation remote actions |
| packages/runtime/render/src/server/rsc/rsc.tsx | Dev-only detailed error messages for RSC action failures |
| tests/integration/i18n/mf/**/package.json | Updated to use workspace references instead of hardcoded versions |
| package.json | Rspack canary version and Module Federation pkg.pr.new dependency overrides |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const BUNDLE_LOADER_STRATEGIES_KEY = '__MODERN_JS_BUNDLE_LOADER_STRATEGIES__'; | ||
|
|
||
| type GlobalWithBundleLoaderStrategies = typeof globalThis & { | ||
| [BUNDLE_LOADER_STRATEGIES_KEY]?: BundleLoaderStrategy[]; |
There was a problem hiding this comment.
why are we adding global exposures?
There was a problem hiding this comment.
Updated in 52489bffc3.
Removed the global strategy store entirely. The bundle loader strategy registry is now module-scoped (bundleLoaderStrategies) instead of using globalThis, so no global exposure is introduced.
Update fixture package pins to the latest core canaries and tighten rsc-mf containment resolution contracts to match the new modern-js-v3 loading behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
…cy check Co-authored-by: Cursor <cursoragent@cursor.com>
|
Closing this fork PR in favor of upstream PR: web-infra-dev#8366 |
Conventional Commit
test(integration): add rsc-mf fixture for module federation + RSCSummary
rsc-mfintegration fixture that demonstrates Module Federation with full React Server Components support in Modern.js.source.enableAsyncEntry: falsein both host and remote Modern.js configs for stable RSC runtime behavior when MF is enabled.Why
This provides a concrete, reproducible integration test setup for MF + RSC and documents the runtime configuration required to keep server behavior stable.
Related Links
Checklist
pnpm run change.