Skip to content

feat(rstest): add federation integration plugin - #4920

Open
ScriptedAlchemy wants to merge 15 commits into
mainfrom
codex/rstest-auto-enable
Open

feat(rstest): add federation integration plugin#4920
ScriptedAlchemy wants to merge 15 commits into
mainfrom
codex/rstest-auto-enable

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Member

Description

Adds the focused @module-federation/rstest package for Node/JSDOM and browser test environments.

For Node targets, the plugin uses the Rsbuild exposed API to enable Rstest federation compatibility automatically when the runner provides it. Browser targets remain unchanged, and older Rstest versions without the exposed API retain their existing behavior.

The package ships ESM and CommonJS outputs with matching declaration files, documents the Rstest version requirement, and joins the fixed release group. This supersedes the broad, closed experiment in #4320.

Related Issue

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Validation

  • pnpm install --frozen-lockfile
  • pnpm --filter @module-federation/rstest run test — 34/34 passed
  • pnpm --filter @module-federation/rstest run build — passed; Publint passed
  • pnpm --filter @module-federation/rstest run lint
  • pnpm exec prettier --check .
  • ESM and CommonJS import smoke checks

Cross-repository Rstest example validation will follow with the pkg.pr.new preview produced by this PR.

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

@changeset-bot

changeset-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b1b37d6

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/modern-js-v3 Patch
@module-federation/modern-js Patch
@module-federation/playground Patch
@module-federation/rspress-plugin Patch
remote5 Patch
remote6 Patch
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
website-new Patch
@module-federation/runtime Patch
@module-federation/enhanced 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/nextjs-mf Patch
@module-federation/node Patch
@module-federation/observability-plugin Patch
@module-federation/storybook-addon Patch
shared-tree-shaking-no-server-host Patch
shared-tree-shaking-no-server-provider Patch
@module-federation/utilities Patch
node-dynamic-remote-new-version Patch
node-dynamic-remote 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

@pkg-pr-new

pkg-pr-new Bot commented Jul 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

@module-federation/devtools

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

@module-federation/cli

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

create-module-federation

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

@module-federation/dts-plugin

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

@module-federation/enhanced

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

@module-federation/error-codes

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

@module-federation/esbuild

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

@module-federation/managers

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

@module-federation/manifest

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

@module-federation/metro

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

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

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

@module-federation/metro-plugin-rnef

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

@module-federation/metro-plugin-rock

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

@module-federation/modern-js

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

@module-federation/modern-js-v3

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

@module-federation/native-federation-tests

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

@module-federation/native-federation-typescript

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

@module-federation/nextjs-mf

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

@module-federation/node

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

@module-federation/observability-plugin

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

@module-federation/playground

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

@module-federation/retry-plugin

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

@module-federation/rsbuild-plugin

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

@module-federation/rspack

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

@module-federation/rspress-plugin

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

@module-federation/rstest

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

@module-federation/runtime

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

@module-federation/runtime-core

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

@module-federation/runtime-tools

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

@module-federation/sdk

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

@module-federation/storybook-addon

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

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

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

@module-federation/treeshake-frontend

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

@module-federation/treeshake-server

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

@module-federation/typescript

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

@module-federation/utilities

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

@module-federation/webpack-bundler-runtime

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

@module-federation/bridge-react

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

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

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

@module-federation/bridge-shared

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

@module-federation/bridge-vue3

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

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

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

commit: b1b37d6

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview Environment Ready!

Name Status URL
website-new ✅ Active https://nestor-lopez-31377-website-new-core-module-federa-09aedd9... ↗

Details:

  • Latest Commit: b1b37d6
  • Updated at: 7/30/2026, 1:13:01 AM

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Report

11 package(s) changed, 32 unchanged.

Package dist + ESM entry

Package Total dist (raw) Delta ESM gzip Delta
@module-federation/playground 28.83 MB -2 B (-0.0%) 43.6 kB no change
@module-federation/rsbuild-plugin 108.7 kB +740 B (+0.7%) 62 B no change
@module-federation/rstest 29.1 kB +29.1 kB (+∞%) 2.6 kB +2.6 kB (+∞%)
@module-federation/runtime-core 294.1 kB +8 B (+0.0%) 570 B no change
@module-federation/runtime-tools 7.7 kB -65 B (-0.8%) 142 B no change

Bundle targets

Package Web bundle (gzip) Delta Node bundle (gzip) Delta
@module-federation/cli 2.3 kB -5 B (-0.2%) 2.4 kB -32 B (-1.3%)
@module-federation/core 1.0 kB -3 B (-0.3%) 1.0 kB -33 B (-3.0%)
@module-federation/devtools 30.3 kB -1 B (-0.0%) 30.3 kB -24 B (-0.1%)
@module-federation/enhanced 2.7 kB +10 B (+0.4%) 2.8 kB -44 B (-1.5%)
@module-federation/metro-plugin-rnc-cli 416 B no change 435 B -25 B (-5.4%)
@module-federation/node 9.2 kB +3 B (+0.0%) 9.2 kB -29 B (-0.3%)
@module-federation/rsbuild-plugin 4.3 kB -6 B (-0.1%) 4.3 kB -6 B (-0.1%)
@module-federation/rstest 1.7 kB +1.7 kB (+∞%) 1.7 kB +1.7 kB (+∞%)

Consumer scenarios

Scenario Web output (gzip) Delta Node output (gzip) Delta Gap (node-web) Delta
Enhanced remoteEntry 21.5 kB -15 B (-0.1%) 23.1 kB -21 B (-0.1%) +1.7 kB -6 B

Total dist (raw): 35.82 MB (+29.7 kB (+0.1%))
Total ESM gzip: 107.4 kB (+2.6 kB (+2.5%))
Total web bundle (gzip): 235.2 kB (+1.7 kB (+0.7%))
Total node bundle (gzip): 237.9 kB (+1.5 kB (+0.6%))
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: acb80807cc

ℹ️ 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".

Comment thread packages/rstest/src/plugin.ts Outdated
Comment thread packages/rstest/src/plugin.ts Outdated
@ScriptedAlchemy
ScriptedAlchemy requested a review from 9aoy July 29, 2026 00:19

@9aoy 9aoy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found two runtime/publishing issues that are not covered by the current option-level tests, import smoke checks, or Publint. Details are included inline.

Comment thread packages/rstest/src/node-defaults.ts Outdated
Comment thread packages/rstest/rslib.config.ts Outdated
@ScriptedAlchemy
ScriptedAlchemy requested a review from 9aoy July 29, 2026 23:49
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.

2 participants