A Next.js migration for the dashboard nobody wants to touch
Picture a support dashboard that agents keep open all day. It still lives in pages/, and the team...
Picture a support dashboard that agents keep open all day. It still lives in pages/, and the team wants to move off nextjs-mf. If you change the router, the sign-in flow, and the remote loader in one release, where do you start looking when an agent says an account won't open?
I'd pick one piece of the dashboard with a clear job: the read-only account summary. Give it an account ID and let it render the plan and renewal date. Keep authentication, account search, navigation, and permission decisions in the dashboard.

Move one component and keep the route
I built next-federation for cases like this. You can use it in a Next.js 16 Pages Router host and move to the App Router on your own schedule. The component moves into a separately built Vite remote. Your existing Next.js dashboard loads it at runtime. If the old remote is itself a Next.js app, extract the exposed component into that new build.
On the dashboard side, the page still lives in pages/. Fetch the remote descriptor in getServerSideProps or getStaticProps and pass it to the wrapper created with createRemoteComponent(). The descriptor tells the host which build to load.
import { getComponentDescriptor } from '@next-federation/next/pages/server'
import type { RemoteComponentDescriptor } from '@next-federation/next/pages/server'
import { federation } from '../lib/federation.config'
import { AccountSummary } from '../lib/account-summary'
export async function getServerSideProps() {
const descriptor = await getComponentDescriptor(federation, 'accounts')
return { props: { descriptor } }
}
export default function SupportPage(
{ descriptor }: { descriptor: RemoteComponentDescriptor | null },
) {
return <AccountSummary descriptor={descriptor} accountId="acct_demo" />
}
The account ID here is demo input. In the dashboard, derive it from the authorized account the agent is viewing. The migration guide shows how to define the remote and set up the wrapper and SSR verification. Migration guide
Run the test your support team would notice
First change the summary heading and deploy only the remote. Open a new page after the descriptor cache refreshes and check that the new heading shows up. Then make the remote unavailable in staging and open the dashboard with a fresh host session. Can the agent still search for an account? Can they still get to the notes they need? Does the summary tell them when to retry?
If those checks pass, you have a candidate for an incremental migration. Try the runnable Pages Router host and swap in a read-only widget that looks like something your team already owns. Pages Router example · GitHub repository
Sumber artikel open-source oleh Tariq Khan di DEV Community — Baca artikel asli. Topik:
#nextjs#react#webdev#tutorial
Sukai & bagikan artikel ini
Ditulis & Dikurasi Oleh
Tariq Khan (Open-Source)
Software Engineer yang berfokus pada Next.js, TypeScript, arsitektur backend skalabel, Cloud, dan Applied AI.
Artikel Terkait
Semua artikelBeyond the Browser: Engineering an Anime-Inspired Web Experience (Part 1/4)
Who decided software engineering portfolios had to consist of a navigation bar, a few project cards,...
The booking was saved, but the customer saw an error: email after commit in Next.js
This bug made it into the released versions of my Next.js 15 templates (two booking sites, a...
A remote just redeployed. What should the App Router hydrate?
A customer opens workspace settings on a slow connection. Next.js renders the usage panel from build...
Module Federation in Next.js 16 after nextjs-mf
Say your storefront has a product page in app/ and an older page in pages/. The cart team wants to...

Komentar