Skip to content

fix(modern-js-v3): disable lazy compilation for producers#4845

Merged
2heal1 merged 2 commits into
mainfrom
codex/modern-v3-disable-lazy-producer
Jun 25, 2026
Merged

fix(modern-js-v3): disable lazy compilation for producers#4845
2heal1 merged 2 commits into
mainfrom
codex/modern-v3-disable-lazy-producer

Conversation

@2heal1

@2heal1 2heal1 commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

Disable lazy compilation automatically when the Modern.js v3 Module Federation plugin detects a producer app, and emit a warning when the plugin applies that override.

Why

Producer apps expose remote modules that consumers need to load directly during development. Keeping lazy compilation enabled can leave those exposed modules behind a lazy trigger path instead of making them immediately available to consumers.

Impact

Modern.js v3 producer apps now get dev.lazyCompilation: false from the plugin. Non-producer apps keep their existing dev.lazyCompilation setting. Producer apps also get a clear warning when the plugin disables lazy compilation for them.

Validation

  • pnpm exec prettier --check .
  • git diff --check
  • pnpm exec turbo run test --filter=@module-federation/modern-js-v3 --force
  • python3.12 .codex/skills/changeset-pr/scripts/run_changeset_status.py --verbose

Skipped

  • Full ci:local build-and-test was not run; this change is scoped to @module-federation/modern-js-v3, and the targeted package build/test path passed.

@netlify

netlify Bot commented Jun 25, 2026

Copy link
Copy Markdown

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit beb43c4
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/6a3cfb9a154f160008d19960
😎 Deploy Preview https://deploy-preview-4845--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: beb43c4

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

This PR includes changesets to release 46 packages
Name Type
@module-federation/modern-js-v3 Patch
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
@module-federation/runtime Patch
@module-federation/enhanced 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/modern-js Patch
@module-federation/retry-plugin Patch
@module-federation/rsbuild-plugin 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/rspress-plugin 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-rock Patch
@module-federation/metro-plugin-rnc-cli Patch
@module-federation/esbuild Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/observability-plugin Patch
@module-federation/storybook-addon Patch
shared-tree-shaking-no-server-host Patch
shared-tree-shaking-no-server-provider Patch
@module-federation/utilities Patch
remote5 Patch
remote6 Patch
website-new 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

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Report

11 package(s) changed, 30 unchanged.

Package dist + ESM entry

Package Total dist (raw) Delta ESM gzip Delta
@module-federation/cli 26.3 kB no change 786 B no change
@module-federation/core 39.1 kB no change 173 B no change
@module-federation/devtools 664.0 kB no change 4.0 kB no change
@module-federation/enhanced 810.0 kB no change 672 B no change
@module-federation/managers 69.8 kB no change 334 B no change
@module-federation/manifest 136.1 kB no change 182 B no change
@module-federation/metro-plugin-rnc-cli 0 B no change 314 B no change
@module-federation/modern-js-v3 187.8 kB +2.1 kB (+1.1%) 875 B no change
@module-federation/node 193.4 kB no change 217 B no change
@module-federation/storybook-addon 79.2 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/cli 2.3 kB -31 B (-1.3%) 2.3 kB -31 B (-1.3%)
@module-federation/core 1.1 kB -32 B (-2.9%) 1.0 kB -31 B (-2.9%)
@module-federation/devtools 30.2 kB -27 B (-0.1%) 30.2 kB -27 B (-0.1%)
@module-federation/enhanced 2.6 kB -45 B (-1.6%) 2.6 kB -45 B (-1.6%)
@module-federation/managers 2.4 kB -27 B (-1.1%) 2.4 kB -27 B (-1.1%)
@module-federation/manifest 6.1 kB -41 B (-0.7%) 6.1 kB -41 B (-0.7%)
@module-federation/metro-plugin-rnc-cli 411 B -26 B (-5.9%) 411 B -26 B (-5.9%)
@module-federation/modern-js-v3 4.8 kB +102 B (+2.1%) 4.8 kB +102 B (+2.1%)
@module-federation/node 9.2 kB -29 B (-0.3%) 9.2 kB -29 B (-0.3%)
@module-federation/storybook-addon 1.9 kB -23 B (-1.2%) 1.7 kB -23 B (-1.3%)
@module-federation/utilities 2.6 kB -31 B (-1.2%) 2.6 kB -31 B (-1.2%)

Consumer scenarios

Scenario Web output (gzip) Delta Node output (gzip) Delta Gap (node-web) Delta
Enhanced remoteEntry 21.4 kB -19 B (-0.1%) 22.5 kB -10 B (-0.0%) +1.1 kB +9 B

Total dist (raw): 6.82 MB (+2.1 kB (+0.0%))
Total ESM gzip: 78.6 kB (no change)
Total web bundle (gzip): 207.2 kB (-210 B (-0.1%))
Total node bundle (gzip): 207.7 kB (-209 B (-0.1%))
Tracked ./bundler entry gzip: 556 B (no change)
Tracked ./bundler web bundle (gzip): 4.8 kB (no change)
Tracked ./bundler node bundle (gzip): 4.8 kB (no change)

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.

@pkg-pr-new

pkg-pr-new Bot commented Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@module-federation/devtools

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

@module-federation/cli

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

create-module-federation

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

@module-federation/dts-plugin

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

@module-federation/enhanced

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

@module-federation/error-codes

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

@module-federation/esbuild

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

@module-federation/managers

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

@module-federation/manifest

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

@module-federation/metro

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

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

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

@module-federation/metro-plugin-rnef

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

@module-federation/metro-plugin-rock

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

@module-federation/modern-js

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

@module-federation/modern-js-v3

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

@module-federation/native-federation-tests

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

@module-federation/native-federation-typescript

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

@module-federation/nextjs-mf

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

@module-federation/node

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

@module-federation/observability-plugin

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

@module-federation/retry-plugin

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

@module-federation/rsbuild-plugin

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

@module-federation/rspack

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

@module-federation/rspress-plugin

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

@module-federation/runtime

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

@module-federation/runtime-core

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

@module-federation/runtime-tools

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

@module-federation/sdk

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

@module-federation/storybook-addon

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

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

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

@module-federation/treeshake-frontend

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

@module-federation/treeshake-server

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

@module-federation/typescript

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

@module-federation/utilities

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

@module-federation/webpack-bundler-runtime

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

@module-federation/bridge-react

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

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

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

@module-federation/bridge-shared

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

@module-federation/bridge-vue3

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

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

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

commit: beb43c4

@2heal1 2heal1 marked this pull request as ready for review June 25, 2026 10:01
@2heal1 2heal1 merged commit d13cafa into main Jun 25, 2026
28 checks passed
@2heal1 2heal1 deleted the codex/modern-v3-disable-lazy-producer branch June 25, 2026 10:04
@2heal1 2heal1 mentioned this pull request Jul 8, 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.

2 participants