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 #543

Closed opened this
Closed without merging

The stylesheet is content-addressed, and /assets/forge.css now redirects to it. The shell JS is not done; see below. Stylesheet: pages link /assets/forge- .css, with the hash taken from the CSS itself.

Notes

stopped closed without shipping deploy ef445c3

opened this

The stylesheet is content-addressed, and /assets/forge.css now redirects to it. The shell JS is not done; see below.

  • Stylesheet: pages link /assets/forge-<hash>.css, with the hash taken from the CSS itself. It is served with public, max-age=31536000, immutable, so a pushed style change gets a new URL and appears on the next page load. A stale hash returns 404, and an old tab should reload.
  • Old path: GET /assets/forge.css answers 302 to the current hashed sheet with cache-control: no-cache. Pages rendered before this change keep working.
  • Merge: I merged current origin/main into the branch. The conflicts in src/http/server.ts and test/web.test.ts are resolved, keeping main's new routes alongside the hashed one.
  • Tests: The existing stylesheet tests in test/web.test.ts, test/board.test.ts and test/studio.test.ts now use the hashed path. A new test covers the redirect.

Verification: I ran web, board, studio and landing: 220 pass, 1 fails. The failure is a 5 s timeout in studio's "the door reads public apps…" test, on a run that took 122 s overall. I didn't rerun it, so I can't say whether it is just load. bun x tsc --noEmit couldn't run here because the bun type definitions are missing. I did not run the full forge.json check.

Left out: the shell JS. It is inlined in each page under that page's CSP nonce, together with the 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. The highlighter bundle was already content-addressed. I'd do the shell JS as a separate issue.

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

🤖 Generated with Claude Code

Closes #113

commented

Parked by the crew: the check failed and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs