Microfrontend Architecture with Module Federation — is it supported or feasible with Refine? #7346
Replies: 1 comment
-
|
Hey, not from the Refine team but I've explored this pattern and can share what actually works (and what doesn't). Short answerYes, this is feasible — the key is that 1. Refine's architecture with module federationUnder the hood, The critical webpack config in your shell and every remote: // webpack.config.js (both shell and remotes)
new ModuleFederationPlugin({
shared: {
react: { singleton: true, requiredVersion: deps.react },
'react-dom': { singleton: true, requiredVersion: deps['react-dom'] },
'@refinedev/core': { singleton: true, requiredVersion: deps['@refinedev/core'] },
'@refinedev/antd': { singleton: true, requiredVersion: deps['@refinedev/antd'] },
// add any other @refinedev/* packages you use
},
})Without 2. Hosting
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Microfrontend Architecture with Module Federation — is it supported or feasible with Refine?
Context
Hey Refine team and community 👋
I'm currently running a centralized admin panel built with Refine that acts as a single application serving multiple gateways/domains (think multi-tenant or multi-product setup). As our team and product surface area grows, the monolithic frontend is becoming harder to scale — both in terms of development velocity and deployment independence.
I'm exploring moving toward a microfrontend architecture, and I'd love to understand how feasible this is within the Refine ecosystem.
What I'm Trying to Achieve
Essentially, a microservices-like model on the frontend:
Approaches I'm Considering
1. Webpack Module Federation (most mature)
<Refine>wrapper, auth provider, and data providers as remotes<Refine>context — can it be shared cleanly across remotes without duplication or context mismatch?2. Vite +
vite-plugin-federation3. Native Module Federation (Webpack 5 / Rspack)
Specific Questions
Is there anything in Refine's architecture (context providers, router integration, resource registry) that would break or cause issues when split across module federation remotes?
Can the
<Refine>provider be hosted in the shell and consumed by micro-apps, or does each remote need its own instance?Has anyone in the community successfully implemented this pattern with Refine? Any gotchas around:
notificationProvider/i18nProviderWould Refine consider official guidance or a recipe for microfrontend setups? This feels like an increasingly common architecture request as Refine gets adopted at scale.
Current Setup
Any input from the core team or community members who've gone down this road would be hugely appreciated.
Happy to share more details or contribute back if we get something working! 🙌
Beta Was this translation helpful? Give feedback.
All reactions