From 597def7887c3207ccb4950a434196d9880feb086 Mon Sep 17 00:00:00 2001 From: Guruprasad Kulkarni Date: Sun, 15 Nov 2026 11:56:02 +0100 Subject: [PATCH 1/2] fix(cms): keep Rocket Loader away from the Sveltia script Rocket Loader is on for the kulkarni.cloud zone. It rewrote the Sveltia script tag, the bundle loaded but never ran, and /admin/ stayed blank. data-cfasync="false" opts the tag out; a unit test keeps it there. ESLint now ignores .omc/ (local agent notes, never committed). Claude-Session: https://claude.ai/code/session_01426xQEC2VhQSZVe7cBXuz5 --- CHANGELOG.md | 24 ++++++++++++++++++++++++ cms/public/admin/index.html | 1 + cms/test/unit/rocket-loader.test.ts | 10 ++++++++++ eslint.config.js | 1 + 4 files changed, 36 insertions(+) create mode 100644 cms/test/unit/rocket-loader.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index d994b26..5f1d390 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,27 @@ +## 2026-11-15 11:55 + +| Check | Status | Details | +|-------|--------|---------| +| Lint | ✓ PASS | 0 errors | +| Build | ✓ PASS | 27 pages built, 5 pages indexed (Pagefind) | +| Unit Tests | ✓ PASS | 75 tests passed | +| E2E Tests | ✓ PASS | 96 tests passed | +| Lighthouse | ✓ PASS | 99.8% performance (avg) | + +### Lighthouse Performance (local build) + +| Page | Scores (3 runs) | +|------|-----------------| +| / (index) | 100%, 100%, 100% | +| /about | 99%, 99%, 99% | +| /posts | 100%, 100%, 100% | +| /archives (soft 404, not linked) | 100%, 100%, 100% | +| /404 | 100%, 100%, 100% | + +**Diagnostics:** None for the blog. Live site not measured (Turnstile gate). CMS checks: format clean, 18 unit, 2 integration passed. + +Changes: Opt the Sveltia script out of Cloudflare Rocket Loader (`data-cfasync="false"`; Rocket Loader is on for the zone and kept Sveltia from starting, leaving a blank admin page) with a unit test; ESLint ignores `.omc/` (local agent notes, never committed). + ## 2026-11-15 08:43 | Check | Status | Details | diff --git a/cms/public/admin/index.html b/cms/public/admin/index.html index 5dae8aa..1b0bb33 100644 --- a/cms/public/admin/index.html +++ b/cms/public/admin/index.html @@ -16,6 +16,7 @@ src="https://unpkg.com/@sveltia/cms@0.266.0/dist/sveltia-cms.js" integrity="sha384-MvIc9V6dpnf1+8gMj6610BmYWClYbpAyg810CA5ad7jCJmLlpGsOZTJOpOewp0wn" crossorigin="anonymous" + data-cfasync="false" > diff --git a/cms/test/unit/rocket-loader.test.ts b/cms/test/unit/rocket-loader.test.ts new file mode 100644 index 0000000..8966a98 --- /dev/null +++ b/cms/test/unit/rocket-loader.test.ts @@ -0,0 +1,10 @@ +import { readFileSync } from "node:fs"; +import { join } from "node:path"; +import { expect, it } from "vitest"; +import { cmsRoot } from "./helpers"; + +// Rocket Loader is on for the kulkarni.cloud zone; it rewrites script tags and Sveltia then never starts. +it("opts the Sveltia script out of Cloudflare Rocket Loader", () => { + const html = readFileSync(join(cmsRoot, "public/admin/index.html"), "utf8"); + expect(html).toMatch(/]*sveltia-cms\.js[^>]*data-cfasync="false"/s); +}); diff --git a/eslint.config.js b/eslint.config.js index 67b78ec..eb3b8b2 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -63,6 +63,7 @@ export default [ "public/", "cms/", ".claude/", + ".omc/", ".trash/", ], }, From 3d4bb6878927e008dd94af72e81929932e09bc96 Mon Sep 17 00:00:00 2001 From: Guruprasad Kulkarni Date: Sun, 15 Nov 2026 11:58:48 +0100 Subject: [PATCH 2/2] fix(cms): put data-cfasync before src as Rocket Loader requires Cloudflare docs: the data-cfasync attribute must come before src. The test now checks the order. Claude-Session: https://claude.ai/code/session_01426xQEC2VhQSZVe7cBXuz5 --- cms/public/admin/index.html | 2 +- cms/test/unit/rocket-loader.test.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cms/public/admin/index.html b/cms/public/admin/index.html index 1b0bb33..e52bc36 100644 --- a/cms/public/admin/index.html +++ b/cms/public/admin/index.html @@ -13,10 +13,10 @@ diff --git a/cms/test/unit/rocket-loader.test.ts b/cms/test/unit/rocket-loader.test.ts index 8966a98..a8efb1d 100644 --- a/cms/test/unit/rocket-loader.test.ts +++ b/cms/test/unit/rocket-loader.test.ts @@ -4,7 +4,10 @@ import { expect, it } from "vitest"; import { cmsRoot } from "./helpers"; // Rocket Loader is on for the kulkarni.cloud zone; it rewrites script tags and Sveltia then never starts. +// Cloudflare only honours data-cfasync when it comes before src. it("opts the Sveltia script out of Cloudflare Rocket Loader", () => { const html = readFileSync(join(cmsRoot, "public/admin/index.html"), "utf8"); - expect(html).toMatch(/]*sveltia-cms\.js[^>]*data-cfasync="false"/s); + expect(html).toMatch( + /