Skip to content

[web-shared] Consolidate date and time formatting into lib/time.ts - #5528

Draft
mitul-s wants to merge 4 commits into
mainfrom
web-shared/time-utils
Draft

mitul-s wants to merge 4 commits into
mainfrom
web-shared/time-utils

Conversation

@mitul-s

@mitul-s mitul-s commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Consolidates date and time parsing and formatting in the observability UI into one module, packages/web-shared/src/lib/time.ts, and fixes the timestamp bugs the copies had drifted into.

Why

The same timestamp was parsed and formatted differently depending on where you looked:

  • parseDateValue was copied into attribute-panel.tsx, events-list.tsx and event-list-model.ts (as parseEventDate). Two of the copies turned epoch milliseconds into Invalid Date. Three more private copies of "occurredAt, else createdAt" lived in trace-span-construction.ts, event-materialization.ts and start-hook.ts.
  • There were five timestamp formats. The attribute panel used date-fns SS, which is hundredths of a second, not milliseconds. The Events tab hardcoded en-US and a 24-hour clock. The sidebar rows showed time without date or milliseconds. The event details panel used bare toLocaleString().
  • Relative time was implemented twice: in timestamp-tooltip.tsx, and again with date-fns in the web app's relative-time.tsx. The tooltip version said "3 days ago" for future times, so retryAfter, resumeAt and tokenRetentionUntil hover cards were wrong.
  • trace-viewer/util/timing.ts had four unused helpers. Two of them were buggy: getMsInHighRes returned microseconds where nanoseconds were expected, and formatWallClockTime documented .mmm but didn't print it. getHighResInMs duplicated otelTimeToMs.

Approach

lib/time.ts provides one parser and a small set of formatters, all built on Intl. They follow the viewer's locale and time zone unless the caller passes them, as the web interface guidelines require ("Locale-aware dates/times/numbers/currency"):

  • parseDateValue reads Date, epoch ms or a string, and returns null for blank or invalid values. getEventTimestamp covers occurredAt-else-createdAt on top of it.
  • formatTimestamp gives the full timestamp with real milliseconds and the time zone.
  • formatTime gives the time of day with milliseconds.
  • formatTimestampSegments gives the compact Events-tab cell, split into runs so the date and fraction stay de-emphasised in whatever order the locale uses.
  • formatZonedDateTime covers the hover card's UTC and local rows.
  • formatRelativeTime is a short relative time using Intl.RelativeTimeFormat.
  • formatRelativeTimeDetailed is the timestamp hover card's multi-unit label, which now also handles the future as "in …". It stays English-only, because the platform has no locale-aware multi-unit relative format.
  • highResTimeToMs is the single [seconds, nanoseconds] to ms conversion.

Every call site uses these now, including the web app's RelativeTime (which imports them from @workflow/web-shared) and the flow graph's started/completed timestamps. Duration formatting was not duplicated (timing.ts only re-exported lib/utils), so it stays in lib/utils.ts.

Deleted as dead after grepping this repo and searching other repositories for imports: all of trace-viewer/util/timing.ts (getHighResInMs, getMsInHighRes, formatDurationForTimeline, formatTimeSelection, formatWallClockTime), localMillisecondTime, otelTimeToMs, parseEventDate, formatTimestampParts, the unused useShortTimeAgo/DefaultTimeText default-children path of RelativeTimeCard, and the date-fns dependency of both packages. None of these were reachable through the package's exports, and nothing outside this repo imports them from this package.

New public exports from @workflow/web-shared: parseDateValue, formatTimestamp, formatRelativeTime, plus the DateFormatOptions and RelativeTimeOptions types. Nothing public was removed.

Visible changes

Examples are en-US; other locales get their own order, names and clock.

  • Attribute panel (hook lastReceivedAt, disposedAt, tokenRetentionUntil, and run/step dates): MAR 16 12:34:56.78 GMT+0 becomes Mar 16, 2026, 12:34:56.789 PM UTC. That's real milliseconds, the locale's clock and the year. lastReceivedAt and disposedAt also get the timestamp hover card the other dates already had.
  • Event details panel, Created and Occurred: 3/16/2026, 12:34:56 PM becomes the same full format, with milliseconds and time zone.
  • Sidebar events list: the row time 12:34:56 PM becomes 12:34:56.789 PM. The Occurred row gains the year.
  • Events tab time column: MAR 16 12:34:56.789 becomes Mar 16, 12:34:56.789 PM. It follows the locale's clock and month instead of hardcoded en-US and 24-hour time. It is no longer uppercased, and the column grows from 172px to 192px to fit a 12-hour clock. The day and milliseconds stay de-emphasised.
  • Events tab messages: "retry at" and "resumes at" use the same time-of-day format (12:34:56.789 PM instead of 12:34:56).
  • Timestamp hover cards: future dates read "in 2 hours, …" instead of "2 hours, … ago". The UTC and local rows follow the viewer's locale; they are unchanged for en-US.
  • Web app run/hook tables and run detail: today at 12:34 PM / 03/12/2026 become a relative time such as 3 hours ago / 4 days ago, and "Last refreshed" reads now under a second. The tooltip shows the full timestamp with milliseconds.
  • Flow graph startedAt and completedAt: bare toLocaleString() becomes the full timestamp.

