Imagine a SaaS dashboard with a usage panel that another team owns. Today it runs in a Pages Router app. The dashboard team is building a new workspace settings page in app/, and the usage team wants to ship the same panel to both places. Can it keep deploying on its own schedule while the dashboard moves to the App Router?
That's the question I built next-federation around. The old @module-federation/nextjs-mf integration relied on local webpack, supported the Pages Router, and is marked deprecated upstream. If you depended on it, moving a page to app/ leaves a practical gap. You still need to load the remote, decide where it renders, and keep the surrounding Next.js page working when it fails. Upstream integration docs
What changed in the host
With next-federation, the usage team builds its panel as a separate Vite remote that exposes a Module Federation 2.0 component. The Next.js host uses its normal Turbopack or webpack build. At runtime, it reads the remote's descriptor and loads the exposed component. The descriptor identifies one build, so the server and browser agree on which version to use for that render.
In the App Router, the page can read the descriptor in an async Server Component. A small client wrapper created with createRemoteComponent() renders the panel. Here's the part that lives in the page:
import { getComponentDescriptor } from '@next-federation/next/server'
import { federation } from '@/lib/federation.config'
import { UsagePanel } from '@/lib/usage-panel'
export default async function WorkspaceSettings() {
const descriptor = await getComponentDescriptor(federation, 'usage')
return <UsagePanel descriptor={descriptor} workspaceId="demo-workspace" />
}
A Pages Router route can fetch that same remote's descriptor in getServerSideProps or getStaticProps, using the Pages Router adapter. The remote build can serve both routes while the host migration is in progress. If both routers are in one Next.js app, use each router's adapter on its own routes and register any shared modules in each router that uses them. Host setup for both routers
Who does the rendering?
For a usage chart that needs the host's theme or React context, I'd use a remote component. It renders in the host's React tree. A verified build can render on the host's server, and the host can give the panel its own loading and error states.
If the panel needs to fetch private account data using credentials held by the usage service, I'd consider an island instead. The remote renders its React Server Components on its own server. The Next.js host embeds the rendered result. That's an explicit boundary for who runs the server-side work. Architecture
What I'd migrate first
Pick one existing expose with simple props and a fallback you can explain to the team that owns the page. Move its implementation into a separately built remote and wire up one route. If your old setup exposed whole Next.js pages through exposePages, you'll need to choose which UI to extract or keep that route owned by its existing app. Migration guide
The runnable examples include both Next.js routers. Try one route, ship a change to the remote, and check that the host picks it up without a rebuild. If that fits a migration you're planning, I'd like to hear which expose you would move first. Run the examples ยท GitHub repository

Top comments (0)