Skip to content

fix(runtime): selectively clear providers while retaining shared dependencies - #5051

Merged
2heal1 merged 2 commits into
feat/mf-ssr-clear-cachefrom
fix/ssr-cache-selective-provider
Sep 10, 2026
Merged

2heal1 merged 2 commits into
feat/mf-ssr-clear-cachefrom
fix/ssr-cache-selective-provider

Conversation

@2heal1

@2heal1 2heal1 commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Description

When an active shared dependency keeps its provider alive, call __webpack_clear_exposed_cache__ to release unrelated exposed execution-cache entries. This cache implementation has not shipped: host and provider must use matching builds. There is no missing-capability fallback that silently retains the full provider cache.

Rspack PR web-infra-dev/rspack#15614 provides shared dependency closure retention and transitive static parent metadata. The artifact matrix covers concatenation, minified numeric IDs, shared/lazy strict identity and non-shared WeakRef GC. A Node 24 resolver hook supports local compiler integration through ESM and CJS.

Validation: runtime-tools build 6/6; runtime-core 134/134 and bundler runtime 109/109 tests. New compiler + Modern HTTP artifact matrix: 19 passes, 3 known stale-adapter TODOs, no skips. Removed six tests for the discarded legacy-provider fallback. The older installed canary now fails with a missing-method error, as expected. Latest full Modern SSR CI passes both remote-cache and shared-cache/GC specs; an earlier intermittent capture failure remains recorded and is not claimed fixed.

Changeset planning and changed-file formatting pass. Full-repo Prettier reports 683 existing/generated files. Other CI jobs were skipped in favor of affected packages and Modern SSR integration; exact commands and limitations are in tools/ssr-cache/VALIDATION.md. R1 remains incomplete pending adapter lifecycle. No publication.

Related Issue

Continues #5049 and the SSR cache RFC. Companion compiler: web-infra-dev/rspack#15614.

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)

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 Sep 10, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cdecd88

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

@2heal1
2heal1 marked this pull request as ready for review September 10, 2026 09:18
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 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-09-10T09:23:46.392631Z da767f7 Draft marked ready
ℹ️ 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 Sep 10, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@module-federation/devtools

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

@module-federation/cli

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

create-module-federation

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

@module-federation/dts-plugin

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

@module-federation/enhanced

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

@module-federation/error-codes

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

@module-federation/esbuild

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

@module-federation/managers

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

@module-federation/manifest

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

@module-federation/metro

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

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

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

@module-federation/metro-plugin-rnef

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

@module-federation/metro-plugin-rock

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

@module-federation/modern-js

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

@module-federation/modern-js-v3

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

@module-federation/native-federation-tests

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

@module-federation/native-federation-typescript

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

@module-federation/nextjs-mf

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

@module-federation/node

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

@module-federation/observability-plugin

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

@module-federation/playground

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

@module-federation/retry-plugin

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

@module-federation/rsbuild-plugin

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

@module-federation/rspack

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

@module-federation/rspress-plugin

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

@module-federation/rstest

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

@module-federation/runtime

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

@module-federation/runtime-core

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

@module-federation/runtime-tools

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

@module-federation/sdk

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

@module-federation/storybook-addon

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

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

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

@module-federation/treeshake-frontend

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

@module-federation/treeshake-server

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

@module-federation/typescript

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

@module-federation/utilities

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

@module-federation/webpack-bundler-runtime

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

@module-federation/bridge-react

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

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

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

@module-federation/bridge-shared

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

@module-federation/bridge-vue3

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

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

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

commit: cdecd88

@2heal1
2heal1 merged commit 3b53e96 into feat/mf-ssr-clear-cache Sep 10, 2026
6 checks passed
@2heal1
2heal1 deleted the fix/ssr-cache-selective-provider branch September 10, 2026 09:30
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