webpack.js.org icon indicating copy to clipboard operation
webpack.js.org copied to clipboard

Module Federation Docs output.uniqueName Clarification

Open bgirard opened this issue 3 years ago • 0 comments

Bug report

What is the current behavior? Section in question is here: https://webpack.js.org/concepts/module-federation/#collision-between-modules-from-different-remotes

This section is unclear and buried into troubleshooting. It's unclear just how important this section might be.

If you're going to load multiple modules from different remotes

This section is confusing to me. Perhaps I don't understand all the uses cases of Module Federation but to me that describes the majority of use cases? Or more specifically I encountered a bug with just one MFE remote.

In my case both my host and remote share the same package.json as we split out a remote from the existing project to get release independence. Which means both the host and the remote shared the same implicit chunk cache.

If the current behavior is a bug, please provide the steps to reproduce. Doc visible at: https://webpack.js.org/concepts/module-federation/#collision-between-modules-from-different-remotes

What is the expected behavior?

I'd recommend trying to make the section more clear and pulling it out of Troubleshooting. Ideally adding that key to the webpack.config.js (remote) example with a reference pointing to the section. Also it should be spelled out that the value shouldn't only differ for remote but also between the host and the remote.

It might be worth adding some kind of runtime check for this.

bgirard avatar Mar 29 '22 21:03 bgirard