Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(webpack-bundler-runtime): bundle sdk into output to help treeshake #3519

Merged
merged 6 commits into from
Feb 26, 2025

Conversation

2heal1
Copy link
Member

@2heal1 2heal1 commented Feb 14, 2025

Description

bundle sdk into output to help treeshake

At past, the bundler runtime will external sdk , and when user set externalRuntime: true , it can not easy to shake the useless sdk code .

Example file: https://github.com/module-federation/core/tree/main/apps/manifest-demo/3009-webpack-provider

before: 34 kb

after: 14 kb

Related Issue

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

Sorry, something went wrong.

Copy link

changeset-bot bot commented Feb 14, 2025

🦋 Changeset detected

Latest commit: 509ef7a

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

This PR includes changesets to release 29 packages
Name Type
@module-federation/webpack-bundler-runtime Patch
@module-federation/enhanced Patch
@module-federation/nextjs-mf Patch
@module-federation/runtime-tools Patch
@module-federation/rspack Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/modern-js Patch
@module-federation/node Patch
@module-federation/rsbuild-plugin Patch
@module-federation/storybook-addon Patch
@module-federation/modernjsapp Patch
@module-federation/runtime Patch
@module-federation/sdk 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/esbuild Patch
@module-federation/runtime-core Patch
@module-federation/utilities Patch
website-new 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

Copy link

netlify bot commented Feb 14, 2025

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 509ef7a
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/67be8464778e5b000868ef7c
😎 Deploy Preview https://deploy-preview-3519--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 site configuration.

@zackarychapple
Copy link
Collaborator

Nice improvement!

@ScriptedAlchemy
Copy link
Member

amazing!

@@ -1,3 +1,3 @@
export const FEDERATION_SUPPORTED_TYPES = ['script'];

export { ENCODE_NAME_PREFIX } from '@module-federation/sdk';
// export { ENCODE_NAME_PREFIX } from '@module-federation/sdk';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we wnt this commaned out?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this constant is not be used yet

@2heal1 2heal1 force-pushed the perf/external-runtime-size branch from 473cbc3 to d05a830 Compare February 26, 2025 02:39
@@ -6,7 +6,6 @@ import {
SEPARATOR,
MANIFEST_EXT,
} from './constant';
import { logger } from './logger';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate re-export

@@ -37,10 +37,6 @@
"import": "./dist/constant.esm.mjs",
"require": "./dist/constant.cjs.js"
},
"./container": {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no used yet

@zhoushaw zhoushaw merged commit 2580dd7 into main Feb 26, 2025
17 checks passed
@zhoushaw zhoushaw deleted the perf/external-runtime-size branch February 26, 2025 06:46
@2heal1 2heal1 mentioned this pull request Feb 26, 2025
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.

None yet

4 participants