Skip to content

fix(ssr): emit public path for Modern and Rslib Node runtimes - #5212

Merged
2heal1 merged 2 commits into
feat/enhanced-runtime-unificationfrom
fix/modern-v3-ssr-public-path
Oct 22, 2026
Merged

2heal1 merged 2 commits into
feat/enhanced-runtime-unificationfrom
fix/modern-v3-ssr-public-path

Conversation

@2heal1

@2heal1 2heal1 commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Modern and Rslib SSR producers can omit __webpack_require__.p because Rspack's native async-node filesystem loader does not require publicPath. The MF Node runtime loads asynchronous chunks over HTTP and needs the configured server base URL.

Add a shared SSRPublicPathPlugin in rsbuild-plugin utilities that declares the publicPath runtime requirement through additionalTreeRuntimeRequirements. Rspack generates the assignment from its output configuration. Apply it to Rsbuild/Rslib Node and dual/SSR builds and reuse it in the existing Modern v3 adapter. Keep browser builds and static asset URL handling unchanged.

Add real Rslib Node/dual build regressions, a Modern async-node output regression, and changesets for both packages.

Validation on Node 24:

  • pnpm exec turbo run build --filter=@module-federation/modern-js-v3 --filter=@module-federation/rsbuild-plugin — passed
  • pnpm --filter @module-federation/rsbuild-plugin test — 42 tests passed
  • pnpm --filter @module-federation/modern-js-v3 test — 25 tests passed
  • pnpm exec prettier --check . — passed
  • Normal pre-commit formatting and commitlint hooks passed
  • Local tarball consumer with top-level loaded-first: dynamic Rslib and dynamically nested Rslib routes both return expected content in raw production SSR HTML. The producer runtime reports an absolute /ssr/ publicPath and no longer takes the manifest-entry fallback for its chunks.
  • Complete Modern MF lab using 19 clean Core tarballs and the local built-in adapter: PUPPETEER_EXECUTABLE_PATH='/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' pnpm exec rstest -c rstest.config.mts --reporter verbose — 7 files, 87 tests passed in 3m 35s. Covers development/production rendering, hydration, assets, data fetching, remote replacement, failures/recovery and legacy activation. Original assertions were retained. Only the copied test fixture's dependency-root path was adjusted for the isolated installation.

The complete integration run uses installed Chrome and clean Core package artifacts without diagnostic instrumentation.

Full Core workspace tests were not run because the change is limited to these build integration packages. No publish or merge was performed.

Target feat/enhanced-runtime-unification.

@changeset-bot

changeset-bot Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 01916a9

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/modern-js-v3 Patch
@module-federation/rsbuild-plugin Patch
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
@module-federation/modern-js Patch
@module-federation/playground Patch
@module-federation/rspress-plugin Patch
@module-federation/rstest Patch
remote5 Patch
remote6 Patch
website-new Patch
@module-federation/devtools Patch
@module-federation/cli Patch
create-module-federation Patch
@module-federation/dts-plugin Patch
@module-federation/enhanced Patch
@module-federation/error-codes Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/metro Patch
@module-federation/metro-plugin-rnc-cli Patch
@module-federation/metro-plugin-rnef Patch
@module-federation/metro-plugin-rock Patch
@module-federation/retry-plugin Patch
@module-federation/rspack Patch
@module-federation/runtime-core Patch
@module-federation/runtime-tools Patch
@module-federation/runtime Patch
@module-federation/sdk Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/treeshake-frontend Patch
@module-federation/treeshake-server Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/bridge-react Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-vue3 Patch
@module-federation/inject-external-runtime-core-plugin 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
@module-federation/esbuild Patch
@module-federation/observability-plugin 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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T06:26:48.714507Z 6c3fdc5 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@module-federation/devtools

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

@module-federation/cli

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

create-module-federation

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

@module-federation/dts-plugin

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

@module-federation/enhanced

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

@module-federation/error-codes

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

@module-federation/esbuild

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

@module-federation/managers

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

@module-federation/manifest

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

@module-federation/metro

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

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

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

@module-federation/metro-plugin-rnef

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

@module-federation/metro-plugin-rock

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

@module-federation/modern-js

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

@module-federation/modern-js-v3

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

@module-federation/native-federation-tests

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

@module-federation/native-federation-typescript

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

@module-federation/nextjs-mf

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

@module-federation/node

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

@module-federation/observability-plugin

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

@module-federation/playground

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

@module-federation/retry-plugin

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

@module-federation/rsbuild-plugin

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

@module-federation/rspack

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

@module-federation/rspress-plugin

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

@module-federation/rstest

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

@module-federation/runtime

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

@module-federation/runtime-core

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

@module-federation/runtime-tools

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

@module-federation/sdk

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

@module-federation/storybook-addon

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

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

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

@module-federation/treeshake-frontend

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

@module-federation/treeshake-server

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

@module-federation/typescript

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

@module-federation/utilities

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

@module-federation/webpack-bundler-runtime

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

@module-federation/bridge-react

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

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

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

@module-federation/bridge-shared

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

@module-federation/bridge-vue3

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

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

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

commit: 01916a9

@2heal1 2heal1 changed the title fix(modern-js-v3): emit SSR runtime public path fix(ssr): emit public path for Modern and Rslib Node runtimes Oct 22, 2026
@2heal1
2heal1 merged commit c7d9b63 into feat/enhanced-runtime-unification Oct 22, 2026
21 checks passed
@2heal1
2heal1 deleted the fix/modern-v3-ssr-public-path branch October 22, 2026 06:54
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.

1 participant