Visuals were not rendered. I haven't looked at these surfaces in a browser, so please check the Events tab column width in particular.

Validation

Re-run after merging current main (including the design-token and shared cn changes) into this branch:

  • src/lib/time.test.ts is new. It pins locale and time zone by passing them explicitly (en-US/UTC, plus en-GB/Asia/Tokyo, de-DE/America/New_York). It covers parsing edge cases, high-res conversion, real milliseconds (.007), segment classification, zoned rows, and past, future and sub-second relative times.
  • test/events-occurred-at-display.test.ts now checks that rows render the shared segments and de-emphasise the date and milliseconds, independent of the machine's locale.
  • pnpm install --lockfile-only leaves pnpm-lock.yaml unchanged, and pnpm install --frozen-lockfile succeeds.
  • pnpm turbo typecheck test build --filter=@workflow/web-shared --filter=@workflow/web: 12/12 tasks passed. web-shared ran 36 test files and 308 tests; web ran 24 files and 160 tests.
  • biome check packages/web-shared packages/web: no errors. That's 116 warnings against 117 on main, and none of them are new.

Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>

Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>
@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
example-nextjs-workflow-turbopack Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
example-nextjs-workflow-webpack Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
example-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-astro-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-express-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-fastify-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-hono-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-nestjs-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-nitro-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-nuxt-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-python-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-sveltekit-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-tanstack-start-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-vite-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workflow-docs Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workflow-swc-playground Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workflow-tarballs Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workflow-web Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC

@changeset-bot

changeset-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e4127b6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@workflow/web-shared Minor
@workflow/web Minor
@workflow/cli Patch
@workflow/nitro Patch
workflow Patch
@workflow/world-testing Patch
@workflow/nuxt Patch
@workflow/world-cloudflare Patch
@workflow/core Patch
@workflow/world-vercel Patch
@workflow/builders Patch
@workflow/next Patch
@workflow/vitest Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

✅ All tests passed

⚠️ Flaky E2E Tests (passed on retry)

These tests failed at least once and passed on a retry. A recurring entry here is a real race worth investigating.

12 flaky tests
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race (express · vercel-prod / vercel / quickjs / production) — flaked in 4 jobs
  • retainedInterleavingWorkflow (fastify · vercel-prod / vercel / node / production) — flaked in 2 jobs
  • addTenWorkflow (nextjs-turbopack · vercel-prod / vercel / node / production)
  • concurrent starts across all regions stay isolated (nextjs-turbopack · vercel-multi-region / vercel / node / multi-region)
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running (nextjs-webpack · local-dev / local / node / canary)
  • hookWorkflow is not resumable via public webhook endpoint (nuxt · vercel-prod / vercel / quickjs / production)
  • no startIndex (reads all chunks) (astro · vercel-prod / vercel / node / production)
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race (astro · vercel-prod / vercel / node / production)
  • promiseRaceStressTestWorkflow (nextjs-webpack · local-dev / local / node / stable)
  • webhookWorkflow (nextjs-turbopack · vercel-prod / vercel / node / production)
  • wellKnownAgentWorkflow (.well-known/agent) (nextjs-turbopack · vercel-prod / vercel / node / production)
  • workflowAndStepMetadataWorkflow (example · vercel-prod / vercel / node / production)

🛠 Infra Events (absorbed by the harness)

Platform anomalies the e2e harness detected and worked around (e.g. a run the queue never picked up, replaced by a fresh run). Clustered timestamps indicate a backend blip; a steady drip indicates a platform issue worth escalating.

  • run-pickup-stall · addTenWorkflow (nextjs-turbopack) · at 21:15:04Z · abandoned wrun_41M7NNR5QD0GP101AEEMMTEBD2
  • run-pickup-stall · retainedInterleavingWorkflow (sveltekit) · at 21:15:06Z · abandoned wrun_41M7NNR79W0GGS03V5SJ62AZRZ
  • run-pickup-stall · runs app-generated source against a registered step (tanstack-start) · at 21:17:49Z · abandoned wrun_01M7NNYKJHE04MNCF5GGYFRAHW
  • cold-start-warmup · suite warmup (tanstack-start) · at 21:17:52Z · abandoned wrun_01M7NNYKJYTG34HTA081XPEAEY
  • run-pickup-stall · hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered (nextjs-webpack) · at 21:22:58Z · abandoned wrun_01M7NP82195MRJ52R1KRYDES0G
  • run-pickup-stall · hookCleanupTestWorkflow - hook token reuse after workflow completion (nextjs-webpack) · at 21:22:58Z · abandoned wrun_01M7NP823057PW1Y18M747VQFT

