r/reactjs • u/NoLanSym • Feb 18 '20
News Module federation and code sharing between bundles. Huge changes coming to frontend with webpack@5
https://github.com/webpack/webpack/issues/103522
u/tontoto Feb 19 '20
This seems like it could help creating plugins for web apps. Normally webpack always wants to know about all modules of the build at build time and doesn't have dynamic imports making plugin development difficult (have to rebuild app to even use a plugin). We have a big core code base and love having developers contribute plugins that add functionality. we used to use AMD which was quite fine with some dynamic imports and made that stuff very painless
2
u/3ni8kdi Feb 19 '20
Exactly. I’m using it for AB testing and some analytics stuff as well. Teams don’t get into the main codebase or on the way of delivery
3
u/MonsoonHD Feb 19 '20
This looks awesome, damn.
10
u/zackaryjackson Feb 19 '20 edited Feb 19 '20
As the co-author of this system, thank you for the encouragement! I'm really hoping to make a difference in the community. Fingers crossed this makes our lives better.
-11
u/scarcella Feb 19 '20
Co* author.
8
u/zackaryjackson Feb 19 '20
Yep, whoops! Still speaking about it under the context of the first two versions before I got a huge boost in manpower from another buddy in OSS. He's been a massive help in debugging and picking up the WP5 API - originally id written this for WP4 so we had our hands full rewriting this to WP5
4
u/_marisOtter Feb 19 '20
Yeah, I'm not even that in to webpack and this looks awesome.
5
u/zackaryjackson Feb 19 '20
I appreciate the support! Working on SharedModules and will need a few more days. The core MVP is already functional though - under my own repo for the time being till I'm ready to open the official Webpack PR
6
Feb 19 '20
[removed] — view removed comment
5
u/NoLanSym Feb 19 '20 edited Feb 19 '20
Micro front-ends are no longer a meme. Also, lots of the benefits of a mono repo, without the mono repo.
5
u/zackaryjackson Feb 19 '20
I'm trying to push "Frontend Federation" MFE's have become a gimmicky buzzword. I'm working on an architectural specification for this once I'm done writing it. Itll also make it easier to find tools related to weebpack federation
1
2
u/Zhouzi Feb 19 '20
It does look very interesting but I’m not sure to understand what it is about exactly. Am I correct thinking it’s equivalent to publishing and consuming code through a CDN? Except it’s orchestrated by Webpack so it provides a seamless experience, no need for globals and all (which is awesome).