-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Are we using Webpack's Module Federation correctly? #515
Comments
FYI, if not using my branch from #514, these are the different chunks that can be seen loaded from the network tab From mosaic:
From mockup |
sorry for the long delay. I recently had a similar issue of double-loading tinymce javascript. That caused tinymce to be imported twice. could that be the issue? In mosaic we're importing from pat-tinymce, which should be fine. do you have some other import mechanism or a custom tinymce plugin which imports differently? |
Maybe its because the |
So, as far as I understand, if a bundle imports a module, it is reused when another bundle imports it again... This doesn't appear to be the case...
Take for instance TinyMCE, this is what I see under the "Network" tab in Firefox when editing a mosaic:
As can be seen,
bundle.min.js
pulls a tinymce from its chunks directory, and thenplone-mosaic-remote.min.js
pulls another one from mosaic's chunks directory. It does the same with thetinymce_plugins
chunk.Furthermore, it can be seen from the "Debugger" tab, that in fact a bunch of other patterns are re-imported from the
@plone/mockup
package from Mosaic'snode_modules
, when it should be reusing the ones already imported from Mockup...Another example,
select2
Mosaic has
@plone/mockup
pinned to be5.0.0-beta.7
, which is the latest and the same one used inplone.staticresources
so all versions should be the same. Furthermore, I usedyarn link
to link to the samemockup
pulled from source, and this same behavior is observed.I believe there's something wrong in the way webpack module federation is being used, but I cannot figure it out... I see in the devtools console
Patternslib Module Federation: Loaded and initialized bundle "__patternslib_mf__plonemosaic".
shouldn't I be seeing the same formockup
?@thet If you can shed some light here, that would be greatly appreciated :) (And in case it hasn't been merged yet, you can use this branch #514)
The text was updated successfully, but these errors were encountered: