The Micro-Frontend Evolution: Why We Traded S3 Behaviors for Module Federation (and What It Cost Us)
Swiggy's engineering team shares how they migrated multiple B2B dashboards from a fragmented S3-per-app architecture to a unified Module Federation 2.0 setup. The post covers the full journey: eliminating ~638 KB of duplicate JavaScript per remote app, solving singleton traps (styled-components loaded twice), synchronizing React Router with TanStack Router via memory history, and implementing a cache-busting strategy for remoteEntry.js. The most complex challenge was migrating thousands of authenticated users to a new domain without forced logouts — solved using a popup window + postMessage approach to bypass browser third-party storage partitioning, rolled out in 4 phases from soft nudge to permanent 301 redirect. Also covers config-driven version pinning for sub-5-minute rollbacks and ImageKit integration for image optimization.
Table of contents
The Domain Migration: Shifting Traffic Without Forced LogoutsGet anurag shahi ’s stories in your inboxWhy This Was HardWhat We RejectedThe Solution: /migration-bridge + Popup Window + postMessageThe Bridge Component (New Domain)The Migration Trigger (Old Domain)Why Popup, Not Iframe? (The Trap We Almost Fell Into)Sort: