fix(runtime-core): keep loadEntry hook when remotes are disabled - #5143
ScriptedAlchemy wants to merge 3 commits into
Conversation
🦋 Changeset detectedLatest commit: 226ec31 The changes in this PR will be included in the next version bump. This PR includes changesets to release 48 packages
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 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
@module-federation/devtools
@module-federation/cli
create-module-federation
@module-federation/dts-plugin
@module-federation/enhanced
@module-federation/error-codes
@module-federation/esbuild
@module-federation/managers
@module-federation/manifest
@module-federation/metro
@module-federation/metro-plugin-rnc-cli
@module-federation/metro-plugin-rnef
@module-federation/metro-plugin-rock
@module-federation/modern-js
@module-federation/modern-js-v3
@module-federation/native-federation-tests
@module-federation/native-federation-typescript
@module-federation/nextjs-mf
@module-federation/node
@module-federation/observability-plugin
@module-federation/playground
@module-federation/retry-plugin
@module-federation/rsbuild-plugin
@module-federation/rspack
@module-federation/rspress-plugin
@module-federation/rstest
@module-federation/runtime
@module-federation/runtime-core
@module-federation/runtime-tools
@module-federation/sdk
@module-federation/storybook-addon
@module-federation/third-party-dts-extractor
@module-federation/treeshake-frontend
@module-federation/treeshake-server
@module-federation/typescript
@module-federation/utilities
@module-federation/webpack-bundler-runtime
@module-federation/bridge-react
@module-federation/bridge-react-webpack-plugin
@module-federation/bridge-shared
@module-federation/bridge-vue3
@module-federation/inject-external-runtime-core-plugin
commit: |
Bundle Size Report22 package(s) changed, 21 unchanged. Package dist + ESM entry
Bundle targets
Consumer scenarios
Total dist (raw): 23.41 MB (+3.1 kB (+0.0%)) Bundle sizes are generated with rslib (Rspack). Package-root metrics preserve the historical report. Tracked subpath exports such as |
getRemoteEntry emits remoteHandler.hooks.lifecycle.loadEntry for every entry, including shared tree-shaking fallbacks that load without remotes. The disabled remote handler had no hooks, so those loads threw "Cannot read properties of undefined". Same fix as #5143 on main.
With
experiments.optimization.disableRemote: true, a shared tree-shaking fallback entry failed while loading becausegetRemoteEntryemitted aloadEntryhook thatDisabledRemoteHandlerdid not define. The handler now keeps that hook, allowing fallback entries to load through the platform loader or a runtime plugin while remote loading remains disabled.The regression tests cover the platform loader, the runtime plugin hook, and the webpack bundler's shared fallback getter through entry
init()andget()to the consumer value. The new consumer test fails with the originalundefined.emiterror before the fix and passes with it.Validation: Node 24 and pnpm 10.28.0;
pnpm --filter @module-federation/runtime-core run test(130 passed),build,lint, andpnpm exec prettier --check .passed. Dependency install used--frozen-lockfile --ignore-scriptsafter unrelated Cypress postinstall stalled; Cypress binary and install scripts were not needed for these checks. Workspace-wide builds, E2E, and CI were not run locally.