module-federation / core

Module Federation is a concept that allows developers to share code and resources across multiple JavaScript applications
https://module-federation.io/
MIT License
1.57k stars 242 forks source link

Our Recommendation: The Microfrontend Meta-framework #1278

Closed ScriptedAlchemy closed 1 year ago

ScriptedAlchemy commented 1 year ago

Since joining ByteDance I have been exposed to Module Federation in production at unimaginable scale.

To understand better how they have built such a seamless experience, I looked deeper into it and what they've done with the Module Federation ecosystem internally.

Ultimately, theres an in-house system that was built. Many parts of it open-sourced. The most important part is ModernJS. ModernJS is actually a bigger ecosystem. It covers module engineering (package dev), documentation, and a meta framework thats built for micro-frontends. But its modular, so while its comes with many parts that play well together, you dont have to buy-in to everything.

A major challenge to supporting federation and building a ecosystem for it has been lack of framework who would actually take time to understand the value, or adjust their framework to be more tolerable. This is famously summed up in the case of Next.js. nextjs-mf has been very difficult to get federation functional. Ultimately, next just is not built for this type of architecture.

Without a meta-framework, federation has faced considerable challenges. Yet it has still become widely used.

With the vast ecosystem ownership the infra team at Bytedance has, we have the opportunity (and internally have already done so) take ModernJS and focus it on support of distributed autonomous team delivery. ModernJS already works better than any other framework with Module Federation, but things like SSR, HMR, RSC, we can deliver in a short time frame, or already have.

Given this, it is our recommendation that any user of module federation should be experiencing it on ModernJS.

As I work to extract the internal iteration and pull it into open-source, we will see the swift rise of the best micro-frontend oriented meta-framework ever produced.

If federation is a key part of your engineering agility. ModernJS is the way to go

https://modernjs.dev/en

My ecosystem will unify with Bytedance Infra, my next.js integration will stay maintained and our work will most likely bear many fruits to improve the community at large. But there will be a substantial difference in feasibility of some features and developer experience. You will undoubtedly have a sub-standard experience

github-actions[bot] commented 1 year ago

Stale issue message