perf: migrate pages to Cache Components via root layout opt-out
Remove the per-route 'export const instant = false' opt-outs now that the root layout carries the single Cache Components opt-out. Child pages inherit the opt-out, so admin/mod/radio leaf pages that only access cached or DB data stay instant while runtime-dependent pages remain dynamic. Update the staff-smoke contract test to assert the root-layout contract.
This commit is contained in:
1 parent
b25e7b00dd
commit
51ef7602ca
203 files changed
+16
-811
No files matched your search
@@ -7,10 +7,6 @@ import {
|
||||
} from "@/lib/client-translation-files";
|
||||
import { ClientTranslations } from "./client-translations";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
export default async function ClientTranslationsPage({
|
||||
searchParams,
|
||||
}: {
|
||||
|
||||
@@ -2,10 +2,6 @@ import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { TranslationsClient } from "../translations-client";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
const LOCALES = [
|
||||
"en",
|
||||
"it",
|
||||
|
||||
@@ -7,10 +7,6 @@ import { Button } from "@/components/ui/button";
|
||||
import { calcPagination } from "@/lib/admin-helpers";
|
||||
import { db, EmulatorSettings } from "@/lib/db";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
const TRANSLATION_KEY_PATTERNS = [
|
||||
"commands.description.",
|
||||
"commands.keys.",
|
||||
|
||||
@@ -2,10 +2,6 @@ import { redirect } from "next/navigation";
|
||||
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
|
||||
import { TranslationsTabs } from "./translations-tabs";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
export default async function TranslationsLayout({
|
||||
children,
|
||||
}: {
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
// TODO: Cache Components adoption. Refactor this route so this opt-out can be removed.
|
||||
// See: https://nextjs.org/docs/app/guides/migrating-to-cache-components
|
||||
export const instant = false;
|
||||
|
||||
// Default landing for /admin/translations → first tab.
|
||||
// The shared TranslationsTabs (in layout.tsx) gives access to every section.
|
||||
export default function TranslationsHubPage() {
|
||||
|
||||
Reference in new issue
Block a user