Skip to content

test(integration): add rsc-mf fixture for module federation + RSC#1

Closed
ScriptedAlchemy wants to merge 320 commits intomainfrom
cursor/module-federation-rsc-example-16dd
Closed

test(integration): add rsc-mf fixture for module federation + RSC#1
ScriptedAlchemy wants to merge 320 commits intomainfrom
cursor/module-federation-rsc-example-16dd

Conversation

@ScriptedAlchemy
Copy link
Copy Markdown
Owner

@ScriptedAlchemy ScriptedAlchemy commented Feb 12, 2026

Conventional Commit

test(integration): add rsc-mf fixture for module federation + RSC

Summary

  • Add a new rsc-mf integration fixture that demonstrates Module Federation with full React Server Components support in Modern.js.
  • Cover remote server actions, client components, and server-only modules in the fixture.
  • Pin to the required Rspack canary and configure source.enableAsyncEntry: false in 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

  • I have added changeset via pnpm run change.
  • I have updated the documentation.
  • I have added tests to cover my changes.

@cursor
Copy link
Copy Markdown

cursor bot commented Feb 12, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 12, 2026

⚠️ No Changeset found

Latest commit: 5683fbe

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 12, 2026

Rsdoctor Bundle Diff Analysis

📊 Quick Summary
Project Total Size Change
bundle-diff 2.9 MB +6.0 B (0.0%)
📋 Detailed Reports (Click to expand)

📁 bundle-diff

Path: benchmark/bundle-diff/dist/rsdoctor-data.json

📌 Baseline Commit: 7eb41c50e6 | PR: #2, #8351

Metric Current Baseline Change
📊 Total Size 2.9 MB 2.9 MB +6.0 B (0.0%)
📄 JavaScript 499.7 KB 499.7 KB 0
🎨 CSS 1.2 KB 1.2 KB 0
🌐 HTML 1.6 KB 1.6 KB 0
📁 Other Assets 2.4 MB 2.4 MB +6.0 B (0.0%)

📦 Download Diff Report: bundle-diff Bundle Diff

Generated by Rsdoctor GitHub Action

ScriptedAlchemy and others added 2 commits February 17, 2026 16:28
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
@ScriptedAlchemy ScriptedAlchemy changed the title Module federation RSC example test(integration): add rsc-mf fixture for module federation + RSC Feb 18, 2026
Comment thread packages/modernjs-v3/src/runtime/rsc-client-callback-bootstrap.js Outdated
Comment thread packages/modernjs-v3/src/server/staticMiddleware.ts Outdated
Comment thread packages/modernjs-v3/src/server/staticMiddleware.ts Outdated
Comment thread packages/modernjs-v3/tests/config-plugin-contract.test.ts
ScriptedAlchemy and others added 11 commits February 17, 2026 21:28
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>
Comment thread packages/runtime/render/src/client/callServer.ts Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-mf integration 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.

Comment thread packages/modernjs-v3/package.json
Comment thread package.json
const BUNDLE_LOADER_STRATEGIES_KEY = '__MODERN_JS_BUNDLE_LOADER_STRATEGIES__';

type GlobalWithBundleLoaderStrategies = typeof globalThis & {
[BUNDLE_LOADER_STRATEGIES_KEY]?: BundleLoaderStrategy[];
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

why are we adding global exposures?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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.

ScriptedAlchemy and others added 3 commits February 18, 2026 13:06
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>
@ScriptedAlchemy
Copy link
Copy Markdown
Owner Author

Closing this fork PR in favor of upstream PR: web-infra-dev#8366

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.

3 participants