Skip to content

feat(runtime): add optional unloadRemote API for deterministic teardown#4379

Closed
ScriptedAlchemy wants to merge 38 commits intomainfrom
feat/issue-4160-unload-remote-api
Closed

feat(runtime): add optional unloadRemote API for deterministic teardown#4379
ScriptedAlchemy wants to merge 38 commits intomainfrom
feat/issue-4160-unload-remote-api

Conversation

@ScriptedAlchemy
Copy link
Member

@ScriptedAlchemy ScriptedAlchemy commented Feb 7, 2026

Summary

  • introduce optional runtime unload entrypoints for deterministic remote teardown
  • add runtime-core and webpack-bundler-runtime cleanup paths for module cache and remote bookkeeping
  • wire tooling integrations (enhanced, rsbuild-plugin, runtime-tools) to use the new unload entrypoint shape

Changed Packages

  • @module-federation/runtime
  • @module-federation/runtime-core
  • @module-federation/webpack-bundler-runtime
  • @module-federation/enhanced
  • @module-federation/rsbuild-plugin
  • @module-federation/runtime-tools

Changesets

  • .changeset/soft-carpets-develop.md (minor for runtime/runtime-core/webpack-bundler-runtime)
  • .changeset/lucky-fishes-smell.md (patch for enhanced/rsbuild-plugin/runtime-tools)

Base

  • main

@changeset-bot
Copy link

changeset-bot bot commented Feb 7, 2026

🦋 Changeset detected

Latest commit: 5a24735

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

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

@ScriptedAlchemy ScriptedAlchemy changed the title feat(runtime): add unloadRemote teardown API [codex] implement unloadRemote API and teardown cache invalidation Feb 7, 2026
@netlify
Copy link

netlify bot commented Feb 7, 2026

Deploy Preview for module-federation-docs failed. Why did it fail? →

Name Link
🔨 Latest commit 5a24735
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/69a937ccbcaeaa0008e2a8bf

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2026

Bundle Size Report

7 package(s) changed, 34 unchanged.

Package Total dist Delta ESM gzip Delta
webpack-bundler-runtime 81.6 kB +4.8 kB (+6.3%) 6.4 kB +497 B (+8.2%)
runtime-core 308.4 kB +2.9 kB (+0.9%) 25.9 kB +288 B (+1.1%)
runtime 19.4 kB +1.6 kB (+8.7%) 758 B no change
vue3-bridge 160.4 kB +1.4 kB (+0.9%) 23.5 kB +229 B (+1.0%)
enhanced 1.29 MB +254 B (+0.0%) 744 B no change
rsbuild-plugin 112.1 kB -252 B (-0.2%) 91 B no change
runtime-tools 3.8 kB +161 B (+4.4%) 132 B no change

Total dist: 6.89 MB (+10.8 kB (+0.2%))
Total ESM gzip: 139.7 kB (+1014 B (+0.7%))

@ScriptedAlchemy ScriptedAlchemy marked this pull request as ready for review February 9, 2026 04:50
Copy link

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

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: 916fa2abe5

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

@ScriptedAlchemy ScriptedAlchemy changed the title [codex] implement unloadRemote API and teardown cache invalidation feat(runtime): add unloadRemote API for deterministic remote teardown Feb 9, 2026
@ScriptedAlchemy ScriptedAlchemy changed the title feat(runtime): add unloadRemote API for deterministic remote teardown feat(runtime): add optional unloadRemote API for deterministic teardown Feb 12, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 14, 2026

Open in StackBlitz

@module-federation/devtools

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

@module-federation/cli

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

create-module-federation

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

@module-federation/data-prefetch

pnpm add https://pkg.pr.new/@module-federation/data-prefetch@3ea15b7

@module-federation/dts-plugin

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

@module-federation/enhanced

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

@module-federation/error-codes

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

@module-federation/esbuild

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

@module-federation/managers

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

@module-federation/manifest

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

@module-federation/metro

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

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

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

@module-federation/metro-plugin-rnef

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

@module-federation/modern-js

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

@module-federation/modern-js-v3

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

@module-federation/native-federation-tests

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

@module-federation/native-federation-typescript

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

@module-federation/nextjs-mf

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

@module-federation/node

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

@module-federation/retry-plugin

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

@module-federation/rsbuild-plugin

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

@module-federation/rspack

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

@module-federation/rspress-plugin

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

@module-federation/runtime

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

@module-federation/runtime-core

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

@module-federation/runtime-tools

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

@module-federation/sdk

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

@module-federation/storybook-addon

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

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

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

@module-federation/treeshake-frontend

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

@module-federation/treeshake-server

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

@module-federation/typescript

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

@module-federation/utilities

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

@module-federation/webpack-bundler-runtime

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

@module-federation/bridge-react

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

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

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

@module-federation/bridge-shared

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

@module-federation/bridge-vue3

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

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

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

commit: 3ea15b7

@github-actions
Copy link
Contributor

github-actions bot commented Feb 14, 2026

Android Release APK for all devices

🔗 Download link.

Note: if the download link expires, please re-run the workflow to generate a new build.

Generated at 2026-02-15T22:37:18.655Z UTC

@github-actions
Copy link
Contributor

github-actions bot commented Feb 14, 2026

iOS Release APP for simulators

🔗 Download link.

Note: if the download link expires, please re-run the workflow to generate a new build.

Generated at 2026-02-15T22:33:28.256Z UTC

@2heal1
Copy link
Member

2heal1 commented Feb 24, 2026

LGTM, but needs to add usage docs to website :D

ScriptedAlchemy and others added 15 commits February 24, 2026 11:25
Pass loaded-state through afterRemoveRemote and skip webpack cache invalidation
when the current host never loaded the remote. Add unloadRemote usage docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve the dts-plugin TYPE-001 failure by correcting package entry paths for
workspace dependencies and updating RawSource usage for webpack typings.

Co-authored-by: Cursor <cursoragent@cursor.com>
Restore sdk and error-codes export paths to the filenames emitted by the
current build so CI package resolution no longer fails on these branches.

Co-authored-by: Cursor <cursoragent@cursor.com>
@zhoushaw zhoushaw closed this Mar 9, 2026
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.

3 participants