Menu

1 / 4

Our Micro-Frontend Shipped 14.8MB. Now It’s 1.6MB.

JavaScript in Plain English - Medium·Ray Hu·10 days ago
#Ba29PG44
Reading 0:00
15s threshold

Member-only story

Our Micro-Frontend Shipped 14.8MB. Now It’s 1.6MB.

Rust SWC, Module Federation and a smart preloader fixed it.

Ray Hu

5 min read7 hours ago

Press enter or click to view image in full size

Here’s a moment every frontend engineer on a big admin platform will recognize. You split the monolith into micro-frontends. Teams ship independently. Then you open the page and the network tab shows three copies of React and two copies of Ant Design.

That was us. FCP sat at 4–6 seconds, the bundle hit 15MB+, and a cold Webpack build took 6 minutes 42 seconds. Here’s the stack that fixed all three.

Why the monolith hurts twice

Once a codebase passes 100k lines, it hurts on build and on load:

Builds crawl. Babel and Terser parse ASTs on a single thread. Cold starts run 5–8 minutes, and CI keeps timing out.

Teams are coupled. Team A changes one line, and teams B, C and D have to regression-test.

First paint is brutal.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.