rules_webpack icon indicating copy to clipboard operation
rules_webpack copied to clipboard

FR: demonstrate Module Federation

Open alexeagle opened this issue 1 year ago • 1 comments

https://webpack.js.org/concepts/module-federation/ aka. Micro-Frontends is a way to break up a monolith app into several, which can then still be loaded at runtime into a Single Page Application.

This is typically used when several teams collaborate to build one app, and they either don't want to bundle their code together with other teams, or the scale is so large that memory and time required for the bundling step are unacceptable.

https://github.com/ScriptedAlchemy is an expert/evangelist of this approach, but not really involved in Bazel IIUC.

https://github.com/Aghassi/rules_spa is an example repo showing a POC of how to apply the concept.

alexeagle avatar May 02 '24 20:05 alexeagle

rules_spa seems to be targeting the case of module federation being used for routes, but this is one of the approaches, there is also the case where a component can be ingested from an outside domain: https://github.com/module-federation/module-federation-examples/blob/master/react-18-code-splitting/app1/src/client/components/App.tsx

Which case should be demonstrated? Or both?

Mivr avatar Aug 28 '24 15:08 Mivr