E2E Test Summary

Summary
Passed Failed Skipped Total
✅ ▲ Vercel Production 4649 0 940 5589
✅ 💻 Local Development 5272 0 731 6003
✅ 📦 Local Production 5272 0 731 6003
✅ 🐘 Local Postgres 5417 0 586 6003
✅ 🪟 Windows 401 0 13 414
✅ 🌐 Cross-language Conformance 68 0 114 182
✅ dynamic-runs 0 0 0 0
✅ local-postgres-spec9 0 0 364 364
✅ local-spec9 409 0 5 414
✅ vercel-http-transport 1054 0 188 1242
✅ vercel-multi-region 27 0 0 27
✅ vercel-queue-hold 4 0 0 4
✅ vercel-spec9 395 0 19 414
✅ vercel-ws-transport 712 0 116 828
Total 23680 0 3807 27487
Details by Category

✅ ▲ Vercel Production

App Passed Failed Skipped
✅ astro-node 171 0 36
✅ astro-quickjs 170 0 37
✅ example-node 171 0 36
✅ example-quickjs 170 0 37
✅ express-node 171 0 36
✅ express-quickjs 170 0 37
✅ fastify-node 171 0 36
✅ fastify-quickjs 170 0 37
✅ hono-node 171 0 36
✅ hono-quickjs 170 0 37
✅ nest-node 171 0 36
✅ nest-quickjs 170 0 37
✅ nextjs-turbopack-node 199 0 8
✅ nextjs-turbopack-quickjs 198 0 9
✅ nextjs-webpack-node 199 0 8
✅ nextjs-webpack-quickjs 198 0 9
✅ nitro-node 171 0 36
✅ nitro-quickjs 170 0 37
✅ nuxt-node 171 0 36
✅ nuxt-quickjs 170 0 37
✅ python-node 66 0 141
✅ sveltekit-node 190 0 17
✅ sveltekit-quickjs 189 0 18
✅ tanstack-start-node 171 0 36
✅ tanstack-start-quickjs 170 0 37
✅ vite-node 171 0 36
✅ vite-quickjs 170 0 37

✅ 💻 Local Development

App Passed Failed Skipped
✅ astro-stable-node 172 0 35
✅ astro-stable-quickjs 171 0 36
✅ express-stable-node 172 0 35
✅ express-stable-quickjs 171 0 36
✅ fastify-stable-node 172 0 35
✅ fastify-stable-quickjs 171 0 36
✅ hono-stable-node 172 0 35
✅ hono-stable-quickjs 171 0 36
✅ nest-stable-node 172 0 35
✅ nest-stable-quickjs 171 0 36
✅ nextjs-turbopack-canary-node 201 0 6
✅ nextjs-turbopack-canary-quickjs 200 0 7
✅ nextjs-turbopack-quickjs-snapshot 200 0 7
✅ nextjs-turbopack-stable-node 201 0 6
✅ nextjs-turbopack-stable-quickjs 200 0 7
✅ nextjs-webpack-canary-node 201 0 6
✅ nextjs-webpack-canary-quickjs 200 0 7
✅ nextjs-webpack-stable-node 201 0 6
✅ nextjs-webpack-stable-quickjs 200 0 7
✅ nitro-stable-node 172 0 35
✅ nitro-stable-quickjs 171 0 36
✅ nuxt-stable-node 172 0 35
✅ nuxt-stable-quickjs 171 0 36
✅ sveltekit-stable-node 191 0 16
✅ sveltekit-stable-quickjs 190 0 17
✅ tanstack-start-node 172 0 35
✅ tanstack-start-quickjs 171 0 36
✅ vite-stable-node 172 0 35
✅ vite-stable-quickjs 171 0 36

✅ 📦 Local Production

