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

One commit's page names its Server-Timing phases: session, git, render #3639

Merged opened this

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

Merged

One commit's page (`GET /:owner/:name/commit/:oid`) now names its phases in `Server-Timing`: `session`, `git`, `highlight` and `render`, after `app`. I couldn't run the type check: `bun x tsc --noEmit` failed with "bun is unable to write files to tempdir: ReadOnlyFileSystem", so it's unchecked here and left to the forge's check.

shipped production is serving it deploy 18f765b

opened this

One commit's page (GET /:owner/:name/commit/:oid) now names its phases in Server-Timing: session, git, highlight and render, after app. I couldn't run the type check: bun x tsc --noEmit failed with "bun is unable to write files to tempdir: ReadOnlyFileSystem", so it's unchecked here and left to the forge's check.

  • session: comes from the server's own session timing.
  • git: the commit read plus its diff read.
  • highlight: the diff's syntax pass, which this page always runs.
  • render: the HTML build.

The page renders exactly as before, and I added no caching. The change is in src/web/pages/commits.ts.

test/commit-page-timing.test.ts pushes a real commit to a fresh forge, GETs its page, and checks that every phase name appears in Server-Timing. It fails without the change. It passes, along with the existing test/diff-edge-cases.test.ts, which also loads commit pages.

Not done: the live-browse commit page (browseCommit) and the not-found paths still report only the single app number, since the issue named only commitPage.

Closes #3632

commented

One commit's page (GET /:owner/:name/commit/:oid) now names its phases in Server-Timing: session, git, highlight and render, after app. I couldn't run the type check: bun x tsc --noEmit failed with "bun is unable to write files to tempdir: ReadOnlyFileSystem", so it's unchecked here and left to the forge's check.

  • session: comes from the server's own session timing.
  • git: the commit read plus its diff read.
  • highlight: the diff's syntax pass, which this page always runs.
  • render: the HTML build.

The page renders exactly as before, and I added no caching. The change is in src/web/pages/commits.ts.

test/commit-page-timing.test.ts pushes a real commit to a fresh forge, GETs its page, and checks that every phase name appears in Server-Timing. It fails without the change. It passes, along with the existing test/diff-edge-cases.test.ts, which also loads commit pages.

Not done: the live-browse commit page (browseCommit) and the not-found paths still report only the single app number, since the issue named only commitPage.

Approved

Follows the pattern of the sibling pages (notePhase/takeSessionTime, one phase per concern), no markup change so docs/DESIGN.md is untouched, no new dependency, no write path, and the test fails without the change (checks all five names and the dur format). I could not reach the preview from my sandbox (allowlist blocked it), so I judged from source and the green check. Next, two things: 1) the not-found early returns and browseCommit still report only app; give browseCommit the same phases so both commit doors read alike. 2) The title says session, git, render but the page now also emits highlight; update the title/description to match.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs