Skip to content

fix(runtime): resolve instances from global registry and remote context#4396

Draft
ScriptedAlchemy wants to merge 35 commits intomainfrom
cursor/module-federation-nextjs-bug-75bf
Draft

fix(runtime): resolve instances from global registry and remote context#4396
ScriptedAlchemy wants to merge 35 commits intomainfrom
cursor/module-federation-nextjs-bug-75bf

Conversation

@ScriptedAlchemy
Copy link
Member

@ScriptedAlchemy ScriptedAlchemy commented Feb 9, 2026

Summary

  • improve runtime API instance lookup by resolving from global federation instances when module state is reset
  • support remote-aware instance matching for loadRemote execution paths
  • add API tests covering getInstance and createInstance behavior after module reset

Changed Packages

  • @module-federation/runtime

Changesets

  • .changeset/ten-hounds-kick.md (@module-federation/runtime: patch)

Base

  • main

@cursor
Copy link

cursor bot commented Feb 9, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@netlify
Copy link

netlify bot commented Feb 9, 2026

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 270f775
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/69b461c6cb92d40008606268
😎 Deploy Preview https://deploy-preview-4396--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot
Copy link

changeset-bot bot commented Feb 9, 2026

🦋 Changeset detected

Latest commit: 270f775

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

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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

Bundle Size Report

12 package(s) changed, 28 unchanged.

Package dist + ESM entry

Package Total dist (raw) Delta ESM gzip Delta
@module-federation/bridge-vue3 147.1 kB +3.2 kB (+2.2%) 22.3 kB +299 B (+1.3%)
@module-federation/cli 26.7 kB no change 786 B no change
@module-federation/core 39.1 kB no change 173 B no change
@module-federation/devtools 473.2 kB no change 3.9 kB no change
@module-federation/enhanced 809.4 kB no change 672 B no change
@module-federation/managers 69.9 kB no change 334 B no change
@module-federation/manifest 138.4 kB no change 182 B no change
@module-federation/metro-plugin-rnc-cli 0 B no change 314 B no change
@module-federation/node 189.2 kB no change 217 B no change
@module-federation/runtime 22.9 kB +3.3 kB (+17.1%) 954 B +338 B (+54.9%)
@module-federation/storybook-addon 76.5 kB no change 100 B no change
@module-federation/utilities 110.6 kB no change 328 B no change

Bundle targets

Package Web bundle (gzip) Delta Node bundle (gzip) Delta
@module-federation/bridge-vue3 17.2 kB +331 B (+1.9%) 17.0 kB +330 B (+1.9%)
@module-federation/cli 2.3 kB -34 B (-1.4%) 2.3 kB -34 B (-1.4%)
@module-federation/core 1.1 kB -33 B (-2.9%) 1.0 kB -31 B (-2.9%)
@module-federation/devtools 20.8 kB -26 B (-0.1%) 20.8 kB -26 B (-0.1%)
@module-federation/enhanced 3.0 kB -44 B (-1.4%) 3.0 kB -44 B (-1.4%)
@module-federation/managers 2.4 kB -27 B (-1.1%) 2.4 kB -27 B (-1.1%)
@module-federation/manifest 6.2 kB -39 B (-0.6%) 6.2 kB -39 B (-0.6%)
@module-federation/metro-plugin-rnc-cli 411 B -26 B (-5.9%) 411 B -26 B (-5.9%)
@module-federation/node 9.2 kB -28 B (-0.3%) 9.2 kB -28 B (-0.3%)
@module-federation/runtime 838 B +213 B (+34.1%) 838 B +213 B (+34.1%)
@module-federation/storybook-addon 1.9 kB -25 B (-1.3%) 1.7 kB -25 B (-1.4%)
@module-federation/utilities 2.6 kB -32 B (-1.2%) 2.6 kB -32 B (-1.2%)

Tree-shakable entrypoints

Package Export Entry gzip Delta Web bundle (gzip) Delta Node bundle (gzip) Delta Gap (node-web) Delta
@module-federation/runtime ./bundler 177 B no change 838 B +213 B (+34.1%) 838 B +213 B (+34.1%) 0 B 0 B

Consumer scenarios

Scenario Web output (gzip) Delta Node output (gzip) Delta Gap (node-web) Delta
Enhanced remoteEntry 19.6 kB +102 B (+0.5%) 20.6 kB +95 B (+0.5%) +1.0 kB -7 B

Total dist (raw): 6.31 MB (+6.5 kB (+0.1%))
Total ESM gzip: 74.0 kB (+637 B (+0.8%))
Total web bundle (gzip): 178.6 kB (+230 B (+0.1%))
Total node bundle (gzip): 179.1 kB (+231 B (+0.1%))
Tracked ./bundler entry gzip: 556 B (no change)
Tracked ./bundler web bundle (gzip): 4.7 kB (+213 B (+4.6%))
Tracked ./bundler node bundle (gzip): 4.7 kB (+213 B (+4.6%))

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.

@ScriptedAlchemy ScriptedAlchemy changed the title Module federation nextjs bug fix(runtime): resolve instances from global registry Feb 9, 2026
@ScriptedAlchemy ScriptedAlchemy changed the title fix(runtime): resolve instances from global registry fix(runtime): resolve instances from global registry and remote context 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@c3f4d76

@module-federation/cli

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

create-module-federation

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

@module-federation/data-prefetch

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

@module-federation/dts-plugin

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

@module-federation/enhanced

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

@module-federation/error-codes

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

@module-federation/esbuild

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

@module-federation/managers

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

@module-federation/manifest

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

@module-federation/metro

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

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

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

@module-federation/metro-plugin-rnef

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

@module-federation/modern-js

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

@module-federation/modern-js-v3

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

@module-federation/native-federation-tests

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

@module-federation/native-federation-typescript

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

@module-federation/nextjs-mf

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

@module-federation/node

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

@module-federation/retry-plugin

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

@module-federation/rsbuild-plugin

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

@module-federation/rspack

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

@module-federation/rspress-plugin

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

@module-federation/runtime

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

@module-federation/runtime-core

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

@module-federation/runtime-tools

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

@module-federation/sdk

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

@module-federation/storybook-addon

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

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

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

@module-federation/treeshake-frontend

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

@module-federation/treeshake-server

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

@module-federation/typescript

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

@module-federation/utilities

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

@module-federation/webpack-bundler-runtime

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

@module-federation/bridge-react

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

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

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

@module-federation/bridge-shared

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

@module-federation/bridge-vue3

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

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

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

commit: c3f4d76

@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:18:24.362Z 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:14:52.708Z UTC

@2heal1
Copy link
Member

2heal1 commented Feb 24, 2026

Does this pr ready to view?

ScriptedAlchemy and others added 4 commits February 24, 2026 13:53
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>
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