-
-
Notifications
You must be signed in to change notification settings - Fork 300
perf: add tree shake markers to enable/disable capabilities to reduce bundle size #3704
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
Open
ScriptedAlchemy
wants to merge
12
commits into
main
Choose a base branch
from
perf/tree-shake-flags
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Main (Current)
This Branch (no optimization flag enabled)
disableSnapshot: true
target: 'web'
Both enabled
Both enabled + external runtime enabled
Both disabled + external runtime enabled
|
…/tree-shake-flags
…ion parity Adds FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN and ENV_TARGET support. Enables new optimization and environment targeting options. Ensures parity with webpack plugin. Enables runtime feature toggling. Enables tree-shaking in runtime and SDK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 10 out of 13 changed files in this pull request and generated no comments.
Files not reviewed (3)
- apps/website-new/docs/en/configure/experiments.mdx: Language not supported
- package.json: Language not supported
- packages/chrome-devtools/project.json: Language not supported
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces several enhancements and optimizations to the Module Federation Plugin and related packages. The main changes focus on improving configuration capabilities, optimizing build processes, and adding environment-specific handling for certain functions.
Enhancements and Optimizations:
Module Federation Plugin Enhancements:
definePluginOptions
to manageDefinePlugin
settings.FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN
to handle disabling snapshot optimizations.web
ornode
) based on compiler options and experiments.DefinePlugin
application with the newly constructeddefinePluginOptions
.Environment-Specific Handling:
ENV_TARGET
constant to differentiate between 'web' and 'node' environments.createScriptNode
andloadScriptNode
to execute only in Node.js environment, throwing an error if attempted in a non-Node.js environment. [1] [2] [3]Build Optimization Options:
optimization
options inModuleFederationPluginOptions
, including configurations fordisableSnapshot
andtarget
environment optimizations. [1] [2] [3]Documentation Updates:
Code Refactoring:
handleRemoteEntryLoaded
function. [1] [2] [3] [4]USE_SNAPSHOT
flag. [1] [2] [3]These changes aim to enhance the flexibility and performance of the Module Federation Plugin by providing more granular control over build optimizations and environment-specific behavior.
Related Issue
Types of changes
Checklist