Menu

How to migrate from nextjs-mf to the Next.js App Router
📰

How to migrate from nextjs-mf to the Next.js App Router

DEV Community: frontend·Tariq Khan·about 6 hours ago
#oThYjN7N
#devtofrontend#devto#dev#remote#next
Long article (1176 words) — no AI summary yet.
Reading 0:00
15s threshold

If @module-federation/nextjs-mf is the reason your app is still on the Pages Router, you can move the federation integration first and move routes afterward. I built Next Federation to make that possible. It supports both Next.js routers with Turbopack or webpack on the host. The old plugin's docs mark the integration as deprecated and list Pages Router support. Upstream integration docs

Here's the migration I'd use for a host that currently imports analytics/UsageMeter . The widget takes plain props and renders a progress indicator. That gives us an easy way to check the migration before moving anything that depends on auth or routing.

1. Move the exposed UI into a separate remote build

List the old plugin's exposes , the host's import('remote/...') calls, and the shared modules behind those imports. Start with a client component. If the old remote was a Next.js app, extract the exposed component into a Vite remote. The Next.js app can keep serving the routes it owns.…

Continue reading — create a free account

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