Composing micro frontends dynamically
We briefly introduced the idea of using a central web component registry to lazily load the different scripts required to make the Web Components work. This would indeed be the ultimate solution, as it is lazy yet dynamic. However, to make this fully operational is also not easy. An easier way is to start with a micro frontend registry.
Using a micro frontend registry
A micro frontend registry is similar to the link dictionary introduced in Chapter 6, The Web Approach. However, instead of a server resolution, it would just return paths to all the available scripts.
For example, the following response could be triggered for the tractor store sample:
{ Â Â "scripts": [ Â Â Â Â "http://localhost:2001/product-page.js", Â Â Â Â "http://localhost:2002/basket-info.js", Â Â Â Â "http://localhost:2002/buy-button.js", Â Â Â Â "...