feat(runtime): expose bundler entrypoints#4526
Conversation
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@module-federation/devtools
@module-federation/cli
create-module-federation
@module-federation/data-prefetch
@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/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/retry-plugin
@module-federation/rsbuild-plugin
@module-federation/rspack
@module-federation/rspress-plugin
@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 Report19 package(s) changed, 22 unchanged. Package dist + public ESM exports
Bundle targets
Total dist (raw): 10.69 MB (+35.4 kB (+0.3%)) Bundle sizes are generated with rslib (Rspack). Public ESM gzip aggregates explicit package export entry files (wildcard exports are ignored). Web/node bundles synthesize a single entry that imports those public ESM exports, set ENV_TARGET, and enable tree-shaking. Bare imports are externalized to keep sizes consistent with prior reporting, and assets are emitted as resources. |
|
You can also update the implementation https://github.com/module-federation/core/blob/main/packages/enhanced/src/lib/container/runtime/FederationRuntimePlugin.ts#L43C44-L43C60 |
| esm: '@module-federation/runtime-tools/dist/index.js', | ||
| cjs: '@module-federation/runtime-tools/dist/index.cjs', | ||
| }, | ||
| undefined, |
There was a problem hiding this comment.
I see the function will use implementation , but why not pass this parameter ?
There was a problem hiding this comment.
Addressed in 28511a8a7.
resolveRuntimePaths() now prefers the provided implementation when resolving runtimeToolsPath, and only falls back to the workspace @module-federation/runtime-tools package if that custom implementation does not publish the newer entrypoint yet. I also added a unit test covering the custom-implementation path and the fallback path.
Description
Add stable
/bundlerentrypoints for the runtime packages so bundlers can resolve tree-shakeable ESM entry files without depending on internaldist/index.*paths.This PR:
./bundlerexports for@module-federation/runtime./bundlerexports for@module-federation/runtime-tools./bundlerexports for@module-federation/webpack-bundler-runtimebundlerbuild entries into the package build configsTest plan
pnpm exec turbo run build --filter=@module-federation/runtime --filter=@module-federation/runtime-tools --filter=@module-federation/webpack-bundler-runtime --forcePR Stack
This PR is 1/3 in the stack.
Stack order (base -> tip):
Navigation:
#4526 -> #4518 -> #4527codex/runtime-bundler-entrypointsintomain