If you're evaluating Next Federation as an alternative to nextjs-mf, here's the path I'd try first. Build a Vite remote that exposes one client component, then render it in an App Router page. The Next.js app can keep using Turbopack.
1. Expose one component
In a Vite 8 React project, add @next-federation/vite and @next-federation/server. Keep react and react-dom pinned to the same React 19 release. For this remote config, remove the scaffold's @vitejs/plugin-react entry. Its Fast Refresh output expects a Vite app preamble that the Next.js host does not have. Vite remote setup
Create src/StatusBadge.tsx.
export default function StatusBadge({ label }: { label: string }) { return <span aria-live="polite">{label}</span> } Configure the remote in vite.config.ts.
import { defineConfig } from 'vite' import { nextFederationComponents } from '@next-federation/vite' export default defineConfig({ plugins: [ nextFederationComponents({ name: 'status', base: 'http://127.0.0.1:4110/', exposes: { './StatusBadge': './src/StatusBadge.tsx' }, }), ], }) Build with vite build and serve the output with nf-serve --dir dist --port 4110 using your project's package runner. Open http://127.0.0.1:4110/_nf/components.json to check that the descriptor is available.
2. Connect the Next.js host
In the host, install @next-federation/core, @next-federation/next, and @next-federation/react. Wrap your existing Next.js config with withNextFederation() from @next-federation/next/config. Register the remote in lib/federation.config.ts:
import { defineFederation } from '@next-federation/core' export const federation = defineFederation({ remotes: { status: { origin: 'http://127.0.0.1:4110' }, }, }) Next create lib/status-badge.tsx. This wrapper belongs on the client side, even when the host is configured to server-render the remote.
'use client' import { createRemoteComponent } from '@next-federation/next/components' export const StatusBadge = createRemoteComponent<{ label: string }>({ expose: './StatusBadge', fallback: <span>Loading status…</span>, errorFallback: <span>Status unavailable</span>, }) 3. Render it from a server page
import { getComponentDescriptor } from '@next-federation/next/server' import { federation } from '../lib/federation.config' import { StatusBadge } from '../lib/status-badge' export default async function Page() { const descriptor = await getComponentDescriptor(federation, 'status') return <StatusBadge descriptor={descriptor} label="Operational" /> } This first pass uses an unsigned build, so the host loads the badge in the browser when its policy allows it. To include the badge in the host's server-rendered HTML, sign the remote build and add the public key to the host's SSR configuration. Host setup and signing
Try changing the component's markup and rebuilding the remote. Reload after the host's descriptor cache refreshes. The badge should pick up the new build without a rebuild of the Next.js host. For an existing example with shared React context and signing-configured SSR, use the two runnable apps in the repo. Components remote · App Router host