Conversation
|
@giaBaoJS is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 071c154 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 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 |
This branch has not been deployed
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
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.
DevelopmentPluginhas a branch for official Module Federation plugins, but it readsexposesfrom the wrong property:Official plugins (
@module-federation/enhanced, and the built-incontainer.ModuleFederationPluginin Rspack and webpack) only have_options, soplugin.configisundefinedand theentryOptionhook throws. Any config that puts one of them next toRepackPluginfails as soon as the compiler is created in dev withhotenabled:I reproduced this on
mainby creating an Rspack compiler withdevServer: { hot: true },new DevelopmentPlugin({ platform: 'ios' })and each of@module-federation/enhanced/rspack'sModuleFederationPlugin,rspack.container.ModuleFederationPluginandwebpack.container.ModuleFederationPlugin(the last one with a webpack compiler). All three threw, with or withoutexposes. With this change all three compilers are created.The
_optionsbranch was added in #960 as deliberate support for official plugins. #1085 then added theexposescheck to both branches and copiedplugin.configinto the second one. The fix readsplugin._options.exposes, so official plugins now get the same treatment as Re.Pack's: dev entries are added to the container entry when the plugin exposes modules, and skipped when it does not, which is the #1085 behavior.There were no tests for
DevelopmentPlugin, so I added a small suite with a mock compiler. It captures theentryOptioncallback and records which entry names receive the development entries:exposesgives['main', 'remote'](onmainthis throws theTypeErrorabove)exposesgives['main'](also throws onmain)ModuleFederationPluginV2withexposesgives['main', 'remote'](passes before and after, and guards the unchanged branch)Each test fails against a different wrong version of the check: dropping the
exposescondition, returningplugin.nameinstead ofplugin._options.name, or turning the old read intoplugin.config?.exposesso that it no longer throws.pnpm test:@callstack/repackgoes from 38 suites / 342 tests to 39 / 345. The other workspaces are unchanged.pnpm typecheckandpnpm lint:ciare clean. I did not change theconstructor.namedetection or the webpack-only entry reordering in the same plugin. Both already handle official plugins.