App Passed Failed Skipped
✅ astro-stable-node 172 0 35
✅ astro-stable-quickjs 171 0 36
✅ express-stable-node 172 0 35
✅ express-stable-quickjs 171 0 36
✅ fastify-stable-node 172 0 35
✅ fastify-stable-quickjs 171 0 36
✅ hono-stable-node 172 0 35
✅ hono-stable-quickjs 171 0 36
✅ nest-stable-node 172 0 35
✅ nest-stable-quickjs 171 0 36
✅ nextjs-turbopack-canary-node 201 0 6
✅ nextjs-turbopack-canary-quickjs 200 0 7
✅ nextjs-turbopack-quickjs-snapshot 200 0 7
✅ nextjs-turbopack-stable-node 201 0 6
✅ nextjs-turbopack-stable-quickjs 200 0 7
✅ nextjs-webpack-canary-node 201 0 6
✅ nextjs-webpack-canary-quickjs 200 0 7
✅ nextjs-webpack-stable-node 201 0 6
✅ nextjs-webpack-stable-quickjs 200 0 7
✅ nitro-stable-node 172 0 35
✅ nitro-stable-quickjs 171 0 36
✅ nuxt-stable-node 172 0 35
✅ nuxt-stable-quickjs 171 0 36
✅ sveltekit-stable-node 191 0 16
✅ sveltekit-stable-quickjs 190 0 17
✅ tanstack-start-node 172 0 35
✅ tanstack-start-quickjs 171 0 36
✅ vite-stable-node 172 0 35
✅ vite-stable-quickjs 171 0 36

✅ 🐘 Local Postgres

App Passed Failed Skipped
✅ astro-stable-node 177 0 30
✅ astro-stable-quickjs 176 0 31
✅ express-stable-node 177 0 30
✅ express-stable-quickjs 176 0 31
✅ fastify-stable-node 177 0 30
✅ fastify-stable-quickjs 176 0 31
✅ hono-stable-node 177 0 30
✅ hono-stable-quickjs 176 0 31
✅ nest-stable-node 177 0 30
✅ nest-stable-quickjs 176 0 31
✅ nextjs-turbopack-canary-node 206 0 1
✅ nextjs-turbopack-canary-quickjs 205 0 2
✅ nextjs-turbopack-quickjs-snapshot 205 0 2
✅ nextjs-turbopack-stable-node 206 0 1
✅ nextjs-turbopack-stable-quickjs 205 0 2
✅ nextjs-webpack-canary-node 206 0 1
✅ nextjs-webpack-canary-quickjs 205 0 2
✅ nextjs-webpack-stable-node 206 0 1
✅ nextjs-webpack-stable-quickjs 205 0 2
✅ nitro-stable-node 177 0 30
✅ nitro-stable-quickjs 176 0 31
✅ nuxt-stable-node 177 0 30
✅ nuxt-stable-quickjs 176 0 31
✅ sveltekit-stable-node 196 0 11
✅ sveltekit-stable-quickjs 195 0 12
✅ tanstack-start-node 177 0 30
✅ tanstack-start-quickjs 176 0 31
✅ vite-stable-node 177 0 30
✅ vite-stable-quickjs 176 0 31

✅ 🪟 Windows

App Passed Failed Skipped
✅ nextjs-turbopack-node 201 0 6
✅ nextjs-turbopack-quickjs 200 0 7

✅ 🌐 Cross-language Conformance

App Passed Failed Skipped
✅ python 68 0 114

✅ dynamic-runs

App Passed Failed Skipped
✅ astro-vercel 0 0 0
✅ example-vercel 0 0 0
✅ express-vercel 0 0 0
✅ fastify-vercel 0 0 0
✅ hono-vercel 0 0 0
✅ nest-vercel 0 0 0
✅ nextjs-turbopack-vercel 0 0 0
✅ nextjs-webpack-vercel 0 0 0
✅ nitro-vercel 0 0 0
✅ nuxt-vercel 0 0 0
✅ sveltekit-vercel 0 0 0
✅ tanstack-start-vercel 0 0 0
✅ vite-vercel 0 0 0

✅ local-postgres-spec9

App Passed Failed Skipped
✅ nextjs-turbopack-stable-node 0 0 182
✅ nextjs-turbopack-stable-quickjs 0 0 182

✅ local-spec9

App Passed Failed Skipped
✅ nextjs-turbopack-node 205 0 2
✅ nextjs-turbopack-quickjs 204 0 3

✅ vercel-http-transport

App Passed Failed Skipped
✅ example 171 0 36
✅ express 171 0 36
✅ hono 171 0 36
✅ nextjs-turbopack 199 0 8
✅ nitro 171 0 36
✅ vite 171 0 36

✅ vercel-multi-region

App Passed Failed Skipped
✅ nextjs-turbopack 27 0 0

✅ vercel-queue-hold

App Passed Failed Skipped
✅ nextjs-turbopack 4 0 0

✅ vercel-spec9

App Passed Failed Skipped
✅ nextjs-turbopack-node 198 0 9
✅ nextjs-turbopack-quickjs 197 0 10

✅ vercel-ws-transport

App Passed Failed Skipped
✅ example 171 0 36
✅ express 171 0 36
✅ nextjs-turbopack 199 0 8
✅ vite 171 0 36

