Menu

1 / 2

A remote just redeployed. What should the App Router hydrate?

DEV Community: nextjs·Tariq Khan·about 6 hours ago
#J1KdlqhC
#devtonextjs#devto#dev#build#host
Long article (529 words) — no AI summary yet.
Reading 0:00
15s threshold

A customer opens workspace settings on a slow connection. Next.js renders the usage panel from build 41. While the browser is loading JavaScript, the usage team promotes build 42. Build 42 changed the first thing the panel renders.

If the browser asks for “the latest panel” at that point, it can get build 42 for HTML that came from build 41. That's a frustrating kind of bug to investigate. The host hasn't changed, most reloads work, and the timing only lines up around a deploy.

Independent deploys are a big reason to keep Module Federation when moving off nextjs-mf . This is one part of how I built next-federation to support them in the App Router.

Resolve the build once per render

A remote component build publishes a descriptor that identifies the build and points to its versioned assets. The App Router host reads that descriptor and passes it to the remote component wrapper. The browser uses the descriptor for this render instead of independently asking which build is current.…

Continue reading — create a free account

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