Skip to content

feat(rstest-plugin): add standalone federation plugin package#4320

Open
ScriptedAlchemy wants to merge 72 commits into
mainfrom
rstest-plugin
Open

feat(rstest-plugin): add standalone federation plugin package#4320
ScriptedAlchemy wants to merge 72 commits into
mainfrom
rstest-plugin

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Jan 27, 2026

Copy link
Copy Markdown
Member

Summary

  • introduce @module-federation/rstest-plugin as a dedicated package extracted from @rstest/core
  • provide federation() plugin wiring for Rsbuild-based test flows
  • include package scaffolding, tests, docs, and project configuration for standalone publishability

Changed Packages

  • @module-federation/rstest-plugin

Changesets

  • .changeset/sharp-rats-sniff.md (@module-federation/rstest-plugin: patch)
  • .changeset/config.json (changeset tooling config update)

Base

  • main

Single-PR Review Guide (No Additional PRs)

This PR will remain a single PR. Improvements are being done in-place (no stacked or follow-up PR splitting).

Suggested Review Order

  1. Core behavior/runtime changes first.
  2. Build/tooling and workflow updates second.
  3. Docs/examples/app fixtures last.

In-Place Scope Trim Checklist

  • Remove unrelated churn not required for this PR goal.
  • Keep lockfile and generated changes only when strictly needed.
  • Confirm acceptance criteria and regression tests are explicit in this PR.
  • Resolve merge conflict status and required CI checks before final re-review.

Scope Justification (Reviewed In-Place)

  • Root package.json pnpm overrides (eslint-plugin-ft-flow, eslint-plugin-react-native): required for @react-native/eslint-config (metro packages) to resolve consistently against the workspace's eslint 9 under the updated lockfile; removing them breaks frozen-lockfile installs.
  • packages/enhanced schema change (family enum [0, 4, 6]): syncs ModuleFederationPlugin.json with the already-updated generated TypeScript schema; a changeset for @module-federation/enhanced is now included.
  • packages/rsbuild-plugin library.name removal in patchNodeMFConfig: intentional behavior change (covered by its changeset); Node SSR containers keep the bundler-derived library name, while the rstest plugin forces the container name for test-worker resolution. Both helpers now cross-reference each other documenting the divergence.

@changeset-bot

changeset-bot Bot commented Jan 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 725cadc

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

This PR includes changesets to release 48 packages
Name Type
@module-federation/rstest Patch
@module-federation/rsbuild-plugin Patch
@module-federation/enhanced Patch
@module-federation/modern-js-v3 Patch
@module-federation/modern-js Patch
@module-federation/playground Patch
@module-federation/rspress-plugin Patch
remote5 Patch
remote6 Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/storybook-addon Patch
shared-tree-shaking-no-server-host Patch
shared-tree-shaking-no-server-provider Patch
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
website-new Patch
node-dynamic-remote-new-version Patch
node-dynamic-remote Patch
@module-federation/runtime Patch
@module-federation/rspack Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/sdk Patch
@module-federation/runtime-tools Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/dts-plugin Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/devtools Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/retry-plugin Patch
@module-federation/error-codes Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/runtime-core Patch
create-module-federation Patch
@module-federation/cli Patch
@module-federation/treeshake-server Patch
@module-federation/treeshake-frontend Patch
@module-federation/metro Patch
@module-federation/metro-plugin-rnef Patch
@module-federation/metro-plugin-rock Patch
@module-federation/metro-plugin-rnc-cli Patch
@module-federation/esbuild Patch
@module-federation/observability-plugin Patch
@module-federation/utilities 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

netlify Bot commented Jan 27, 2026

Copy link
Copy Markdown

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 725cadc
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/6a461a63b256cd0008f10b86
😎 Deploy Preview https://deploy-preview-4320--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@ScriptedAlchemy ScriptedAlchemy changed the title fix(rstest-plugin): force cjs output for federation tests chore(enhanced): migrate to rstest Jan 28, 2026
@ScriptedAlchemy ScriptedAlchemy changed the title chore(enhanced): migrate to rstest feat(rstest): rstest plugin Jan 29, 2026
@github-actions

github-actions Bot commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Report

16 package(s) changed, 27 unchanged.

Package dist + ESM entry