📋 View full workflow run

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

📊 Workflow Benchmarks

commit e4127b6 · Tue, 17 Nov 2026 21:21:09 GMT · run logs

Backend: vercel · app: nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 1762 (+666%) 🔻 2091 🔴 (+47%) 🔻 2107 🔴 (+43%) 🔻 2190 🔴 (+7.2%) 30
TTFS stream 1732 (+31%) 🔻 1822 🔴 (+33%) 🔻 1856 🔴 (+34%) 🔻 2152 🔴 (+49%) 🔻 30
TTFS hook + stream 1945 (+31%) 🔻 2072 🔴 (+30%) 🔻 2134 🔴 (+31%) 🔻 2189 🔴 (+24%) 🔻 30
Fan-out TTFS Promise.all(100 steps) 317 (-1.2%) 507 (-15%) 693 (+16%) 🔻 2112 (+24%) 🔻 10
Fan-out TTLS Promise.all(100 steps) 2225 (+102%) 🔻 3877 (-2.1%) 3965 (-3.1%) 4636 (-15%) 10
STSO 1020 steps (inline) 69 (-12%) 100 (-9.1%) 120 (-9.1%) 176 (-53%) 💚 1019
WO 1020 steps 99907 (-11%) 99907 (-11%) 99907 (-11%) 99907 (-11%) 1
📈 STSO distribution vs main (inline / queue-hop histograms)

1020 steps (inline)

Cumulative STSO time: main 112564ms → this run 99729ms (Δ -12835ms, -11%)

 50-100 ms  ██████████████████░░░░░┃  main 571  this 755  +184
100-150 ms  ███████┃████              main 389  this 249  -140
150-200 ms  ┃                         main  27  this   6   -21
200-250 ms  ┃                         main   8  this   8    +0
250-300 ms  ┃                         main   7  this   0    -7
300-350 ms  ┃                         main   2  this   0    -2
350-400 ms  ┃                         main  12  this   1   -11
400-450 ms  ┃                         main   2  this   0    -2
500-550 ms  ┃                         main   1  this   0    -1
📜 Previous results (2)

7f9291c

Tue, 17 Nov 2026 21:07:46 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 1583 (+585%) 🔻 1870 🔴 (+36%) 🔻 1925 🔴 (+37%) 🔻 2181 🔴 (+0.7%) 30
TTFS stream 1729 (+609%) 🔻 1857 🔴 (+34%) 🔻 1877 🔴 (+26%) 🔻 1908 🔴 (+22%) 🔻 30
TTFS hook + stream 1955 (+401%) 🔻 2049 🔴 (+30%) 🔻 2090 🔴 (+27%) 🔻 4461 🔴 (+167%) 🔻 30
Fan-out TTFS Promise.all(100 steps) 301 (-27%) 💚 2079 (+243%) 🔻 2093 (+30%) 🔻 2119 (+21%) 🔻 10
Fan-out TTLS Promise.all(100 steps) 1286 (-37%) 💚 4650 (+15%) 4687 (+16%) 🔻 7204 (+38%) 🔻 10
STSO 1020 steps (inline) 71 (-13%) 89 (-40%) 💚 110 (-44%) 💚 157 (-54%) 💚 1019
WO 1020 steps 90875 (-34%) 💚 90875 (-34%) 💚 90875 (-34%) 💚 90875 (-34%) 💚 1

12cc4fa

Tue, 17 Nov 2026 20:15:23 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 174 (-49%) 💚 271 🔴 (-81%) 💚 334 🔴 (-77%) 💚 713 🔴 (-61%) 💚 30
TTFS stream 161 (-38%) 💚 286 🔴 (-79%) 💚 328 🔴 (-77%) 💚 399 (-74%) 💚 30
TTFS hook + stream 291 (-72%) 💚 404 🔴 (-74%) 💚 430 🔴 (-74%) 💚 684 🔴 (-65%) 💚 30
Fan-out TTFS Promise.all(100 steps) 371 (+9.4%) 772 (+31%) 🔻 2074 (+181%) 🔻 2222 (+30%) 🔻 10
Fan-out TTLS Promise.all(100 steps) 912 (-72%) 💚 4135 (+7.4%) 5435 (+33%) 🔻 5608 (-1.6%) 10
STSO 1020 steps (inline) 71 (+11%) 96 (-8.6%) 116 (-8.7%) 191 (-13%) 1019
WO 1020 steps 97077 (-5.9%) 97077 (-5.9%) 97077 (-5.9%) 97077 (-5.9%) 1
ℹ️ Metric definitions & methodology

