Skip to content

fix(enhanced): default remoteType to script for UMD remotes#4397

Draft
ScriptedAlchemy wants to merge 31 commits intomainfrom
cursor/module-federation-issue-4294-9fd0
Draft

fix(enhanced): default remoteType to script for UMD remotes#4397
ScriptedAlchemy wants to merge 31 commits intomainfrom
cursor/module-federation-issue-4294-9fd0

Conversation

@ScriptedAlchemy
Copy link
Member

@ScriptedAlchemy ScriptedAlchemy commented Feb 9, 2026

Summary

  • default remoteType to script in enhanced plugin flows where it is omitted
  • improve handling for UMD-style remote library references
  • add unit coverage around ModuleFederationPlugin remote option behavior

Changed Packages

  • @module-federation/enhanced

Changesets

  • .changeset/short-crabs-join.md (@module-federation/enhanced: patch)

Base

  • main

cursoragent and others added 3 commits February 9, 2026 07:38
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@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

@changeset-bot
Copy link

changeset-bot bot commented Feb 9, 2026

🦋 Changeset detected

Latest commit: f6655aa

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 Patch
@module-federation/modern-js-v3 Patch
@module-federation/modern-js Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/rsbuild-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
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
remote5 Patch
remote6 Patch
website-new Patch
@module-federation/runtime 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/data-prefetch 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-rnc-cli 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

@netlify
Copy link

netlify bot commented Feb 9, 2026

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit f6655aa
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/69a237c887daa60008242ba9
😎 Deploy Preview https://deploy-preview-4397--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.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

Bundle Size Report

1 package(s) changed, 40 unchanged.

Package Total dist Delta ESM gzip Delta
enhanced 1.29 MB +2.3 kB (+0.2%) 744 B no change

Total dist: 6.88 MB (+2.3 kB (+0.0%))
Total ESM gzip: 138.6 kB (no change)

@ScriptedAlchemy ScriptedAlchemy changed the title Module federation issue 4294 fix(enhanced): default remoteType to script Feb 9, 2026
ScriptedAlchemy and others added 9 commits February 9, 2026 00:49
Co-authored-by: Cursor <cursoragent@cursor.com>
…fallback

1. Change RemoteEntryPlugin from a static top-level import to a lazy
   require inside apply(). This fixes a TDZ (Temporal Dead Zone) error
   "Cannot access 'RemoteEntryPlugin' before initialization" that
   occurred in rstest unit tests due to ESM binding initialization order.

2. Restore the original remoteType fallback logic that uses the library
   type when it is a valid externals type, defaulting to 'script' only
   for invalid types like 'umd'. This replaces the isValidExternalsType
   webpack schema import with an inline Set of known valid types.

Co-authored-by: Cursor <cursoragent@cursor.com>
…:module-federation/core into cursor/module-federation-issue-4294-9fd0
@ScriptedAlchemy ScriptedAlchemy changed the title fix(enhanced): default remoteType to script fix(enhanced): default remoteType to script for UMD remotes 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@e0ef616

@module-federation/cli

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

create-module-federation

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

@module-federation/data-prefetch

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

@module-federation/dts-plugin

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

@module-federation/enhanced

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

@module-federation/error-codes

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

@module-federation/esbuild

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

@module-federation/managers

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

@module-federation/manifest

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

@module-federation/metro

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

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

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

@module-federation/metro-plugin-rnef

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

@module-federation/modern-js

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

@module-federation/modern-js-v3

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

@module-federation/native-federation-tests

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

@module-federation/native-federation-typescript

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

@module-federation/nextjs-mf

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

@module-federation/node

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

@module-federation/retry-plugin

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

@module-federation/rsbuild-plugin

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

@module-federation/rspack

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

@module-federation/rspress-plugin

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

@module-federation/runtime

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

@module-federation/runtime-core

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

@module-federation/runtime-tools

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

@module-federation/sdk

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

@module-federation/storybook-addon

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

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

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

@module-federation/treeshake-frontend

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

@module-federation/treeshake-server

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

@module-federation/typescript

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

@module-federation/utilities

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

@module-federation/webpack-bundler-runtime

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

@module-federation/bridge-react

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

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

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

@module-federation/bridge-shared

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

@module-federation/bridge-vue3

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

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

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

commit: e0ef616

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