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:
openhands committed 2026-08-07 18:51:45 +02:00
1 parent b25e7b00dd
commit 51ef7602ca
203 files changed
+16 -811

No files matched your search

@@ -2,10 +2,6 @@ import { redirect } from "next/navigation";
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
import { ModActionsClient } from "./mod-actions-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;
export default async function QuickActionsPage() {
const { session, permissions } = await getAdminContext();
if (!canAccess(permissions, PERMS.MODERATION_EDIT, session.user.rank))
@@ -4,10 +4,6 @@ import { Ban, db, SupportTickets, User } from "@/lib/db";
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
import { CfhDetail } from "./cfh-detail";
// 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 CfhDetailPage({
params,
}: {
-4
View File
@@ -17,10 +17,6 @@ import { formatDate } from "@/lib/format-date";
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
import { type CfhRow, CfhTable } from "./cfh-table";
// 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 CfhListPage({
searchParams,
}: {
-4
View File
@@ -17,10 +17,6 @@ import { getMinStaffRank } from "@/lib/admin/min-staff-rank";
import { AdminAuditLog, Ban, db, SupportTickets, User } from "@/lib/db";
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
// 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 CFH_STATES: Record<number, { label: string; class: string }> = {
0: {
label: "Open",
-4
View File
@@ -14,10 +14,6 @@ import {
} from "@/lib/db";
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
// 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 ModTeamPage() {
const { session, permissions } = await getAdminContext();
if (!canAccess(permissions, PERMS.MODERATION_VIEW, session.user.rank))