perf(i18n,shell): ship one locale and stop blocking the first paint

The client bundle carries only the active locale — resolved on the
server and handed to the provider with no hydration flash, halving the
dashboard route to under a megabyte parsed (288 KiB gzip). The auth
shell renders the app chrome immediately instead of a spinner while the
session resolves in parallel, the widgets request folds into the
snapshot it duplicated, and insight pills prefetch their sub-pages —
a first visit to a sub-page lands in about ninety milliseconds instead
of nearly a second.
This commit is contained in:
Marc-André Bombeck committed 2026-06-11 02:19:27 +02:00
1 parent 9445d89b76
commit 3b480b9885
284 files changed
+6058 -5398

No files matched your search

@@ -71,7 +71,7 @@ describe("PUT /api/admin/users/[id]", () => {
new HttpError(401, "Not authenticated"),
);
await expect(
PUT(jsonReq({ username: "marc" }), params("u1")),
PUT(jsonReq({ username: "testuser" }), params("u1")),
).rejects.toThrow("Not authenticated");
});
@@ -80,7 +80,7 @@ describe("PUT /api/admin/users/[id]", () => {
new HttpError(403, "Admin access required"),
);
await expect(
PUT(jsonReq({ username: "marc" }), params("u1")),
PUT(jsonReq({ username: "testuser" }), params("u1")),
).rejects.toThrow("Admin access required");
});
@@ -97,7 +97,7 @@ describe("PUT /api/admin/users/[id]", () => {
it("returns 404 when target user does not exist", async () => {
vi.mocked(prisma.user.findUnique).mockResolvedValue(null);
const res = await PUT(jsonReq({ username: "marc" }), params("u-missing"));
const res = await PUT(jsonReq({ username: "testuser" }), params("u-missing"));
expect(res.status).toBe(404);
expect(vi.mocked(prisma.user.update)).not.toHaveBeenCalled();
});