Microfronends as a #decentralized alternative to #npm.
While i can smush everything into a #monoRepo, i wanted to explore the idea of using #Microfrontends as a kind-of self managed alternative to #npm.
Microfronends have been around for a while and i've come across many different approaches. I want to share how im using microfrontends in my project.
Im using #Webpack 5 #moduleFederation to create the #microfrontend. there are some interesting features that i dont think are being mentioned elsewhere:
- Dynamic Remotes: Modules can be loaded from various endpoints. We can use a custom function to ping different URLs and determine the fastest one for loading the required module.
- #Selfhosters can manage modules independently, enhancing control over updates and #security on #opensource projects.
- Development Experience: By using dynamic-remotes and running modules locally during development, it can speed up testing and iteration.
- Scalability: The approach allows for #CDN scaling with module deployments on multiple cloud providers. currently, my redundencies are on AWS S3 + github-pages... but i can see how this can be scaled to more cloud providers.
Im aiming for the architecture to look like the following. Let me know your thoughts on my approach and if its something you would consider for your project.
https://positive-intentions.com/blog/decentralised-architecture
https://positive-intentions.com/blog/statics-as-a-chat-app-infrastructure