Sitemap
JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

Follow publication

Member-only story

Next.js 11, Module Federation, and SSR — A brave new world

8 min readJul 24, 2021

--

Server-side rendering with Next 11 and Module federation is ready for prime time! Bonus: we got "hot" (live) reloading working on federated applications!

It’s been a long and painful road to module federation inside a next.js application — but we have finally been able to remove most of that pain.

This is the first time I can confidently say that we have been able to achieve full-scale Module Federation in Next.js — not just client-side but server-side as well!

Months ago, we demonstrated the concept of code-streaming, the idea was to make Node work like a browser and download remote chunks, executing them under its process. This was seamless and easy but posed some security concerns and in the case of next.js, where we are unable to "hot reload" production, those required chunks would get "stuck" and your host applications need to be restarted in order to re-fetch new remote chunks what were updated.

Say hello to multi-server rendering!

The Module Federation Group has conjured up a more acceptable solution to solve Federated SSR. Our solution doesn’t just work with Next.js applications — but this article is going to focus on utilizing our new system within the context one Next.js

--

--

JavaScript in Plain English
JavaScript in Plain English

Published in JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

Zack Jackson
Zack Jackson

Written by Zack Jackson

Infra Architect @ ByteDance. Creator of Module Federation. Specializing in Bundler and Javascript Orchestration at scale.

Responses (5)