/** * Root Layout — PPR-compatible (Partial Prerendering) * * Fully static: no async data fetching in the root layout. * The PPR static shell (html/body/fonts/content) renders instantly from CDN. * * Prerequisites: * - Next.js 16.2.2+ with cacheComponents: true in next.config * - Run `pnpm build:registries` to generate PPR exports * - See docs/migration-ppr.md for full migration guide * * Key differences from the default async layout: * - Layout is sync (not async) — enables PPR static shell * - Uses StaticIntlProvider instead of NextIntlClientProvider * - Messages/locale/theme mode are pre-merged at build time via registry * - No PluginService.initializeAll() — plugins initialize on-demand * * Generated by @nextspark/core * Regenerate with: npx nextspark generate */ import type { Metadata } from "next" import { Suspense } from "react" import { Geist, Geist_Mono } from "next/font/google" import "./globals.css" import { getBillingResourceHints } from "@nextsparkjs/core/lib/billing/gateways/factory" import { StaticIntlProvider } from "@nextsparkjs/core/providers/static-intl-provider" import { QueryProvider } from "@nextsparkjs/core/providers/query-provider" import { ThemeProvider as NextThemeProvider } from "@nextsparkjs/core/providers/theme-provider" import { ThemeProvider as CustomThemeProvider } from "@nextsparkjs/core/lib/theme/ThemeProvider" import { TeamProvider } from "@nextsparkjs/core/contexts/TeamContext" import { SubscriptionProvider } from "@nextsparkjs/core/contexts/SubscriptionContext" import { Toaster } from "@nextsparkjs/core/components/ui/sonner" import { getMetadataOrDefault } from '@nextsparkjs/core/lib/template-resolver' import { DEFAULT_LOCALE, DEFAULT_THEME_MODE, STATIC_MESSAGES } from '@nextsparkjs/registries/translation-registry' const geistSans = Geist({ variable: "--font-geist-sans", subsets: ["latin"], }) const geistMono = Geist_Mono({ variable: "--font-geist-mono", subsets: ["latin"], }) const defaultMetadata: Metadata = { title: "NextSpark App", description: "Built with NextSpark", } export const metadata: Metadata = getMetadataOrDefault( 'app/layout.tsx', defaultMetadata ) export default function RootLayout({ children, }: Readonly<{ children: React.ReactNode }>) { return ( {(() => { const hints = getBillingResourceHints() return ( <> {hints.preconnect.map((domain) => ( ))} {[...hints.preconnect, ...hints.dnsPrefetch].map((domain) => ( ))} ) })()}
{children}
) }