Package Total dist (raw) Delta ESM gzip Delta
@module-federation/cli 26.3 kB no change 786 B no change
@module-federation/core 39.1 kB no change 173 B no change
@module-federation/devtools 665.5 kB no change 4.0 kB no change
@module-federation/enhanced 810.0 kB no change 672 B no change
@module-federation/managers 70.0 kB no change 334 B no change
@module-federation/manifest 136.1 kB no change 182 B no change
@module-federation/metro-plugin-rnc-cli 0 B no change 314 B no change
@module-federation/node 193.4 kB no change 217 B no change
@module-federation/playground 28.81 MB -27 B (-0.0%) 50.9 kB no change
@module-federation/rsbuild-plugin 121.1 kB +1.3 kB (+1.1%) 91 B no change
@module-federation/rstest 27.3 kB +27.3 kB (+∞%) 2.6 kB +2.6 kB (+∞%)
@module-federation/runtime 20.0 kB -13 B (-0.1%) 715 B no change
@module-federation/runtime-core 287.7 kB +8 B (+0.0%) 477 B no change
@module-federation/runtime-tools 7.7 kB -65 B (-0.8%) 142 B no change
@module-federation/storybook-addon 79.2 kB no change 100 B no change
@module-federation/utilities 110.6 kB no change 328 B no change

Bundle targets

Package Web bundle (gzip) Delta Node bundle (gzip) Delta
@module-federation/cli 2.3 kB -34 B (-1.4%) 2.3 kB -34 B (-1.4%)
@module-federation/core 1.1 kB -33 B (-2.9%) 1.0 kB -32 B (-3.0%)
@module-federation/devtools 30.3 kB -27 B (-0.1%) 30.3 kB -27 B (-0.1%)
@module-federation/enhanced 2.6 kB -46 B (-1.7%) 2.6 kB -46 B (-1.7%)
@module-federation/managers 2.4 kB -29 B (-1.2%) 2.4 kB -29 B (-1.2%)
@module-federation/manifest 6.1 kB -42 B (-0.7%) 6.1 kB -42 B (-0.7%)
@module-federation/metro-plugin-rnc-cli 411 B -27 B (-6.2%) 411 B -27 B (-6.2%)
@module-federation/node 9.2 kB -30 B (-0.3%) 9.2 kB -30 B (-0.3%)
@module-federation/playground 47.0 kB no change 47.0 kB no change
@module-federation/rsbuild-plugin 4.5 kB -6 B (-0.1%) 4.5 kB -6 B (-0.1%)
@module-federation/rstest 1.7 kB +1.7 kB (+∞%) 1.7 kB +1.7 kB (+∞%)
@module-federation/runtime 687 B no change 687 B no change
@module-federation/runtime-core 15.3 kB no change 15.0 kB no change
@module-federation/runtime-tools 89 B no change 89 B no change
@module-federation/storybook-addon 1.9 kB -25 B (-1.3%) 1.7 kB -25 B (-1.4%)
@module-federation/utilities 2.6 kB -33 B (-1.2%) 2.6 kB -33 B (-1.2%)

Consumer scenarios

Scenario Web output (gzip) Delta Node output (gzip) Delta Gap (node-web) Delta
Enhanced remoteEntry 21.4 kB -15 B (-0.1%) 22.5 kB -9 B (-0.0%) +1.1 kB +6 B

Total dist (raw): 35.67 MB (+28.4 kB (+0.1%))
Total ESM gzip: 132.1 kB (+2.6 kB (+2.0%))
Total web bundle (gzip): 256.1 kB (+1.4 kB (+0.5%))
Total node bundle (gzip): 256.6 kB (+1.4 kB (+0.5%))
Tracked ./bundler entry gzip: 556 B (no change)
Tracked ./bundler web bundle (gzip): 4.8 kB (no change)
Tracked ./bundler node bundle (gzip): 4.8 kB (no change)

Bundle sizes are generated with rslib (Rspack). Package-root metrics preserve the historical report. Tracked subpath exports such as ./bundler are measured separately so ENV_TARGET-driven tree-shaking is visible. Bare imports are externalized to keep package-level sizes consistent, and assets are emitted as resources.

ScriptedAlchemy and others added 10 commits February 6, 2026 15:39
raven-actions/actionlint@v2 runs npm install internally which fails
on pnpm workspace repos due to workspace:* protocol. Switch to direct
binary download which has no npm dependency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	pnpm-lock.yaml
@ScriptedAlchemy ScriptedAlchemy changed the title feat(rstest): rstest plugin feat(rstest-plugin): add standalone federation plugin package Feb 12, 2026
@pkg-pr-new

pkg-pr-new Bot commented Feb 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

@module-federation/devtools

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

@module-federation/cli

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

create-module-federation

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

@module-federation/dts-plugin

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

@module-federation/enhanced

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

@module-federation/error-codes

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

@module-federation/esbuild

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/esbuild@725cadc

@module-federation/managers

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

@module-federation/manifest

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

@module-federation/metro

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

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

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

@module-federation/metro-plugin-rnef

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

@module-federation/metro-plugin-rock

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/metro-plugin-rock@725cadc

@module-federation/modern-js

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

@module-federation/modern-js-v3

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

@module-federation/native-federation-tests

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/native-federation-tests@725cadc

@module-federation/native-federation-typescript

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/native-federation-typescript@725cadc

@module-federation/nextjs-mf

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/nextjs-mf@725cadc

@module-federation/node

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/node@725cadc

@module-federation/observability-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/observability-plugin@725cadc

@module-federation/playground

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/playground@725cadc

@module-federation/retry-plugin

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

@module-federation/rsbuild-plugin

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

@module-federation/rspack

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

@module-federation/rspress-plugin

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

@module-federation/rstest

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/rstest@725cadc

@module-federation/runtime

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

@module-federation/runtime-core

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

@module-federation/runtime-tools

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

@module-federation/sdk

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

@module-federation/storybook-addon

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/storybook-addon@725cadc

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

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

@module-federation/treeshake-frontend

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

@module-federation/treeshake-server

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

@module-federation/typescript

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/typescript@725cadc

@module-federation/utilities

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/utilities@725cadc

@module-federation/webpack-bundler-runtime

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

@module-federation/bridge-react

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

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

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

@module-federation/bridge-shared

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

@module-federation/bridge-vue3

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

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

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

commit: 725cadc

@zhoushaw zhoushaw closed this Mar 9, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Stale pull request message

# Conflicts:
#	apps/website-new/docs/en/guide/build-plugins/_meta.json
#	apps/website-new/docs/en/guide/build-plugins/plugins.mdx
#	apps/website-new/docs/en/integrations/bundler/plugins-rstest.mdx
#	apps/website-new/docs/zh/guide/build-plugins/_meta.json
#	apps/website-new/docs/zh/guide/build-plugins/plugins.mdx
#	apps/website-new/docs/zh/integrations/bundler/plugins-rstest.mdx
#	pnpm-lock.yaml
ScriptedAlchemy added 9 commits June 12, 2026 02:42
- default off MF dts/manifest/dev machinery in test builds (explicit user
  values win) and warn when forcing asyncStartup, library.name, or
  experiments.optimization.target over explicit user config
- use api.context.callerName to warn outside rstest and default the target
  to browser under the rstest-browser runner (explicit target wins)
- export FEDERATION_PLUGIN_NAME as the stable public plugin name
- register modifyEnvironmentConfig with order 'post' so the externals
  bypass stays ahead of other plugins regardless of registration order
- sniff federation remotes from duck-typed plugins and cover scoped string
  remotes (@scope/remote@url) with a regression test
Widen the @rsbuild/core peer range to ^1.3.21 || ^2.0.0, build and test
against the 2.x line rstest actually uses, and raise engines.node to
rstest's floor (^20.19.0 || >=22.12.0). rspack 2.x dropped
experiments.outputModule from its types, so keep that 1.x-only assignment
behind a cast.
State that federation: true requires the unreleased @rstest/core federation
build (web-infra-dev/rstest#1407, pkg.pr.new canary), declare the
rstest:federation plugin name a stable public contract, and reword the
provenance blurb: the package is rstest federation mode's companion plugin,
not an extraction from @rstest/core.
Install the pkg.pr.new canaries from web-infra-dev/rstest#1407 (commit
40086e4) for @rstest/core, browser, browser-react, and the rsbuild/rslib
adapters so the demos' federation: true flag exercises real rstest
federation support instead of being a silent no-op on 0.8.x. Bump
@rsbuild/core and @rsbuild/plugin-react to the 2.x line the canary uses
and document the required pairing in the demo configs.
ScriptedAlchemy added 5 commits June 23, 2026 21:35
# Conflicts:
#	apps/website-new/docs/en/integrations/index.mdx
#	apps/website-new/docs/zh/integrations/index.mdx
#	pnpm-lock.yaml
Drop the pluginModuleFederation alias and the internal externals
predicate from the public surface, document the intentional divergence
between withNodeDefaults and rsbuild-plugin's patchNodeMFConfig, delete
the unreferenced server orchestration scripts and empty setup
placeholders from the demo apps, type the test harness, fix the
remoteType docs claim, single-prefix the logger, SHA-pin and gate the
e2e workflow, and add the missing enhanced schema changeset.
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.

4 participants