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
@@ -112,12 +112,18 @@ describe("staff smoke contract", () => {
|
||||
walk("src/app/mod");
|
||||
expect(legacyHits).toBe(0);
|
||||
|
||||
// Both staff layouts opt out of Cache Components (was force-dynamic).
|
||||
expect(readFileSync("src/app/admin/layout.tsx", "utf8")).toContain(
|
||||
// The root layout carries the single Cache Components opt-out; staff
|
||||
// pages inherit it (was force-dynamic, then per-layout instant=false).
|
||||
expect(readFileSync("src/app/layout.tsx", "utf8")).toContain(
|
||||
"export const instant = false",
|
||||
);
|
||||
expect(readFileSync("src/app/mod/layout.tsx", "utf8")).toContain(
|
||||
"export const instant = false",
|
||||
// Staff layouts must not redeclare the opt-out — that is the root
|
||||
// layout's job now, and redeclaring it is the legacy per-layout pattern.
|
||||
expect(readFileSync("src/app/admin/layout.tsx", "utf8")).not.toContain(
|
||||
"export const instant",
|
||||
);
|
||||
expect(readFileSync("src/app/mod/layout.tsx", "utf8")).not.toContain(
|
||||
"export const instant",
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user