Skip to content

perf(picturebooks): drop provenance from manifest entries (#99) - #100

Merged
devudilip merged 1 commit into
mainfrom
perf/picturebooks-manifest
Sep 16, 2026
Merged

devudilip merged 1 commit into
mainfrom
perf/picturebooks-manifest

Conversation

@devudilip

Copy link
Copy Markdown
Owner

Linked issue

Closes #99 (accepted).

What changed and why

public/data/picturebooks/manifest.json is fetched on first paint of home, library and the picture-book hub. Each entry carried the book's full provenance block (attribution line, per-illustration credits, licence note, ~2.7 KB per book), so after #98 it was 633 KB for 189 books. Nothing on those surfaces shows provenance; the reader, the end page and /picturebooks/<slug>/credits all load the per-book <slug>.json, which keeps the complete block unchanged.

  • PictureBookMeta now omits provenance (type comment explains why); the builder drops it.
  • bookAsStory takes the full PictureBook (its only caller, the reader, already had one).
  • Two test fixtures updated.
Before After
manifest.json (189 books) 633 KB 67 KB
per book ~3.3 KB ~0.35 KB

Verification

  • npm run data:picturebooks, npm run data:validate (189 books), npm run typecheck, npm test (673) all green; next build green.
  • Static export served locally: hub renders 189 cards, home strip renders, /picturebooks/101376-hasi-kasa-ona-kasa/credits shows the full attribution line, source link, licence and seven illustration credits; no console errors; manifest transfer measured at 66,558 bytes.

Note for installed PWAs

/data/** is served cache-first and DATA_CACHE has not been bumped since v5, so installed clients keep whatever manifest they cached and will not see this (or the 154 new books from #98) until the data cache is refreshed. Separate issue to follow.

The picture-book manifest is fetched on first paint of home, library and
the hub, and every entry carried the book's full provenance block
(attribution line, per-illustration credits, licence note): 633 KB for
189 books. Nothing on those surfaces shows provenance; the reader, end
page and credits page all load the per-book <slug>.json, which keeps the
complete block. PictureBookMeta now omits provenance and bookAsStory
takes the full book. Manifest: 633 KB → 67 KB.

Signed-off-by: Devu Dilip <devu.dilip@gmail.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying sirigannada with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3b221c3
Status: ✅  Deploy successful!
Preview URL: https://370da12b.sirigannada.pages.dev
Branch Preview URL: https://perf-picturebooks-manifest.sirigannada.pages.dev

View logs

@devudilip
devudilip merged commit 2635122 into main Sep 16, 2026
4 checks passed
@devudilip
devudilip deleted the perf/picturebooks-manifest branch September 16, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

P-01: Picture-book manifest ships full provenance for every book (633 KB fetched on first paint of home and library)

1 participant