Skip to content

v0.84.0: cairn-media-seed and local design iteration

Choose a tag to compare

@glw907 glw907 released this 09 Jul 02:17

The local design-iteration release: a cairn site's design can now be iterated fully locally, against real content and real media, with no deploy per change.

Added

  • New bin, cairn-media-seed. Seeds wrangler's local R2 simulator with every media-library object from a deployed cairn site (npx cairn-media-seed --from https://your-site.com), so vite dev serves real media on every page with no deploy. It reads the committed media manifest, downloads each object with optional repeatable --header flags for an Access-protected site, and writes it under the same content-addressed key the media route reads; --bucket overrides the wrangler-config bucket resolution when a site declares more than one. See the reference page and the local design-iteration guide it unblocks.

Fixed

  • The media delivery route works under vite dev. createMediaRoute passed the request's Headers instance straight through as R2 get's onlyIf and range options. Production Workers accept a Headers instance there, but miniflare's getPlatformProxy can't serialize one across its RPC boundary, so every /media read 500'd under a consumer's vite dev. The route now derives plain, structured-clone-safe onlyIf and range objects from the request's conditional and Range headers instead. The 206 shaping also now handles a suffix range (bytes=-n) echoed back as { suffix }, clamping a suffix past the object size to the full window.

Consumers must: nothing. A site carrying a dev-only /media fallback middleware for the vite dev bug (the aksailingclub-org devMediaFallback) can delete it on upgrade; the route itself now works under vite dev with no workaround.