-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
fix(enhanced): abort the compile process if not find the expose modules #3373
Conversation
🦋 Changeset detectedLatest commit: 9bb1a4d The changes in this PR will be included in the next version bump. This PR includes changesets to release 27 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 |
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Should this default to true? Or do we even need an option for this? Can we just fail the build, as this should always be an invalid build? |
Ahh yes , i add options because i don't sure whether it can be default behavior . So , we can throw error if exist miss modules by default ? |
I would vote for this as the default behavior. No options. Like when the entry point is an invalid path. However, if you want to collect feedback, let's default to true. If there are no problems from users, I would suggest we make it ssandard function of the federation plugin in the future: error the build if invalid exposes are passed. Then we can remove the options after user feedback from it. |
cool i will set it as default behavior |
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.
Summary
Here is a concise summary of the pull request:
This pull request introduces a new option called abortOnMissExpose
to the ModuleFederationPlugin
configuration. When enabled, this option will cause the build process to abort if there are any missing exposed modules, rather than silently including them in the remoteEntry
file. This helps users catch and address these issues earlier in the development process, improving the overall quality and reliability of the application. The changes span across the ContainerEntryModule.ts
and ModuleFederationPlugin.ts
files, updating the plugin options interface and the core plugin behavior.
File Summaries
File | Summary |
---|---|
packages/enhanced/src/lib/container/ContainerEntryModule.ts | The code changes introduce a new option abortOnMissExpose to the ModuleFederationPlugin configuration. This option allows users to abort the compilation process if there are any missing exposed modules, instead of silently including them in the remoteEntry file. This helps users catch and address these issues earlier in the development process. |
packages/sdk/src/types/plugins/ModuleFederationPlugin.ts | The code changes introduce a new option called abortOnMissExpose to the ModuleFederationPluginOptions interface. This option allows users to configure the behavior of the Module Federation plugin when there are missing exposed modules. When set to true , the plugin will abort the compilation process if any exposed modules are missing, providing users with immediate feedback on the issue. |
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.
Incremental Review
Comments posted: 11
Configuration
Squadron Mode: essential
Commits Reviewed
0166862157ded1b992f1449a764c926ef853449f...b7905dcef79d1e46347298cffbab6bde72f64d9a
Files Reviewed
- packages/enhanced/src/lib/container/ContainerEntryDependency.ts
- packages/enhanced/src/lib/container/ContainerEntryModule.ts
- packages/enhanced/src/lib/container/ContainerEntryModuleFactory.ts
- packages/enhanced/src/lib/container/ContainerPlugin.ts
- packages/sdk/src/types/plugins/ContainerPlugin.ts
- packages/sdk/src/types/plugins/ModuleFederationPlugin.ts
Files Ignored
These files were ignored due to the filter in the squadron.yaml file.
- .changeset/shaggy-flowers-cry.md
- apps/website-new/docs/en/guide/troubleshooting/_meta.json
- apps/website-new/docs/en/guide/troubleshooting/build/BUILD-001.mdx
- apps/website-new/docs/public/words-map.json
- apps/website-new/docs/zh/guide/troubleshooting/_meta.json
- apps/website-new/docs/zh/guide/troubleshooting/build/BUILD-001.mdx
- packages/enhanced/package.json
- packages/error-codes/src/desc.ts
- packages/error-codes/src/error-codes.ts
- packages/error-codes/src/index.ts
- pnpm-lock.yaml
da05996
to
9bb1a4d
Compare
@ScriptedAlchemy I change the pr , and now it will abort the compile process if not find the expose modules |
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.
Incremental Review
Comments posted: 3
Configuration
Squadron Mode: essential
Commits Reviewed
40a0884bef6baf213fcf980ad08bff8b0f44969a...9bb1a4d39fe039de628e766996da4b0361fbb933
Files Reviewed
- packages/enhanced/src/lib/container/ContainerEntryModule.ts
Files Ignored
These files were ignored due to the filter in the squadron.yaml file.
- .changeset/shaggy-flowers-cry.md
- apps/website-new/docs/en/guide/troubleshooting/_meta.json
- apps/website-new/docs/en/guide/troubleshooting/build/BUILD-001.mdx
- apps/website-new/docs/public/words-map.json
- apps/website-new/docs/zh/guide/troubleshooting/_meta.json
- apps/website-new/docs/zh/guide/troubleshooting/build/BUILD-001.mdx
- packages/enhanced/package.json
- packages/error-codes/src/desc.ts
- packages/error-codes/src/error-codes.ts
- packages/error-codes/src/index.ts
- pnpm-lock.yaml
Description
When users set invalid expose , the compile will not be aborted , and the remoteEntry will include below contents:
And the users will not feel the error until the consumer use the error provider . For dynamic provider , this is a bit dangerous , so need to add an option to allow the users feel this error .
So this pr will abort the compile process if not find the expose modules
Related Issue
Types of changes
Checklist