The collapsed STSO distribution section above buckets every step gap, split inline (same warm process — pure framework overhead) vs queue-hop (fresh process — dispatch, reinit, replay). █ = main, ┃ = this run, ░ = fill.

Best/P75/P90/P99 deltas compare against the most recent benchmark run on main at the time of this run. 🔻 flags a delta worse than +15%, 💚 one better than −15%.

Metrics — TTFS: time to first step body (in-deployment start() → first step body) · Fan-out TTFS: fan-out time to first step (in-deployment start() → first of the parallel step bodies to complete) · Fan-out TTLS: fan-out time to last step (in-deployment start() → last of the parallel step bodies to complete, i.e. when the Promise.all resolves) · STSO: step-to-step overhead (gap between consecutive step bodies) · WO: workflow overhead (whole-run time outside step bodies, in-deployment anchored)

Scenarios — step: one trivial no-op step, no stream; no hooks, so the run stays in turbo mode (in-process fast path) · stream: one streaming step; no hooks, so the run stays in turbo mode (in-process fast path) · hook + stream: registers a hook before one step, which exits turbo mode (dispatch path) · 1020 steps: 1020 trivial sequential steps; STSO is measured between consecutive steps in the given step ranges, and WO is the whole-run overhead outside step bodies · Promise.all(100 steps): 100 trivial no-op steps started together in a single Promise.all; Fan-out TTFS is the first of them to complete and Fan-out TTLS the last, both from the in-deployment clientStart, so their gap is the spread the runtime adds across the fan-out

🔴 marks a percentile over its target (within target is left unmarked). Targets (p75/p90/p99, ms) — TTFS 200/300/600

All timestamps are deployment-side; runs are triggered in-deployment, so the CI runner and api.vercel.com sit outside every measured window. TTFS = start() → first step body (includes dispatch + any cold start); Fan-out TTFS/TTLS = first/last step completion of one Promise.all from the same anchor (the gap is the runtime’s fan-out spread); STSO/WO between step bodies. Streaming delivery performance is measured in durabench.

Cold starts stay in the numbers (real bursty-workload latency, inflates P75+); Best is the warm floor.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Sim World

Simulated world deterministic testing for races. Traces

🟢 world-sim scenario book — 0 fail of 45 total
scenario outcome events virt replay violations
✅ smoke-no-steps completed 3 0ms ok 0
✅ smoke-one-step completed 5 0ms ok 0
✅ hook-at-step-started completed 9 0ms ok 0
✅ hook-at-step-completed completed 9 0ms ok 0
✅ hook-at-hook-created completed 9 0ms ok 0
✅ claim-hook-at-registration completed 9 0ms ok 0
✅ claim-hook-at-step-started completed 9 0ms ok 0
✅ deadline-hook-wins completed 6 1.0h ok 0
✅ deadline-expires completed 6 1.0h ok 0
✅ step-vs-timer-early-settlement completed 6 1.0h ok 0
✅ long-sleep completed 9 30.0d ok 0
✅ hook-never-arrives stalled 3 0ms skipped 0
✅ step-retries-twice completed 9 2.0s ok 0
✅ parallel-steps completed 7 0ms ok 0
✅ hook-on-execution-state completed 9 0ms ok 0
✅ peek-hook-before-branch completed 9 0ms ok 0
✅ peek-hook-after-branch completed 9 0ms ok 0
✅ peek-hook-at-registration completed 9 0ms ok 0
✅ race-hook-before-probe completed 9 0ms ok 0
✅ race-hook-after-probe completed 9 0ms ok 0
✅ race-duplicate-delivery completed 10 0ms ok 0
✅ attr-hook-before-step completed 9 0ms ok 0
✅ attr-hook-after-step completed 9 0ms ok 0
✅ attr-from-step-body completed 10 0ms ok 0
✅ fork-hook-after-timeout completed 11 1.0m ok 0
✅ fork-hook-before-timeout completed 11 1.0m ok 0
✅ count-hook-after-timeout completed 13 1.0m ok 0
✅ count-hook-before-timeout completed 15 1.0m ok 0
✅ stale-read-step-count-fork completed 15 1.0m ok 0
✅ stale-read-equal-step-counts completed 11 1.0m ok 0
✅ step-vs-step-fork completed 9 0ms ok 0
✅ step-vs-step-fork-fenced completed 9 1.0s ok 0
✅ fence-catches-benign-direction completed 9 1.0s ok 0
✅ run-ahead-fenced-overlap completed 10 1.0s ok 0
✅ in-flight-before-decision completed 15 1.0m ok 0
✅ in-flight-before-decision-counted completed 13 1.0m ok 0
✅ in-flight-after-decision completed 15 2.0m ok 0
✅ stale-read-step-count-fork-fenced completed 15 1.0m ok 0
✅ fork-hook-wins completed 10 1.0m ok 0
✅ fork-timeout-wins completed 10 1.0m ok 0
✅ unclaimed-payload-under-fork completed 14 1.0m ok 0
✅ claimed-payload-under-fork completed 14 1.0m ok 0
✅ writers-independent-step-bodies completed 9 0ms ok 0
✅ writers-scripted-tempo completed 9 0ms ok 0
✅ cancel-mid-step cancelled 6 0ms skipped 0

Full trace: world-sim.txt

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor
Framework Flow route Step reg. Framework output
hono 306.2 KiB (±0) 124.0 KiB (±0) 2.39 MiB (±0)
nextjs-turbopack 397.8 KiB (±0) 491 B (±0) 1.13 MiB (±0)
About these numbers

Sizes are gzip; parentheses show the change against main.
Flow route and Step reg. gate this job, on raw bytes rather than the gzip shown, at max(2%, 50.0 KiB). Framework output is informational.

e4127b6 · run

mitul-s and others added 2 commits November 17, 2026 16:10
Signed-off-by: Mitul Shah <[email protected]>

Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>
@mitul-s mitul-s mentioned this pull request Nov 17, 2026
2 of 3 tasks
mitul-s added a commit that referenced this pull request Nov 17, 2026
### What

Deletes dead code in `@workflow/web-shared`, and removes every public
export that neither `@workflow/web` nor the Vercel dashboard
(`vercel/front`) imports, including the unused
`@workflow/web-shared/components` entry point. This is the web-shared
half of #5529. The `@workflow/web` half is in #5543, and the two PRs
don't depend on each other.

### Why

Code that nothing runs still has to be maintained and reviewed, and
every export is API we have to keep working. Consumers are expected to
update with this change rather than hold the cleanup back. The dashboard
only needs one change, listed below.

### Preview

[workflow-web
preview](https://workflow-web-git-web-shared-delete-dead-code.labs.vercel.dev/?tab=runs)

1. Open a run whose input or output contains a stream, a run reference,
a class instance or encrypted data, and go to `?tab=trace`.
2. Select the step and check that the inspector still renders stream and
run refs as links, class instances with their class name, and encrypted
fields as `Encrypted` with a Decrypt button that decrypts them.

#### Change needed in `vercel/front`

`hydrateResourceIOWithKey` is removed. Swap it for
`hydrateResourceIOAsync`, which takes the same arguments:

- `observability/(tabs)/workflows/lib/use-events-list-data.ts` (lines 8,
73, 107, 141)
- `observability/(tabs)/workflows/components/run-details-view.tsx`
(lines 9, 192)

Nothing else the dashboard imports changes (checked against front's
`main` on 2026-11-17), and front never imports the `/components`
subpath.

#### Removed exports

| Export | What happened to the code |
| --- | --- |
| `hydrateResourceIOWithKey` | Deleted. It only forwarded to
`hydrateResourceIOAsync`. |
| `MenuDropdown`, `MenuDropdownOption` | Deleted. Unused here, in front,
and anywhere else in the org (`gh search code --owner vercel`). |
| `materializeSteps`, `materializeHooks`, `materializeWaits`,
`materializeAll` and the `Materialized*` types | Deleted
`lib/event-materialization.ts` and its tests. Only `index.ts` and tests
imported it. |
| `shouldShowReenqueueButton`, `hasPendingStepsFromEvents`,
`hasPendingHooksFromEvents`, `isTerminalStatus` | Deleted.
`analyzeEvents` stays. |
| `identifyStreamSteps`, `StreamStep` | Deleted. |
| `looksLikeWorkflowIdSearchInput` | Deleted, along with its tests. |
| `CLASS_INSTANCE_REF_TYPE`, `ClassInstanceRef`, `extractStreamIds`,
`isClassInstanceRef`, `isStreamId`, `isStreamRef`, `STREAM_REF_TYPE`,
`truncateId`, `StreamRef` | Re-exports from
`@workflow/core/serialization-format`. Import them from there. |
| `hookEventsToHookEntity`, `isEncryptedMarker`,
`DUPLICATE_EVENT_MESSAGE`, `findDuplicateEventIds`, `isSealedNoopEvent`,
`SEALED_EVENT_MESSAGE`, `parseExactWorkflowSearchId`,
`ExactWorkflowSearchId`, `isQuickJSSnapshotRun`, `extractConversation`,
`isDoStreamStep`, `formatDurationPrecise`, `DecodedStreamChunkSource`,
`useToast` | Still used inside the package. Only the export from the
entry point goes. |
| `ResolveHookModal`, `ConversationView`, `SidebarDataProvider`,
`SelectedSpanInfo`, `DecryptClickContext`, `DecryptClickContextValue`,
`IconButton`, `Kbd`, `LoadMoreButton` | Same: used internally, no longer
exported. |

#### Kept on purpose

- Types that are part of an API that stays public, so callers can
annotate what they pass in or get back: `ButtonProps`,
`DataInspectorProps`, the
`useHookActions`/`HookResolveModalWrapper`/`ResolveHookDropdownItem`
prop and option types, `EventAnalysis`,
`RunLimitGuidance`/`RunLimitGuidanceKind`,
`RunStateHydratorOptions`/`StateHistoryPage` (the docs describe
`createRunStateHydrator` for custom inspectors), and
`SpanSelectionInfo`/`DetailResource` (the arguments and result of
`FetchSpanDetail`).
- `SpanEvent`, which is part of `Span`, and which the v5 What's New page
says is still exported.
- `collapseRefs` and `isDeepEqual` stay exported from their modules for
their tests.

#### Other cleanup

- Deleted `ui/card.tsx` and `ui/alert.tsx` (unused copies of web's
shadcn components), `hooks/use-dark-mode.ts`, `DuplicateEventTooltip`,
and the unused `getPaginationDisplay` in `lib/utils.ts`.
- Deleted `src/index.d.ts` and `src/components/index.d.ts`: tsc ignores
a `.d.ts` next to a `.ts` of the same name, and the published types come
from `dist/`.
- `ui/data-inspector.tsx` drops its private copies of the ref type
guards and imports them from `lib/hydration.ts`.
- Dropped `export` from symbols that only their own file uses
(`AttributeBlock`, `DetailKeyValueRow`, `sortAttributeKeys`,
`TimelineBar`, `kbdVariants`,
`MIN_START`/`MIN_END`/`MeasureFn`/`TruncateResult`,
`EXPIRED_DISPLAY_NAME`, `summarizeArrayBufferView`, `isRunLevelEvent`,
`convertEventsToSpanEvents`).
- Comments that still mentioned `ObjectInspector` now say
`DataInspector`.
- Removed the unused `shiki` dependency. The lockfile diff is three
deleted lines.

#### Overlap with other open PRs

- #5557 rebuilds `MenuDropdown` on Radix, but this PR deletes it because
nothing uses it. Only one of the two should land.
- #5528 edits `lib/event-materialization.ts` and `start-hook.test.ts`,
which this PR deletes and trims. Whichever lands second resolves the
conflict by keeping the deletion.
- #5522, #5523, #5528 and #5530 edit the same entry-point barrels
(`src/index.ts`, `src/components/index.ts`), so expect small conflicts
there.

#### Differences from #5529

- #5529's sync with `main` restored `ui/alert.tsx` and `shiki` by taking
`main`'s copies of conflicting files. This PR deletes them again because
they are still unused on `main`.
- #5529 kept `hydrateResourceIOWithKey` as a deprecated alias for the
dashboard. This PR removes it.

### How did you test your changes?

- `pnpm turbo typecheck test build --filter=@workflow/web-shared` on the
first commit: 10/10 tasks passed.
- `pnpm typecheck` in `packages/web-shared`: no errors.
- `pnpm vitest run` in `packages/web-shared`: 34 files, 276 tests
passed. Ten fewer than `main`: the seven `event-materialization` tests,
the start Hook materialization test, and the two
`looksLikeWorkflowIdSearchInput` tests, all of which covered deleted
code.
- `pnpm turbo build test --filter=@workflow/web` against this branch:
10/10 passed, so `web` builds on the smaller API. `react-router typegen
&& tsc --noEmit` in `packages/web` reports the same 19 errors as `main`.
- `pnpm biome check packages/web-shared`: no errors.
- Export audit: every remaining export from `src/index.ts` is imported
by `packages/web` or front, apart from the types kept on purpose above.
- Visuals were not rendered. The only runtime change is
`DataInspector`'s ref detection, which now uses the `@workflow/core`
guards. They check `__type` with `in`, so they also match the
non-enumerable opaque refs that `collapseRefs` builds, and the existing
`DataInspector`/`collapseRefs` tests pass.

### PR Checklist - Required to merge

- [x] 📦 `pnpm changeset` was run to create a changelog for this PR
- Use the correct semver bump type: `patch` for bug fixes, `minor` for
new features, `major` for breaking changes.
- Use `pnpm changeset --empty` if you are changing documentation or
workbench apps
- [x] 🔒 DCO sign-off passes (run `git commit --signoff` on your commits)
- [ ] 📝 Ping `@vercel/workflow` in a comment once the PR is ready, and
the above checklist is complete

_Written by fx_

---------

Signed-off-by: mitul-s <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – workflow-docs — e4127b61 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant