perf : improve via lighthouse
CI / Verify (push) Successful in 1m14s
CI / Build immutable images and deploy (push) Failing after 57s

This commit is contained in:
2026-09-08 18:11:15 +07:00 Unverified
parent 63b1ec6629
commit 9a3672dab3
10 changed files with 11999 additions and 40 deletions
+35
View File
@@ -0,0 +1,35 @@
import { readFile } from "node:fs/promises";
import { describe, expect, it } from "vitest";
async function repositoryFile(path: string): Promise<string> {
return readFile(new URL(`../${path}`, import.meta.url), "utf8");
}
describe("public rendering performance", () => {
it("keeps the directory eligible for a populated static shell", async () => {
const [layout, page] = await Promise.all([
repositoryFile("app/layout.tsx"),
repositoryFile("app/page.tsx"),
]);
expect(layout).not.toContain("export const instant = false");
expect(page).not.toContain("connection()");
expect(page).not.toContain("export const instant = false");
});
it("isolates request-time header authentication", async () => {
const header = await repositoryFile("components/public/site-header.tsx");
expect(header).toContain("<Suspense fallback={null}>");
expect(header).toContain("<AdminEditLink");
});
it("preloads only the first directory cover", async () => {
const directory = await repositoryFile(
"components/public/structured-directory.tsx",
);
expect(directory).toContain("preload={index === 0}");
});
});