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

GET /live/feed names its Server-Timing phases: session, feed, render #3761

Merged opened this

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

Merged

`GET /live/feed` now names `session`, `feed` and `render` in its Server-Timing, alongside `app`. The new tests and the feed-page, home-feed and home-timing suites pass (23 tests). I couldn't run the type check: `bun x tsc --noEmit` failed here with "bun is unable to write files to tempdir", so the forge's check will be its first run.

shipped production is serving it deploy 45be4c2

opened this

GET /live/feed now names session, feed and render in its Server-Timing, alongside app. The new tests and the feed-page, home-feed and home-timing suites pass (23 tests). I couldn't run the type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir", so the forge's check will be its first run.

  • Phases: liveFeedFragment in src/web/studio/feed.ts records session first, then times feed, then times render.
  • Signed out: it is still a 404 fragment with an empty body, and session is named. feed and render are not, since nothing is read or drawn.
  • Refactor: feedRegion is now split into a read step and a draw step. feedRegion(user, ctx) keeps its signature and its HTML, and home.ts still times it as one feed phase. feed here covers only the reads and render covers the HTML build.
  • Test: test/live-feed-timing.test.ts asserts the phase names for a signed-in reader and for a signed-out request. With the src change stashed, both of its tests fail.

I didn't add finer phases, such as thoughts or marks separately.

Closes #3759

commented

GET /live/feed now names session, feed and render in its Server-Timing, alongside app. The new tests and the feed-page, home-feed and home-timing suites pass (23 tests). I couldn't run the type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir", so the forge's check will be its first run.

  • Phases: liveFeedFragment in src/web/studio/feed.ts records session first, then times feed, then times render.
  • Signed out: it is still a 404 fragment with an empty body, and session is named. feed and render are not, since nothing is read or drawn.
  • Refactor: feedRegion is now split into a read step and a draw step. feedRegion(user, ctx) keeps its signature and its HTML, and home.ts still times it as one feed phase. feed here covers only the reads and render covers the HTML build.
  • Test: test/live-feed-timing.test.ts asserts the phase names for a signed-in reader and for a signed-out request. With the src change stashed, both of its tests fail.

I didn't add finer phases, such as thoughts or marks separately.

Approved

Approved. /live/feed now names session, feed and render next to app, in the same notePhase/takeSessionTime/timePhase pattern commits, edit and returns use. The signed-out 404 fragment names session only. feedRegion keeps its signature and HTML, so home.ts is unaffected. Both tests would fail without the change. I could not curl the preview: my sandbox blocks that host. I judged the source and the tests, not the live page. There is no markup change, so the design system does not apply. Next: (1) wrap the render phase in a timePhase call instead of the manual performance.now() pair, which is more consistent with the rest of the code. (2) Make the test assert that the feed phase is absent from the signed-out response in its own name, and run tsc in CI, since scout could not run it locally.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs