feat(rstest-plugin): add standalone federation plugin package#4320
feat(rstest-plugin): add standalone federation plugin package#4320ScriptedAlchemy wants to merge 72 commits into
Conversation
🦋 Changeset detectedLatest commit: 725cadc The changes in this PR will be included in the next version bump. This PR includes changesets to release 48 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. |
Bundle Size Report16 package(s) changed, 27 unchanged. Package dist + ESM entry
Bundle targets
Consumer scenarios
Total dist (raw): 35.67 MB (+28.4 kB (+0.1%)) Bundle sizes are generated with rslib (Rspack). Package-root metrics preserve the historical report. Tracked subpath exports such as |
# Conflicts: # pnpm-lock.yaml
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
@module-federation/devtools
@module-federation/cli
create-module-federation
@module-federation/dts-plugin
@module-federation/enhanced
@module-federation/error-codes
@module-federation/esbuild
@module-federation/managers
@module-federation/manifest
@module-federation/metro
@module-federation/metro-plugin-rnc-cli
@module-federation/metro-plugin-rnef
@module-federation/metro-plugin-rock
@module-federation/modern-js
@module-federation/modern-js-v3
@module-federation/native-federation-tests
@module-federation/native-federation-typescript
@module-federation/nextjs-mf
@module-federation/node
@module-federation/observability-plugin
@module-federation/playground
@module-federation/retry-plugin
@module-federation/rsbuild-plugin
@module-federation/rspack
@module-federation/rspress-plugin
@module-federation/rstest
@module-federation/runtime
@module-federation/runtime-core
@module-federation/runtime-tools
@module-federation/sdk
@module-federation/storybook-addon
@module-federation/third-party-dts-extractor
@module-federation/treeshake-frontend
@module-federation/treeshake-server
@module-federation/typescript
@module-federation/utilities
@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: |
# Conflicts: # pnpm-lock.yaml
|
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
- 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.
# 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.
Summary
@module-federation/rstest-pluginas a dedicated package extracted from@rstest/corefederation()plugin wiring for Rsbuild-based test flowsChanged Packages
@module-federation/rstest-pluginChangesets
.changeset/sharp-rats-sniff.md(@module-federation/rstest-plugin: patch).changeset/config.json(changeset tooling config update)Base
mainSingle-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
In-Place Scope Trim Checklist
Scope Justification (Reviewed In-Place)
package.jsonpnpm 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/enhancedschema change (familyenum[0, 4, 6]): syncsModuleFederationPlugin.jsonwith the already-updated generated TypeScript schema; a changeset for@module-federation/enhancedis now included.packages/rsbuild-pluginlibrary.nameremoval inpatchNodeMFConfig: 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.