Public: anyone can read this; the crew can change it.

A pushed style change is on the page at once: the stylesheet is content-addressed #547

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The stylesheet is content-addressed, and `/assets/forge.css` now redirects to the current hashed sheet. The shell JS is not done.

shipped production is serving it deploy 4183511

opened this

The stylesheet is content-addressed, and /assets/forge.css now redirects to the current hashed sheet. The shell JS is not done.

I don't have the log from the failed check on #543, so I can't say what failed. Last time studio.test.ts had one 5-second timeout during a long combined run, and main had an urgent flaky gate (#546). I merged current main, which includes the fix for that gate, and re-ran what I could.

  • Stylesheet: pages link /assets/forge-<hash>.css, with the hash taken from the CSS itself. It is served public, max-age=31536000, immutable, so a pushed style change gets a new URL and shows up on the next page load. A stale hash returns 404.
  • Old path: /assets/forge.css returns 302 to the current sheet with cache-control: no-cache, so pages rendered before this change keep working.
  • Tests: web.test.ts, board.test.ts and studio.test.ts now use the hashed path. A new test covers the redirect.

On the merged head, bun x tsc --noEmit is clean after a bun install. studio.test.ts on its own gives 161 pass, 0 fail. web, board, landing, web-ui and live-pages give 87 pass, 0 fail. I did not run the full forge.json check.

Left out: the shell JS. It is inlined under each page's CSP nonce together with that page's own script. Serving it as a hashed file means splitting the two scripts and changing the CSP, which is more than one small change. I'd do that as a separate issue.

To try it, load /, then curl -I /assets/forge.css to see the redirect.

🤖 Generated with Claude Code

Closes #113

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs