Skip to content

[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers - #2633

Open
VaguelySerious wants to merge 4 commits into
mainfrom
peter/world-vercel-h2-resilient
Open

[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers#2633
VaguelySerious wants to merge 4 commits into
mainfrom
peter/world-vercel-h2-resilient

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problem

When @workflow/world-vercel is bundled into an ESM server output (a custom Vite/Rollup/esbuild build, or a framework integration that doesn't externalize undici), undici's lazy require('node:http2') can be left un-wired. undici swallows the failure and falls back to a stub whose http2.connect is undefined, so the first HTTP/2 connect throws http2.connect is not a function — surfacing (after undici's ~16s connect-retry backoff) as a failed request. On the events/stream H2 paths this silently breaks observability reads (and stream writes) for any such consumer.

What this does

A runtime HTTP/2 → HTTP/1.1 fallback, plus a best-effort H2 preserver:

  • fetchWithH2Fallback(path, …) issues the request over the H2 dispatcher and, on the bundling failure signature (isHttp2ConnectUnavailableError), retries the same request on an HTTP/1.1 dispatcher and latches the downgrade process-wide so later requests skip the dead H2 attempt and its ~16s backoff. The connect failure is pre-send, so replaying is safe even for the non-idempotent stream writes — and the stream fallback preserves STREAM_RETRY_OPTIONS (never retries 5xx). v4 events and stream write/close now route through this helper.
  • Layer A (global require self-install) stays as a best-effort H2 preserver: where undici's bundled require is a free identifier it restores real H2; where it isn't (notably nitro/rollup per-chunk bindings) the runtime fallback covers correctness.

Why the previous load-time probe was replaced

The earlier approach probed globalThis.require('node:http2') at load time to decide whether to keep H2. That checks the wrong binding: in bundlers like nitro/rollup undici's require resolves to a tool-injected per-chunk binding the global never reaches, so the probe false-positived (saw H2 "available", kept allowH2: true) and the request still hung. The runtime fallback triggers on the actual connect failure, so it recovers regardless of how the bundler bound undici's require.

The framework build banners (@workflow/sveltekit, @workflow/nitro, @workflow/web) remain the way to keep full H2 performance in the bundlers we ship a builder for; this is the correctness catch-all for consumers we don't.

Verification

  • Full @workflow/world-vercel suite green (182 tests), typecheck + lint clean.
  • New unit tests: isHttp2ConnectUnavailableError signature matching (incl. minified .connect, non-match on ECONNREFUSED/unrelated/nullish); fetchWithH2Fallback retry-on-distinct-H1-dispatcher, downgrade latching, stream-policy preservation, non-H2 rethrow, override-verbatim.
  • End-to-end against real undici: forced undici onto the stub path (http2.connect = undefined) against a dual h1/h2 server — fetchWithH2Fallback('events', …) returns 200 over HTTP/1.1 after the H2 backoff (call update docs sidebar to auto expand #1 ~15.6s), and call Home tweaks #2 is ~9ms (latched to H1).

🤖 Generated with Claude Code

… fallback)
undici loads node:http2 lazily via a bare require('node:http2'). When
world-vercel is bundled into an ESM server (a custom Vite/Rollup/esbuild build,
or any consumer that doesn't externalize undici), there is no require in scope:
the call throws, undici falls back to a stub with no http2.connect, and every
HTTP/2 request (the events API + stream writes) hangs on a dead connection
through RetryAgent's backoff (~16s) then fails. Framework integrations have been
patching this one bundler at a time with a build banner; a custom or third-party
bundled consumer gets no protection.
Move the defense into the package itself, two layers:
A. Install a working `globalThis.require` (createRequire-backed) at module load
so undici's bare require resolves the real node:http2 regardless of how a
consumer bundles us. Guarded to a no-op wherever a real require already
exists.
B. Detect whether node:http2 is actually usable and, if not, build the H2
dispatchers with allowH2:false and warn once — so requests degrade to working
HTTP/1.1 instead of silently failing.
Exports isHttp2Available() and shouldFallBackToH1() with unit coverage,
including a simulated bundled-undici stub (http2 without connect).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6988e7f

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

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production144202301672
✅ 💻 Local Development160502191824
✅ 📦 Local Production160502191824
✅ 🐘 Local Postgres159302311824
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7282010788360

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nextjs-turbopack14903
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.047s (-2.5%)1.007s (~)0.960s101.00x
💻 LocalExpress0.048s (+3.2%)1.005s (~)0.957s101.03x
💻 LocalNext.js (Turbopack)0.049s (+0.8%)1.007s (~)0.958s101.05x
🐘 PostgresNext.js (Turbopack)0.065s (+5.5% 🔺)1.013s (~)0.948s101.39x
🐘 PostgresNitro0.070s (+9.9% 🔺)1.012s (~)0.942s101.49x
🐘 PostgresExpress0.076s (+15.6% 🔺)1.012s (~)0.936s101.63x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.082s (~)2.006s (~)0.924s101.00x
💻 LocalNitro1.082s (~)2.007s (~)0.925s101.00x
💻 LocalNext.js (Turbopack)1.086s (+0.6%)2.006s (~)0.920s101.00x
🐘 PostgresNitro1.094s (~)2.009s (~)0.915s101.01x
🐘 PostgresExpress1.098s (~)2.012s (~)0.913s101.02x
🐘 PostgresNext.js (Turbopack)1.101s (-0.5%)2.010s (~)0.909s101.02x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.437s (~)11.023s (~)0.586s31.00x
🐘 PostgresNitro10.440s (~)11.012s (~)0.572s31.00x
💻 LocalNitro10.459s (~)11.022s (~)0.563s31.00x
💻 LocalNext.js (Turbopack)10.462s (~)11.022s (~)0.560s31.00x
🐘 PostgresExpress10.476s (~)11.019s (~)0.543s31.00x
🐘 PostgresNext.js (Turbopack)10.556s (~)11.024s (~)0.468s31.01x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro13.544s (~)14.019s (~)0.474s51.00x
💻 LocalExpress13.588s (~)14.028s (~)0.440s51.00x
💻 LocalNitro13.631s (~)14.027s (~)0.397s51.01x
🐘 PostgresExpress13.674s (-1.1%)14.019s (~)0.345s51.01x
🐘 PostgresNext.js (Turbopack)13.759s (~)14.025s (~)0.266s51.02x
💻 LocalNext.js (Turbopack)13.775s (+0.9%)14.027s (~)0.252s51.02x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express12.134s (~)13.025s (~)0.891s71.00x
🐘 PostgresExpress12.213s (~)13.017s (~)0.805s71.01x
💻 LocalNext.js (Turbopack)12.354s (+1.6%)13.024s (~)0.671s71.02x
💻 LocalNitro12.406s (+2.3%)13.024s (~)0.618s71.02x
🐘 PostgresNitro12.498s (+2.8%)13.159s (+1.1%)0.661s71.03x
🐘 PostgresNext.js (Turbopack)12.503s (+0.7%)13.020s (~)0.517s71.03x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.165s (-1.4%)2.008s (~)0.843s151.00x
🐘 PostgresExpress1.176s (~)2.007s (~)0.831s151.01x
🐘 PostgresNext.js (Turbopack)1.211s (~)2.011s (~)0.800s151.04x
💻 LocalNitro1.400s (~)2.006s (~)0.607s151.20x
💻 LocalExpress1.438s (+3.2%)2.006s (~)0.568s151.23x
💻 LocalNext.js (Turbopack)1.454s (-2.2%)2.007s (-3.2%)0.552s151.25x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.282s (-2.9%)2.316s (-7.7% 🟢)1.034s131.00x
🐘 PostgresNext.js (Turbopack)1.337s (-0.6%)3.110s (+3.3%)1.772s101.04x
🐘 PostgresExpress1.386s (+4.0%)2.737s (+14.4% 🔺)1.351s111.08x
💻 LocalExpress2.576s (+4.1%)3.009s (~)0.433s102.01x
💻 LocalNitro2.592s (+2.7%)2.917s (-3.0%)0.325s112.02x
💻 LocalNext.js (Turbopack)2.657s (+3.4%)3.109s (+3.3%)0.451s102.07x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.558s (-3.6%)4.010s (~)2.452s81.00x
🐘 PostgresExpress1.634s (~)4.136s (-3.8%)2.502s81.05x
🐘 PostgresNext.js (Turbopack)3.567s (+41.5% 🔺)8.529s (+54.7% 🔺)4.962s42.29x
💻 LocalNitro6.142s (+18.3% 🔺)6.620s (+13.2% 🔺)0.477s53.94x
💻 LocalExpress6.758s (+23.9% 🔺)7.217s (+16.1% 🔺)0.459s54.34x
💻 LocalNext.js (Turbopack)8.060s (+16.4% 🔺)8.769s (+18.2% 🔺)0.709s45.17x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.177s (-0.7%)2.008s (~)0.831s151.00x
🐘 PostgresNext.js (Turbopack)1.203s (-1.1%)2.009s (~)0.806s151.02x
🐘 PostgresNitro1.301s (+10.2% 🔺)2.074s (+3.3%)0.773s151.10x
💻 LocalExpress1.411s (+2.3%)2.007s (~)0.595s151.20x
💻 LocalNitro1.436s (-0.9%)2.007s (~)0.571s151.22x
💻 LocalNext.js (Turbopack)1.470s (+2.7%)2.007s (~)0.537s151.25x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.317s (~)2.508s (+12.8% 🔺)1.191s121.00x
🐘 PostgresNitro1.337s (+2.0%)2.394s (+3.3%)1.057s131.02x
🐘 PostgresNext.js (Turbopack)1.337s (~)3.011s (-3.1%)1.673s101.02x
💻 LocalNitro2.538s (-5.2% 🟢)3.009s (~)0.471s101.93x
💻 LocalExpress2.616s (+2.2%)3.109s (+3.3%)0.493s101.99x
💻 LocalNext.js (Turbopack)2.847s (+4.3%)3.208s (+3.2%)0.361s102.16x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.573s (-3.9%)4.135s (~)2.562s81.00x
🐘 PostgresExpress1.641s (+1.5%)4.014s (-3.0%)2.373s81.04x
🐘 PostgresNext.js (Turbopack)3.370s (+1.1%)6.618s (+10.0% 🔺)3.249s52.14x
💻 LocalNitro6.183s (-6.1% 🟢)7.015s (-2.8%)0.832s53.93x
💻 LocalNext.js (Turbopack)6.571s (+27.7% 🔺)7.217s (+27.1% 🔺)0.646s54.18x
💻 LocalExpress7.391s (+18.0% 🔺)8.019s (+21.3% 🔺)0.629s44.70x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.536s (-2.3%)1.006s (~)0.470s601.00x
💻 LocalExpress0.573s (+2.0%)1.005s (-1.6%)0.433s601.07x
🐘 PostgresNext.js (Turbopack)0.595s (+3.8%)1.008s (~)0.412s601.11x
💻 LocalNext.js (Turbopack)0.601s (+3.4%)1.005s (-1.7%)0.404s601.12x
🐘 PostgresNitro0.602s (+8.4% 🔺)1.077s (+3.5%)0.475s571.12x
💻 LocalNitro0.636s (+16.5% 🔺)1.022s (+1.7%)0.386s591.19x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.275s (-3.7%)2.007s (~)0.732s451.00x
🐘 PostgresExpress1.278s (-3.4%)2.008s (-1.1%)0.729s451.00x
🐘 PostgresNext.js (Turbopack)1.386s (-4.1%)2.007s (-1.1%)0.621s451.09x
💻 LocalNitro1.493s (+7.5% 🔺)2.006s (~)0.513s451.17x
💻 LocalExpress1.511s (+9.3% 🔺)2.051s (+2.3%)0.540s451.19x
💻 LocalNext.js (Turbopack)1.513s (+8.8% 🔺)2.006s (~)0.493s451.19x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.483s (-3.6%)3.033s (-1.7%)0.550s401.00x
🐘 PostgresExpress2.631s (-2.8%)3.085s (-1.7%)0.454s391.06x
🐘 PostgresNext.js (Turbopack)2.803s (~)3.059s (+1.6%)0.255s401.13x
💻 LocalExpress3.229s (+8.8% 🔺)4.010s (+21.3% 🔺)0.781s301.30x
💻 LocalNitro3.255s (+7.5% 🔺)3.945s (+10.6% 🔺)0.690s311.31x
💻 LocalNext.js (Turbopack)3.369s (+9.7% 🔺)4.043s (+9.1% 🔺)0.673s301.36x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.199s (+8.0% 🔺)1.007s (~)0.808s601.00x
🐘 PostgresNitro0.212s (~)1.006s (~)0.794s601.07x
🐘 PostgresExpress0.216s (+3.3%)1.006s (~)0.790s601.09x
💻 LocalNitro0.468s (+1.7%)1.005s (~)0.537s602.35x
💻 LocalExpress0.504s (+18.9% 🔺)1.022s (+1.8%)0.518s592.54x
💻 LocalNext.js (Turbopack)0.635s (+5.7% 🔺)1.005s (~)0.370s603.20x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.309s (~)1.030s (+2.3%)0.720s881.00x
🐘 PostgresNitro0.319s (~)1.006s (~)0.687s901.03x
🐘 PostgresExpress0.331s (+3.8%)1.006s (~)0.675s901.07x
💻 LocalExpress2.083s (-3.4%)2.714s (-0.8%)0.631s346.73x
💻 LocalNitro2.111s (-0.7%)2.656s (-5.0% 🟢)0.545s346.82x
💻 LocalNext.js (Turbopack)2.724s (-2.1%)3.223s (+4.8%)0.499s288.80x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.537s (-1.0%)3.086s (+2.5%)2.549s391.00x
🐘 PostgresExpress0.550s (+5.7% 🔺)1.059s (+1.8%)0.509s1141.03x
🐘 PostgresNitro0.563s (+3.6%)1.136s (+6.4% 🔺)0.574s1081.05x
💻 LocalNext.js (Turbopack)9.793s (-8.7% 🟢)10.699s (-5.3% 🟢)0.906s1218.24x
💻 LocalNitro10.012s (+11.2% 🔺)10.939s (+8.2% 🔺)0.927s1118.64x
💻 LocalExpress10.125s (+8.5% 🔺)11.118s (+6.4% 🔺)0.993s1118.86x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.142s (+0.9%)1.966s (~)0.012s (+16.7% 🔺)2.019s (~)0.877s101.00x
🐘 PostgresNitro1.152s (~)1.997s (~)0.001s (-23.1% 🟢)2.011s (~)0.859s101.01x
💻 LocalExpress1.157s (+1.1%)2.004s (~)0.012s (+28.7% 🔺)2.020s (~)0.862s101.01x
💻 LocalNitro1.160s (+1.8%)2.004s (~)0.012s (+9.3% 🔺)2.019s (~)0.859s101.02x
🐘 PostgresExpress1.161s (-0.6%)2.000s (~)0.001s (-29.4% 🟢)2.011s (~)0.851s101.02x
🐘 PostgresNext.js (Turbopack)1.174s (~)2.001s (~)0.001s (-8.3% 🟢)2.011s (~)0.837s101.03x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.536s (+1.2%)2.010s (~)0.012s (-6.8% 🟢)2.025s (~)0.489s301.00x
🐘 PostgresNitro1.537s (-1.0%)2.002s (~)0.005s (+8.8% 🔺)2.026s (~)0.489s301.00x
💻 LocalNitro1.544s (+1.9%)2.010s (~)0.012s (-3.3%)2.025s (~)0.481s301.01x
💻 LocalNext.js (Turbopack)1.576s (+3.3%)1.970s (~)0.014s (~)2.027s (~)0.451s301.03x
🐘 PostgresExpress1.577s (-2.6%)2.006s (-1.5%)0.005s (+9.1% 🔺)2.026s (-1.7%)0.449s301.03x
🐘 PostgresNext.js (Turbopack)1.658s (+2.2%)2.017s (~)0.005s (~)2.034s (~)0.376s301.08x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.749s (-3.5%)1.062s (-1.5%)0.000s (+Infinity% 🔺)1.078s (-2.5%)0.329s561.00x
🐘 PostgresExpress0.758s (-6.9% 🟢)1.028s (-6.7% 🟢)0.000s (+Infinity% 🔺)1.050s (-6.1% 🟢)0.292s581.01x
🐘 PostgresNext.js (Turbopack)0.977s (-5.7% 🟢)1.354s (-5.2% 🟢)0.000s (NaN%)1.372s (-4.5%)0.395s451.30x
💻 LocalNitro1.256s (-1.2%)1.980s (+1.7%)0.000s (+85.7% 🔺)1.983s (+1.7%)0.728s311.68x
💻 LocalExpress1.262s (-1.1%)1.948s (-3.1%)0.000s (+10.6% 🔺)1.950s (-3.2%)0.689s311.68x
💻 LocalNext.js (Turbopack)1.392s (+5.0% 🔺)1.979s (~)0.001s (+400.0% 🔺)2.017s (~)0.624s301.86x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.674s (-3.8%)2.253s (-3.7%)0.000s (+Infinity% 🔺)2.269s (-4.4%)0.595s271.00x
🐘 PostgresNitro1.809s (+5.1% 🔺)2.435s (+4.1%)0.000s (+Infinity% 🔺)2.450s (+4.0%)0.641s251.08x
🐘 PostgresNext.js (Turbopack)2.411s (-8.1% 🟢)2.952s (-6.6% 🟢)0.000s (-100.0% 🟢)2.962s (-6.5% 🟢)0.551s211.44x
💻 LocalExpress3.435s (+8.5% 🔺)4.093s (+9.8% 🔺)0.001s (-11.0% 🟢)4.097s (+9.8% 🔺)0.661s152.05x
💻 LocalNext.js (Turbopack)3.453s (+8.5% 🔺)3.989s (+11.6% 🔺)0.001s (-49.6% 🟢)4.032s (+11.4% 🔺)0.578s152.06x
💻 LocalNitro3.642s (+3.5%)4.092s (-3.2%)0.001s (+70.0% 🔺)4.099s (-3.1%)0.458s152.17x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress11/21
🐘 PostgresNitro12/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres14/21
Next.js (Turbopack)🐘 Postgres15/21
Nitro🐘 Postgres18/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)
  • 🌐 Platformatic: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

…-vercel)
world-vercel installs the global `require` shim itself (and falls back to H1
when node:http2 is unreachable), so the per-bundler banners in the nitro and
sveltekit integrations are redundant. Remove them; their e2e-vercel-prod lanes
(nitro, vite, tanstack-start via nitro; sveltekit) now validate that
world-vercel's built-in shim carries those bundles on its own.
The @workflow/web banner is intentionally kept for now — workflow-web has no
e2e coverage, so it stays as belt-and-suspenders until a deployed-web smoke
test exists.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the load-time `node:http2` capability probe (which checked
`globalThis.require`, the wrong binding — it false-positives in bundlers like
nitro/rollup where undici's `require` is a tool-injected per-chunk binding the
global never reaches, so it kept H2 on and still hung) with a runtime fallback.
`fetchWithH2Fallback(path, ...)` issues the request over the H2 dispatcher and,
on the bundling failure signature (`http2.connect is not a function` —
detected via `isHttp2ConnectUnavailableError`), retries the same request on an
HTTP/1.1 dispatcher and latches the downgrade process-wide so later requests
skip the dead H2 attempt and its ~16s connect-retry backoff. The connect
failure is pre-send, so the replay is safe even for the non-idempotent stream
writes; the stream fallback preserves STREAM_RETRY_OPTIONS (never retries 5xx).
This recovers regardless of how the bundler bound undici's `require`, unlike
the probe. Layer A (the global `require` self-install) stays as a best-effort
H2 preserver; the framework banners remain for full H2 perf where we ship a
builder. Routes v4 events and stream write/close through the new helper.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@VaguelySeriousVaguelySerious changed the title [world-vercel] Best-effort HTTP/2 bundling backstop (global require + H1 fallback)[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM serversJun 26, 2026
Sign up for freeto 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

@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers by VaguelySerious · Pull Request #2633 · vercel/workflow · GitHub
Skip to content

[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers - #2633

Open
VaguelySerious wants to merge 4 commits into
mainfrom
peter/world-vercel-h2-resilient
Open

[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers#2633
VaguelySerious wants to merge 4 commits into
mainfrom
peter/world-vercel-h2-resilient

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problem

When @workflow/world-vercel is bundled into an ESM server output (a custom Vite/Rollup/esbuild build, or a framework integration that doesn't externalize undici), undici's lazy require('node:http2') can be left un-wired. undici swallows the failure and falls back to a stub whose http2.connect is undefined, so the first HTTP/2 connect throws http2.connect is not a function — surfacing (after undici's ~16s connect-retry backoff) as a failed request. On the events/stream H2 paths this silently breaks observability reads (and stream writes) for any such consumer.

What this does

A runtime HTTP/2 → HTTP/1.1 fallback, plus a best-effort H2 preserver:

  • fetchWithH2Fallback(path, …) issues the request over the H2 dispatcher and, on the bundling failure signature (isHttp2ConnectUnavailableError), retries the same request on an HTTP/1.1 dispatcher and latches the downgrade process-wide so later requests skip the dead H2 attempt and its ~16s backoff. The connect failure is pre-send, so replaying is safe even for the non-idempotent stream writes — and the stream fallback preserves STREAM_RETRY_OPTIONS (never retries 5xx). v4 events and stream write/close now route through this helper.
  • Layer A (global require self-install) stays as a best-effort H2 preserver: where undici's bundled require is a free identifier it restores real H2; where it isn't (notably nitro/rollup per-chunk bindings) the runtime fallback covers correctness.

Why the previous load-time probe was replaced

The earlier approach probed globalThis.require('node:http2') at load time to decide whether to keep H2. That checks the wrong binding: in bundlers like nitro/rollup undici's require resolves to a tool-injected per-chunk binding the global never reaches, so the probe false-positived (saw H2 "available", kept allowH2: true) and the request still hung. The runtime fallback triggers on the actual connect failure, so it recovers regardless of how the bundler bound undici's require.

The framework build banners (@workflow/sveltekit, @workflow/nitro, @workflow/web) remain the way to keep full H2 performance in the bundlers we ship a builder for; this is the correctness catch-all for consumers we don't.

Verification

  • Full @workflow/world-vercel suite green (182 tests), typecheck + lint clean.
  • New unit tests: isHttp2ConnectUnavailableError signature matching (incl. minified .connect, non-match on ECONNREFUSED/unrelated/nullish); fetchWithH2Fallback retry-on-distinct-H1-dispatcher, downgrade latching, stream-policy preservation, non-H2 rethrow, override-verbatim.
  • End-to-end against real undici: forced undici onto the stub path (http2.connect = undefined) against a dual h1/h2 server — fetchWithH2Fallback('events', …) returns 200 over HTTP/1.1 after the H2 backoff (call update docs sidebar to auto expand #1 ~15.6s), and call Home tweaks #2 is ~9ms (latched to H1).

🤖 Generated with Claude Code

… fallback)
undici loads node:http2 lazily via a bare require('node:http2'). When
world-vercel is bundled into an ESM server (a custom Vite/Rollup/esbuild build,
or any consumer that doesn't externalize undici), there is no require in scope:
the call throws, undici falls back to a stub with no http2.connect, and every
HTTP/2 request (the events API + stream writes) hangs on a dead connection
through RetryAgent's backoff (~16s) then fails. Framework integrations have been
patching this one bundler at a time with a build banner; a custom or third-party
bundled consumer gets no protection.
Move the defense into the package itself, two layers:
A. Install a working `globalThis.require` (createRequire-backed) at module load
so undici's bare require resolves the real node:http2 regardless of how a
consumer bundles us. Guarded to a no-op wherever a real require already
exists.
B. Detect whether node:http2 is actually usable and, if not, build the H2
dispatchers with allowH2:false and warn once — so requests degrade to working
HTTP/1.1 instead of silently failing.
Exports isHttp2Available() and shouldFallBackToH1() with unit coverage,
including a simulated bundled-undici stub (http2 without connect).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6988e7f

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

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production144202301672
✅ 💻 Local Development160502191824
✅ 📦 Local Production160502191824
✅ 🐘 Local Postgres159302311824
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7282010788360

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nextjs-turbopack14903
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.047s (-2.5%)1.007s (~)0.960s101.00x
💻 LocalExpress0.048s (+3.2%)1.005s (~)0.957s101.03x
💻 LocalNext.js (Turbopack)0.049s (+0.8%)1.007s (~)0.958s101.05x
🐘 PostgresNext.js (Turbopack)0.065s (+5.5% 🔺)1.013s (~)0.948s101.39x
🐘 PostgresNitro0.070s (+9.9% 🔺)1.012s (~)0.942s101.49x
🐘 PostgresExpress0.076s (+15.6% 🔺)1.012s (~)0.936s101.63x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.082s (~)2.006s (~)0.924s101.00x
💻 LocalNitro1.082s (~)2.007s (~)0.925s101.00x
💻 LocalNext.js (Turbopack)1.086s (+0.6%)2.006s (~)0.920s101.00x
🐘 PostgresNitro1.094s (~)2.009s (~)0.915s101.01x
🐘 PostgresExpress1.098s (~)2.012s (~)0.913s101.02x
🐘 PostgresNext.js (Turbopack)1.101s (-0.5%)2.010s (~)0.909s101.02x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.437s (~)11.023s (~)0.586s31.00x
🐘 PostgresNitro10.440s (~)11.012s (~)0.572s31.00x
💻 LocalNitro10.459s (~)11.022s (~)0.563s31.00x
💻 LocalNext.js (Turbopack)10.462s (~)11.022s (~)0.560s31.00x
🐘 PostgresExpress10.476s (~)11.019s (~)0.543s31.00x
🐘 PostgresNext.js (Turbopack)10.556s (~)11.024s (~)0.468s31.01x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro13.544s (~)14.019s (~)0.474s51.00x
💻 LocalExpress13.588s (~)14.028s (~)0.440s51.00x
💻 LocalNitro13.631s (~)14.027s (~)0.397s51.01x
🐘 PostgresExpress13.674s (-1.1%)14.019s (~)0.345s51.01x
🐘 PostgresNext.js (Turbopack)13.759s (~)14.025s (~)0.266s51.02x
💻 LocalNext.js (Turbopack)13.775s (+0.9%)14.027s (~)0.252s51.02x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express12.134s (~)13.025s (~)0.891s71.00x
🐘 PostgresExpress12.213s (~)13.017s (~)0.805s71.01x
💻 LocalNext.js (Turbopack)12.354s (+1.6%)13.024s (~)0.671s71.02x
💻 LocalNitro12.406s (+2.3%)13.024s (~)0.618s71.02x
🐘 PostgresNitro12.498s (+2.8%)13.159s (+1.1%)0.661s71.03x
🐘 PostgresNext.js (Turbopack)12.503s (+0.7%)13.020s (~)0.517s71.03x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.165s (-1.4%)2.008s (~)0.843s151.00x
🐘 PostgresExpress1.176s (~)2.007s (~)0.831s151.01x
🐘 PostgresNext.js (Turbopack)1.211s (~)2.011s (~)0.800s151.04x
💻 LocalNitro1.400s (~)2.006s (~)0.607s151.20x
💻 LocalExpress1.438s (+3.2%)2.006s (~)0.568s151.23x
💻 LocalNext.js (Turbopack)1.454s (-2.2%)2.007s (-3.2%)0.552s151.25x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.282s (-2.9%)2.316s (-7.7% 🟢)1.034s131.00x
🐘 PostgresNext.js (Turbopack)1.337s (-0.6%)3.110s (+3.3%)1.772s101.04x
🐘 PostgresExpress1.386s (+4.0%)2.737s (+14.4% 🔺)1.351s111.08x
💻 LocalExpress2.576s (+4.1%)3.009s (~)0.433s102.01x
💻 LocalNitro2.592s (+2.7%)2.917s (-3.0%)0.325s112.02x
💻 LocalNext.js (Turbopack)2.657s (+3.4%)3.109s (+3.3%)0.451s102.07x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.558s (-3.6%)4.010s (~)2.452s81.00x
🐘 PostgresExpress1.634s (~)4.136s (-3.8%)2.502s81.05x
🐘 PostgresNext.js (Turbopack)3.567s (+41.5% 🔺)8.529s (+54.7% 🔺)4.962s42.29x
💻 LocalNitro6.142s (+18.3% 🔺)6.620s (+13.2% 🔺)0.477s53.94x
💻 LocalExpress6.758s (+23.9% 🔺)7.217s (+16.1% 🔺)0.459s54.34x
💻 LocalNext.js (Turbopack)8.060s (+16.4% 🔺)8.769s (+18.2% 🔺)0.709s45.17x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.177s (-0.7%)2.008s (~)0.831s151.00x
🐘 PostgresNext.js (Turbopack)1.203s (-1.1%)2.009s (~)0.806s151.02x
🐘 PostgresNitro1.301s (+10.2% 🔺)2.074s (+3.3%)0.773s151.10x
💻 LocalExpress1.411s (+2.3%)2.007s (~)0.595s151.20x
💻 LocalNitro1.436s (-0.9%)2.007s (~)0.571s151.22x
💻 LocalNext.js (Turbopack)1.470s (+2.7%)2.007s (~)0.537s151.25x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.317s (~)2.508s (+12.8% 🔺)1.191s121.00x
🐘 PostgresNitro1.337s (+2.0%)2.394s (+3.3%)1.057s131.02x
🐘 PostgresNext.js (Turbopack)1.337s (~)3.011s (-3.1%)1.673s101.02x
💻 LocalNitro2.538s (-5.2% 🟢)3.009s (~)0.471s101.93x
💻 LocalExpress2.616s (+2.2%)3.109s (+3.3%)0.493s101.99x
💻 LocalNext.js (Turbopack)2.847s (+4.3%)3.208s (+3.2%)0.361s102.16x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.573s (-3.9%)4.135s (~)2.562s81.00x
🐘 PostgresExpress1.641s (+1.5%)4.014s (-3.0%)2.373s81.04x
🐘 PostgresNext.js (Turbopack)3.370s (+1.1%)6.618s (+10.0% 🔺)3.249s52.14x
💻 LocalNitro6.183s (-6.1% 🟢)7.015s (-2.8%)0.832s53.93x
💻 LocalNext.js (Turbopack)6.571s (+27.7% 🔺)7.217s (+27.1% 🔺)0.646s54.18x
💻 LocalExpress7.391s (+18.0% 🔺)8.019s (+21.3% 🔺)0.629s44.70x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.536s (-2.3%)1.006s (~)0.470s601.00x
💻 LocalExpress0.573s (+2.0%)1.005s (-1.6%)0.433s601.07x
🐘 PostgresNext.js (Turbopack)0.595s (+3.8%)1.008s (~)0.412s601.11x
💻 LocalNext.js (Turbopack)0.601s (+3.4%)1.005s (-1.7%)0.404s601.12x
🐘 PostgresNitro0.602s (+8.4% 🔺)1.077s (+3.5%)0.475s571.12x
💻 LocalNitro0.636s (+16.5% 🔺)1.022s (+1.7%)0.386s591.19x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.275s (-3.7%)2.007s (~)0.732s451.00x
🐘 PostgresExpress1.278s (-3.4%)2.008s (-1.1%)0.729s451.00x
🐘 PostgresNext.js (Turbopack)1.386s (-4.1%)2.007s (-1.1%)0.621s451.09x
💻 LocalNitro1.493s (+7.5% 🔺)2.006s (~)0.513s451.17x
💻 LocalExpress1.511s (+9.3% 🔺)2.051s (+2.3%)0.540s451.19x
💻 LocalNext.js (Turbopack)1.513s (+8.8% 🔺)2.006s (~)0.493s451.19x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.483s (-3.6%)3.033s (-1.7%)0.550s401.00x
🐘 PostgresExpress2.631s (-2.8%)3.085s (-1.7%)0.454s391.06x
🐘 PostgresNext.js (Turbopack)2.803s (~)3.059s (+1.6%)0.255s401.13x
💻 LocalExpress3.229s (+8.8% 🔺)4.010s (+21.3% 🔺)0.781s301.30x
💻 LocalNitro3.255s (+7.5% 🔺)3.945s (+10.6% 🔺)0.690s311.31x
💻 LocalNext.js (Turbopack)3.369s (+9.7% 🔺)4.043s (+9.1% 🔺)0.673s301.36x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.199s (+8.0% 🔺)1.007s (~)0.808s601.00x
🐘 PostgresNitro0.212s (~)1.006s (~)0.794s601.07x
🐘 PostgresExpress0.216s (+3.3%)1.006s (~)0.790s601.09x
💻 LocalNitro0.468s (+1.7%)1.005s (~)0.537s602.35x
💻 LocalExpress0.504s (+18.9% 🔺)1.022s (+1.8%)0.518s592.54x
💻 LocalNext.js (Turbopack)0.635s (+5.7% 🔺)1.005s (~)0.370s603.20x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.309s (~)1.030s (+2.3%)0.720s881.00x
🐘 PostgresNitro0.319s (~)1.006s (~)0.687s901.03x
🐘 PostgresExpress0.331s (+3.8%)1.006s (~)0.675s901.07x
💻 LocalExpress2.083s (-3.4%)2.714s (-0.8%)0.631s346.73x
💻 LocalNitro2.111s (-0.7%)2.656s (-5.0% 🟢)0.545s346.82x
💻 LocalNext.js (Turbopack)2.724s (-2.1%)3.223s (+4.8%)0.499s288.80x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.537s (-1.0%)3.086s (+2.5%)2.549s391.00x
🐘 PostgresExpress0.550s (+5.7% 🔺)1.059s (+1.8%)0.509s1141.03x
🐘 PostgresNitro0.563s (+3.6%)1.136s (+6.4% 🔺)0.574s1081.05x
💻 LocalNext.js (Turbopack)9.793s (-8.7% 🟢)10.699s (-5.3% 🟢)0.906s1218.24x
💻 LocalNitro10.012s (+11.2% 🔺)10.939s (+8.2% 🔺)0.927s1118.64x
💻 LocalExpress10.125s (+8.5% 🔺)11.118s (+6.4% 🔺)0.993s1118.86x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.142s (+0.9%)1.966s (~)0.012s (+16.7% 🔺)2.019s (~)0.877s101.00x
🐘 PostgresNitro1.152s (~)1.997s (~)0.001s (-23.1% 🟢)2.011s (~)0.859s101.01x
💻 LocalExpress1.157s (+1.1%)2.004s (~)0.012s (+28.7% 🔺)2.020s (~)0.862s101.01x
💻 LocalNitro1.160s (+1.8%)2.004s (~)0.012s (+9.3% 🔺)2.019s (~)0.859s101.02x
🐘 PostgresExpress1.161s (-0.6%)2.000s (~)0.001s (-29.4% 🟢)2.011s (~)0.851s101.02x
🐘 PostgresNext.js (Turbopack)1.174s (~)2.001s (~)0.001s (-8.3% 🟢)2.011s (~)0.837s101.03x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.536s (+1.2%)2.010s (~)0.012s (-6.8% 🟢)2.025s (~)0.489s301.00x
🐘 PostgresNitro1.537s (-1.0%)2.002s (~)0.005s (+8.8% 🔺)2.026s (~)0.489s301.00x
💻 LocalNitro1.544s (+1.9%)2.010s (~)0.012s (-3.3%)2.025s (~)0.481s301.01x
💻 LocalNext.js (Turbopack)1.576s (+3.3%)1.970s (~)0.014s (~)2.027s (~)0.451s301.03x
🐘 PostgresExpress1.577s (-2.6%)2.006s (-1.5%)0.005s (+9.1% 🔺)2.026s (-1.7%)0.449s301.03x
🐘 PostgresNext.js (Turbopack)1.658s (+2.2%)2.017s (~)0.005s (~)2.034s (~)0.376s301.08x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.749s (-3.5%)1.062s (-1.5%)0.000s (+Infinity% 🔺)1.078s (-2.5%)0.329s561.00x
🐘 PostgresExpress0.758s (-6.9% 🟢)1.028s (-6.7% 🟢)0.000s (+Infinity% 🔺)1.050s (-6.1% 🟢)0.292s581.01x
🐘 PostgresNext.js (Turbopack)0.977s (-5.7% 🟢)1.354s (-5.2% 🟢)0.000s (NaN%)1.372s (-4.5%)0.395s451.30x
💻 LocalNitro1.256s (-1.2%)1.980s (+1.7%)0.000s (+85.7% 🔺)1.983s (+1.7%)0.728s311.68x
💻 LocalExpress1.262s (-1.1%)1.948s (-3.1%)0.000s (+10.6% 🔺)1.950s (-3.2%)0.689s311.68x
💻 LocalNext.js (Turbopack)1.392s (+5.0% 🔺)1.979s (~)0.001s (+400.0% 🔺)2.017s (~)0.624s301.86x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.674s (-3.8%)2.253s (-3.7%)0.000s (+Infinity% 🔺)2.269s (-4.4%)0.595s271.00x
🐘 PostgresNitro1.809s (+5.1% 🔺)2.435s (+4.1%)0.000s (+Infinity% 🔺)2.450s (+4.0%)0.641s251.08x
🐘 PostgresNext.js (Turbopack)2.411s (-8.1% 🟢)2.952s (-6.6% 🟢)0.000s (-100.0% 🟢)2.962s (-6.5% 🟢)0.551s211.44x
💻 LocalExpress3.435s (+8.5% 🔺)4.093s (+9.8% 🔺)0.001s (-11.0% 🟢)4.097s (+9.8% 🔺)0.661s152.05x
💻 LocalNext.js (Turbopack)3.453s (+8.5% 🔺)3.989s (+11.6% 🔺)0.001s (-49.6% 🟢)4.032s (+11.4% 🔺)0.578s152.06x
💻 LocalNitro3.642s (+3.5%)4.092s (-3.2%)0.001s (+70.0% 🔺)4.099s (-3.1%)0.458s152.17x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress11/21
🐘 PostgresNitro12/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres14/21
Next.js (Turbopack)🐘 Postgres15/21
Nitro🐘 Postgres18/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)
  • 🌐 Platformatic: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

…-vercel)
world-vercel installs the global `require` shim itself (and falls back to H1
when node:http2 is unreachable), so the per-bundler banners in the nitro and
sveltekit integrations are redundant. Remove them; their e2e-vercel-prod lanes
(nitro, vite, tanstack-start via nitro; sveltekit) now validate that
world-vercel's built-in shim carries those bundles on its own.
The @workflow/web banner is intentionally kept for now — workflow-web has no
e2e coverage, so it stays as belt-and-suspenders until a deployed-web smoke
test exists.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the load-time `node:http2` capability probe (which checked
`globalThis.require`, the wrong binding — it false-positives in bundlers like
nitro/rollup where undici's `require` is a tool-injected per-chunk binding the
global never reaches, so it kept H2 on and still hung) with a runtime fallback.
`fetchWithH2Fallback(path, ...)` issues the request over the H2 dispatcher and,
on the bundling failure signature (`http2.connect is not a function` —
detected via `isHttp2ConnectUnavailableError`), retries the same request on an
HTTP/1.1 dispatcher and latches the downgrade process-wide so later requests
skip the dead H2 attempt and its ~16s connect-retry backoff. The connect
failure is pre-send, so the replay is safe even for the non-idempotent stream
writes; the stream fallback preserves STREAM_RETRY_OPTIONS (never retries 5xx).
This recovers regardless of how the bundler bound undici's `require`, unlike
the probe. Layer A (the global `require` self-install) stays as a best-effort
H2 preserver; the framework banners remain for full H2 perf where we ship a
builder. Routes v4 events and stream write/close through the new helper.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@VaguelySeriousVaguelySerious changed the title [world-vercel] Best-effort HTTP/2 bundling backstop (global require + H1 fallback)[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM serversJun 26, 2026
Sign up for freeto 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

@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' [world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers by VaguelySerious · Pull Request #2633 · vercel/workflow · GitHub
Skip to content

[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers - #2633

Open
VaguelySerious wants to merge 4 commits into
mainfrom
peter/world-vercel-h2-resilient
Open

[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers#2633
VaguelySerious wants to merge 4 commits into
mainfrom
peter/world-vercel-h2-resilient

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problem

When @workflow/world-vercel is bundled into an ESM server output (a custom Vite/Rollup/esbuild build, or a framework integration that doesn't externalize undici), undici's lazy require('node:http2') can be left un-wired. undici swallows the failure and falls back to a stub whose http2.connect is undefined, so the first HTTP/2 connect throws http2.connect is not a function — surfacing (after undici's ~16s connect-retry backoff) as a failed request. On the events/stream H2 paths this silently breaks observability reads (and stream writes) for any such consumer.

What this does

A runtime HTTP/2 → HTTP/1.1 fallback, plus a best-effort H2 preserver:

  • fetchWithH2Fallback(path, …) issues the request over the H2 dispatcher and, on the bundling failure signature (isHttp2ConnectUnavailableError), retries the same request on an HTTP/1.1 dispatcher and latches the downgrade process-wide so later requests skip the dead H2 attempt and its ~16s backoff. The connect failure is pre-send, so replaying is safe even for the non-idempotent stream writes — and the stream fallback preserves STREAM_RETRY_OPTIONS (never retries 5xx). v4 events and stream write/close now route through this helper.
  • Layer A (global require self-install) stays as a best-effort H2 preserver: where undici's bundled require is a free identifier it restores real H2; where it isn't (notably nitro/rollup per-chunk bindings) the runtime fallback covers correctness.

Why the previous load-time probe was replaced

The earlier approach probed globalThis.require('node:http2') at load time to decide whether to keep H2. That checks the wrong binding: in bundlers like nitro/rollup undici's require resolves to a tool-injected per-chunk binding the global never reaches, so the probe false-positived (saw H2 "available", kept allowH2: true) and the request still hung. The runtime fallback triggers on the actual connect failure, so it recovers regardless of how the bundler bound undici's require.

The framework build banners (@workflow/sveltekit, @workflow/nitro, @workflow/web) remain the way to keep full H2 performance in the bundlers we ship a builder for; this is the correctness catch-all for consumers we don't.

Verification

  • Full @workflow/world-vercel suite green (182 tests), typecheck + lint clean.
  • New unit tests: isHttp2ConnectUnavailableError signature matching (incl. minified .connect, non-match on ECONNREFUSED/unrelated/nullish); fetchWithH2Fallback retry-on-distinct-H1-dispatcher, downgrade latching, stream-policy preservation, non-H2 rethrow, override-verbatim.
  • End-to-end against real undici: forced undici onto the stub path (http2.connect = undefined) against a dual h1/h2 server — fetchWithH2Fallback('events', …) returns 200 over HTTP/1.1 after the H2 backoff (call update docs sidebar to auto expand #1 ~15.6s), and call Home tweaks #2 is ~9ms (latched to H1).

🤖 Generated with Claude Code

… fallback)
undici loads node:http2 lazily via a bare require('node:http2'). When
world-vercel is bundled into an ESM server (a custom Vite/Rollup/esbuild build,
or any consumer that doesn't externalize undici), there is no require in scope:
the call throws, undici falls back to a stub with no http2.connect, and every
HTTP/2 request (the events API + stream writes) hangs on a dead connection
through RetryAgent's backoff (~16s) then fails. Framework integrations have been
patching this one bundler at a time with a build banner; a custom or third-party
bundled consumer gets no protection.
Move the defense into the package itself, two layers:
A. Install a working `globalThis.require` (createRequire-backed) at module load
so undici's bare require resolves the real node:http2 regardless of how a
consumer bundles us. Guarded to a no-op wherever a real require already
exists.
B. Detect whether node:http2 is actually usable and, if not, build the H2
dispatchers with allowH2:false and warn once — so requests degrade to working
HTTP/1.1 instead of silently failing.
Exports isHttp2Available() and shouldFallBackToH1() with unit coverage,
including a simulated bundled-undici stub (http2 without connect).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6988e7f

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

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production144202301672
✅ 💻 Local Development160502191824
✅ 📦 Local Production160502191824
✅ 🐘 Local Postgres159302311824
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7282010788360

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nextjs-turbopack14903
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.047s (-2.5%)1.007s (~)0.960s101.00x
💻 LocalExpress0.048s (+3.2%)1.005s (~)0.957s101.03x
💻 LocalNext.js (Turbopack)0.049s (+0.8%)1.007s (~)0.958s101.05x
🐘 PostgresNext.js (Turbopack)0.065s (+5.5% 🔺)1.013s (~)0.948s101.39x
🐘 PostgresNitro0.070s (+9.9% 🔺)1.012s (~)0.942s101.49x
🐘 PostgresExpress0.076s (+15.6% 🔺)1.012s (~)0.936s101.63x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.082s (~)2.006s (~)0.924s101.00x
💻 LocalNitro1.082s (~)2.007s (~)0.925s101.00x
💻 LocalNext.js (Turbopack)1.086s (+0.6%)2.006s (~)0.920s101.00x
🐘 PostgresNitro1.094s (~)2.009s (~)0.915s101.01x
🐘 PostgresExpress1.098s (~)2.012s (~)0.913s101.02x
🐘 PostgresNext.js (Turbopack)1.101s (-0.5%)2.010s (~)0.909s101.02x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.437s (~)11.023s (~)0.586s31.00x
🐘 PostgresNitro10.440s (~)11.012s (~)0.572s31.00x
💻 LocalNitro10.459s (~)11.022s (~)0.563s31.00x
💻 LocalNext.js (Turbopack)10.462s (~)11.022s (~)0.560s31.00x
🐘 PostgresExpress10.476s (~)11.019s (~)0.543s31.00x
🐘 PostgresNext.js (Turbopack)10.556s (~)11.024s (~)0.468s31.01x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro13.544s (~)14.019s (~)0.474s51.00x
💻 LocalExpress13.588s (~)14.028s (~)0.440s51.00x
💻 LocalNitro13.631s (~)14.027s (~)0.397s51.01x
🐘 PostgresExpress13.674s (-1.1%)14.019s (~)0.345s51.01x
🐘 PostgresNext.js (Turbopack)13.759s (~)14.025s (~)0.266s51.02x
💻 LocalNext.js (Turbopack)13.775s (+0.9%)14.027s (~)0.252s51.02x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express12.134s (~)13.025s (~)0.891s71.00x
🐘 PostgresExpress12.213s (~)13.017s (~)0.805s71.01x
💻 LocalNext.js (Turbopack)12.354s (+1.6%)13.024s (~)0.671s71.02x
💻 LocalNitro12.406s (+2.3%)13.024s (~)0.618s71.02x
🐘 PostgresNitro12.498s (+2.8%)13.159s (+1.1%)0.661s71.03x
🐘 PostgresNext.js (Turbopack)12.503s (+0.7%)13.020s (~)0.517s71.03x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.165s (-1.4%)2.008s (~)0.843s151.00x
🐘 PostgresExpress1.176s (~)2.007s (~)0.831s151.01x
🐘 PostgresNext.js (Turbopack)1.211s (~)2.011s (~)0.800s151.04x
💻 LocalNitro1.400s (~)2.006s (~)0.607s151.20x
💻 LocalExpress1.438s (+3.2%)2.006s (~)0.568s151.23x
💻 LocalNext.js (Turbopack)1.454s (-2.2%)2.007s (-3.2%)0.552s151.25x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.282s (-2.9%)2.316s (-7.7% 🟢)1.034s131.00x
🐘 PostgresNext.js (Turbopack)1.337s (-0.6%)3.110s (+3.3%)1.772s101.04x
🐘 PostgresExpress1.386s (+4.0%)2.737s (+14.4% 🔺)1.351s111.08x
💻 LocalExpress2.576s (+4.1%)3.009s (~)0.433s102.01x
💻 LocalNitro2.592s (+2.7%)2.917s (-3.0%)0.325s112.02x
💻 LocalNext.js (Turbopack)2.657s (+3.4%)3.109s (+3.3%)0.451s102.07x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.558s (-3.6%)4.010s (~)2.452s81.00x
🐘 PostgresExpress1.634s (~)4.136s (-3.8%)2.502s81.05x
🐘 PostgresNext.js (Turbopack)3.567s (+41.5% 🔺)8.529s (+54.7% 🔺)4.962s42.29x
💻 LocalNitro6.142s (+18.3% 🔺)6.620s (+13.2% 🔺)0.477s53.94x
💻 LocalExpress6.758s (+23.9% 🔺)7.217s (+16.1% 🔺)0.459s54.34x
💻 LocalNext.js (Turbopack)8.060s (+16.4% 🔺)8.769s (+18.2% 🔺)0.709s45.17x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.177s (-0.7%)2.008s (~)0.831s151.00x
🐘 PostgresNext.js (Turbopack)1.203s (-1.1%)2.009s (~)0.806s151.02x
🐘 PostgresNitro1.301s (+10.2% 🔺)2.074s (+3.3%)0.773s151.10x
💻 LocalExpress1.411s (+2.3%)2.007s (~)0.595s151.20x
💻 LocalNitro1.436s (-0.9%)2.007s (~)0.571s151.22x
💻 LocalNext.js (Turbopack)1.470s (+2.7%)2.007s (~)0.537s151.25x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.317s (~)2.508s (+12.8% 🔺)1.191s121.00x
🐘 PostgresNitro1.337s (+2.0%)2.394s (+3.3%)1.057s131.02x
🐘 PostgresNext.js (Turbopack)1.337s (~)3.011s (-3.1%)1.673s101.02x
💻 LocalNitro2.538s (-5.2% 🟢)3.009s (~)0.471s101.93x
💻 LocalExpress2.616s (+2.2%)3.109s (+3.3%)0.493s101.99x
💻 LocalNext.js (Turbopack)2.847s (+4.3%)3.208s (+3.2%)0.361s102.16x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.573s (-3.9%)4.135s (~)2.562s81.00x
🐘 PostgresExpress1.641s (+1.5%)4.014s (-3.0%)2.373s81.04x
🐘 PostgresNext.js (Turbopack)3.370s (+1.1%)6.618s (+10.0% 🔺)3.249s52.14x
💻 LocalNitro6.183s (-6.1% 🟢)7.015s (-2.8%)0.832s53.93x
💻 LocalNext.js (Turbopack)6.571s (+27.7% 🔺)7.217s (+27.1% 🔺)0.646s54.18x
💻 LocalExpress7.391s (+18.0% 🔺)8.019s (+21.3% 🔺)0.629s44.70x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.536s (-2.3%)1.006s (~)0.470s601.00x
💻 LocalExpress0.573s (+2.0%)1.005s (-1.6%)0.433s601.07x
🐘 PostgresNext.js (Turbopack)0.595s (+3.8%)1.008s (~)0.412s601.11x
💻 LocalNext.js (Turbopack)0.601s (+3.4%)1.005s (-1.7%)0.404s601.12x
🐘 PostgresNitro0.602s (+8.4% 🔺)1.077s (+3.5%)0.475s571.12x
💻 LocalNitro0.636s (+16.5% 🔺)1.022s (+1.7%)0.386s591.19x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.275s (-3.7%)2.007s (~)0.732s451.00x
🐘 PostgresExpress1.278s (-3.4%)2.008s (-1.1%)0.729s451.00x
🐘 PostgresNext.js (Turbopack)1.386s (-4.1%)2.007s (-1.1%)0.621s451.09x
💻 LocalNitro1.493s (+7.5% 🔺)2.006s (~)0.513s451.17x
💻 LocalExpress1.511s (+9.3% 🔺)2.051s (+2.3%)0.540s451.19x
💻 LocalNext.js (Turbopack)1.513s (+8.8% 🔺)2.006s (~)0.493s451.19x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.483s (-3.6%)3.033s (-1.7%)0.550s401.00x
🐘 PostgresExpress2.631s (-2.8%)3.085s (-1.7%)0.454s391.06x
🐘 PostgresNext.js (Turbopack)2.803s (~)3.059s (+1.6%)0.255s401.13x
💻 LocalExpress3.229s (+8.8% 🔺)4.010s (+21.3% 🔺)0.781s301.30x
💻 LocalNitro3.255s (+7.5% 🔺)3.945s (+10.6% 🔺)0.690s311.31x
💻 LocalNext.js (Turbopack)3.369s (+9.7% 🔺)4.043s (+9.1% 🔺)0.673s301.36x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.199s (+8.0% 🔺)1.007s (~)0.808s601.00x
🐘 PostgresNitro0.212s (~)1.006s (~)0.794s601.07x
🐘 PostgresExpress0.216s (+3.3%)1.006s (~)0.790s601.09x
💻 LocalNitro0.468s (+1.7%)1.005s (~)0.537s602.35x
💻 LocalExpress0.504s (+18.9% 🔺)1.022s (+1.8%)0.518s592.54x
💻 LocalNext.js (Turbopack)0.635s (+5.7% 🔺)1.005s (~)0.370s603.20x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.309s (~)1.030s (+2.3%)0.720s881.00x
🐘 PostgresNitro0.319s (~)1.006s (~)0.687s901.03x
🐘 PostgresExpress0.331s (+3.8%)1.006s (~)0.675s901.07x
💻 LocalExpress2.083s (-3.4%)2.714s (-0.8%)0.631s346.73x
💻 LocalNitro2.111s (-0.7%)2.656s (-5.0% 🟢)0.545s346.82x
💻 LocalNext.js (Turbopack)2.724s (-2.1%)3.223s (+4.8%)0.499s288.80x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.537s (-1.0%)3.086s (+2.5%)2.549s391.00x
🐘 PostgresExpress0.550s (+5.7% 🔺)1.059s (+1.8%)0.509s1141.03x
🐘 PostgresNitro0.563s (+3.6%)1.136s (+6.4% 🔺)0.574s1081.05x
💻 LocalNext.js (Turbopack)9.793s (-8.7% 🟢)10.699s (-5.3% 🟢)0.906s1218.24x
💻 LocalNitro10.012s (+11.2% 🔺)10.939s (+8.2% 🔺)0.927s1118.64x
💻 LocalExpress10.125s (+8.5% 🔺)11.118s (+6.4% 🔺)0.993s1118.86x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.142s (+0.9%)1.966s (~)0.012s (+16.7% 🔺)2.019s (~)0.877s101.00x
🐘 PostgresNitro1.152s (~)1.997s (~)0.001s (-23.1% 🟢)2.011s (~)0.859s101.01x
💻 LocalExpress1.157s (+1.1%)2.004s (~)0.012s (+28.7% 🔺)2.020s (~)0.862s101.01x
💻 LocalNitro1.160s (+1.8%)2.004s (~)0.012s (+9.3% 🔺)2.019s (~)0.859s101.02x
🐘 PostgresExpress1.161s (-0.6%)2.000s (~)0.001s (-29.4% 🟢)2.011s (~)0.851s101.02x
🐘 PostgresNext.js (Turbopack)1.174s (~)2.001s (~)0.001s (-8.3% 🟢)2.011s (~)0.837s101.03x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.536s (+1.2%)2.010s (~)0.012s (-6.8% 🟢)2.025s (~)0.489s301.00x
🐘 PostgresNitro1.537s (-1.0%)2.002s (~)0.005s (+8.8% 🔺)2.026s (~)0.489s301.00x
💻 LocalNitro1.544s (+1.9%)2.010s (~)0.012s (-3.3%)2.025s (~)0.481s301.01x
💻 LocalNext.js (Turbopack)1.576s (+3.3%)1.970s (~)0.014s (~)2.027s (~)0.451s301.03x
🐘 PostgresExpress1.577s (-2.6%)2.006s (-1.5%)0.005s (+9.1% 🔺)2.026s (-1.7%)0.449s301.03x
🐘 PostgresNext.js (Turbopack)1.658s (+2.2%)2.017s (~)0.005s (~)2.034s (~)0.376s301.08x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.749s (-3.5%)1.062s (-1.5%)0.000s (+Infinity% 🔺)1.078s (-2.5%)0.329s561.00x
🐘 PostgresExpress0.758s (-6.9% 🟢)1.028s (-6.7% 🟢)0.000s (+Infinity% 🔺)1.050s (-6.1% 🟢)0.292s581.01x
🐘 PostgresNext.js (Turbopack)0.977s (-5.7% 🟢)1.354s (-5.2% 🟢)0.000s (NaN%)1.372s (-4.5%)0.395s451.30x
💻 LocalNitro1.256s (-1.2%)1.980s (+1.7%)0.000s (+85.7% 🔺)1.983s (+1.7%)0.728s311.68x
💻 LocalExpress1.262s (-1.1%)1.948s (-3.1%)0.000s (+10.6% 🔺)1.950s (-3.2%)0.689s311.68x
💻 LocalNext.js (Turbopack)1.392s (+5.0% 🔺)1.979s (~)0.001s (+400.0% 🔺)2.017s (~)0.624s301.86x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.674s (-3.8%)2.253s (-3.7%)0.000s (+Infinity% 🔺)2.269s (-4.4%)0.595s271.00x
🐘 PostgresNitro1.809s (+5.1% 🔺)2.435s (+4.1%)0.000s (+Infinity% 🔺)2.450s (+4.0%)0.641s251.08x
🐘 PostgresNext.js (Turbopack)2.411s (-8.1% 🟢)2.952s (-6.6% 🟢)0.000s (-100.0% 🟢)2.962s (-6.5% 🟢)0.551s211.44x
💻 LocalExpress3.435s (+8.5% 🔺)4.093s (+9.8% 🔺)0.001s (-11.0% 🟢)4.097s (+9.8% 🔺)0.661s152.05x
💻 LocalNext.js (Turbopack)3.453s (+8.5% 🔺)3.989s (+11.6% 🔺)0.001s (-49.6% 🟢)4.032s (+11.4% 🔺)0.578s152.06x
💻 LocalNitro3.642s (+3.5%)4.092s (-3.2%)0.001s (+70.0% 🔺)4.099s (-3.1%)0.458s152.17x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress11/21
🐘 PostgresNitro12/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres14/21
Next.js (Turbopack)🐘 Postgres15/21
Nitro🐘 Postgres18/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)
  • 🌐 Platformatic: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

…-vercel)
world-vercel installs the global `require` shim itself (and falls back to H1
when node:http2 is unreachable), so the per-bundler banners in the nitro and
sveltekit integrations are redundant. Remove them; their e2e-vercel-prod lanes
(nitro, vite, tanstack-start via nitro; sveltekit) now validate that
world-vercel's built-in shim carries those bundles on its own.
The @workflow/web banner is intentionally kept for now — workflow-web has no
e2e coverage, so it stays as belt-and-suspenders until a deployed-web smoke
test exists.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the load-time `node:http2` capability probe (which checked
`globalThis.require`, the wrong binding — it false-positives in bundlers like
nitro/rollup where undici's `require` is a tool-injected per-chunk binding the
global never reaches, so it kept H2 on and still hung) with a runtime fallback.
`fetchWithH2Fallback(path, ...)` issues the request over the H2 dispatcher and,
on the bundling failure signature (`http2.connect is not a function` —
detected via `isHttp2ConnectUnavailableError`), retries the same request on an
HTTP/1.1 dispatcher and latches the downgrade process-wide so later requests
skip the dead H2 attempt and its ~16s connect-retry backoff. The connect
failure is pre-send, so the replay is safe even for the non-idempotent stream
writes; the stream fallback preserves STREAM_RETRY_OPTIONS (never retries 5xx).
This recovers regardless of how the bundler bound undici's `require`, unlike
the probe. Layer A (the global `require` self-install) stays as a best-effort
H2 preserver; the framework banners remain for full H2 perf where we ship a
builder. Routes v4 events and stream write/close through the new helper.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@VaguelySeriousVaguelySerious changed the title [world-vercel] Best-effort HTTP/2 bundling backstop (global require + H1 fallback)[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM serversJun 26, 2026
Sign up for freeto 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

@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' [world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers by VaguelySerious · Pull Request #2633 · vercel/workflow · GitHub
Skip to content

[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers - #2633

Open
VaguelySerious wants to merge 4 commits into
mainfrom
peter/world-vercel-h2-resilient
Open

[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers#2633
VaguelySerious wants to merge 4 commits into
mainfrom
peter/world-vercel-h2-resilient

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problem

When @workflow/world-vercel is bundled into an ESM server output (a custom Vite/Rollup/esbuild build, or a framework integration that doesn't externalize undici), undici's lazy require('node:http2') can be left un-wired. undici swallows the failure and falls back to a stub whose http2.connect is undefined, so the first HTTP/2 connect throws http2.connect is not a function — surfacing (after undici's ~16s connect-retry backoff) as a failed request. On the events/stream H2 paths this silently breaks observability reads (and stream writes) for any such consumer.

What this does

A runtime HTTP/2 → HTTP/1.1 fallback, plus a best-effort H2 preserver:

  • fetchWithH2Fallback(path, …) issues the request over the H2 dispatcher and, on the bundling failure signature (isHttp2ConnectUnavailableError), retries the same request on an HTTP/1.1 dispatcher and latches the downgrade process-wide so later requests skip the dead H2 attempt and its ~16s backoff. The connect failure is pre-send, so replaying is safe even for the non-idempotent stream writes — and the stream fallback preserves STREAM_RETRY_OPTIONS (never retries 5xx). v4 events and stream write/close now route through this helper.
  • Layer A (global require self-install) stays as a best-effort H2 preserver: where undici's bundled require is a free identifier it restores real H2; where it isn't (notably nitro/rollup per-chunk bindings) the runtime fallback covers correctness.

Why the previous load-time probe was replaced

The earlier approach probed globalThis.require('node:http2') at load time to decide whether to keep H2. That checks the wrong binding: in bundlers like nitro/rollup undici's require resolves to a tool-injected per-chunk binding the global never reaches, so the probe false-positived (saw H2 "available", kept allowH2: true) and the request still hung. The runtime fallback triggers on the actual connect failure, so it recovers regardless of how the bundler bound undici's require.

The framework build banners (@workflow/sveltekit, @workflow/nitro, @workflow/web) remain the way to keep full H2 performance in the bundlers we ship a builder for; this is the correctness catch-all for consumers we don't.

Verification

  • Full @workflow/world-vercel suite green (182 tests), typecheck + lint clean.
  • New unit tests: isHttp2ConnectUnavailableError signature matching (incl. minified .connect, non-match on ECONNREFUSED/unrelated/nullish); fetchWithH2Fallback retry-on-distinct-H1-dispatcher, downgrade latching, stream-policy preservation, non-H2 rethrow, override-verbatim.
  • End-to-end against real undici: forced undici onto the stub path (http2.connect = undefined) against a dual h1/h2 server — fetchWithH2Fallback('events', …) returns 200 over HTTP/1.1 after the H2 backoff (call update docs sidebar to auto expand #1 ~15.6s), and call Home tweaks #2 is ~9ms (latched to H1).

🤖 Generated with Claude Code

… fallback)
undici loads node:http2 lazily via a bare require('node:http2'). When
world-vercel is bundled into an ESM server (a custom Vite/Rollup/esbuild build,
or any consumer that doesn't externalize undici), there is no require in scope:
the call throws, undici falls back to a stub with no http2.connect, and every
HTTP/2 request (the events API + stream writes) hangs on a dead connection
through RetryAgent's backoff (~16s) then fails. Framework integrations have been
patching this one bundler at a time with a build banner; a custom or third-party
bundled consumer gets no protection.
Move the defense into the package itself, two layers:
A. Install a working `globalThis.require` (createRequire-backed) at module load
so undici's bare require resolves the real node:http2 regardless of how a
consumer bundles us. Guarded to a no-op wherever a real require already
exists.
B. Detect whether node:http2 is actually usable and, if not, build the H2
dispatchers with allowH2:false and warn once — so requests degrade to working
HTTP/1.1 instead of silently failing.
Exports isHttp2Available() and shouldFallBackToH1() with unit coverage,
including a simulated bundled-undici stub (http2 without connect).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6988e7f

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

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production144202301672
✅ 💻 Local Development160502191824
✅ 📦 Local Production160502191824
✅ 🐘 Local Postgres159302311824
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7282010788360

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nextjs-turbopack14903
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.047s (-2.5%)1.007s (~)0.960s101.00x
💻 LocalExpress0.048s (+3.2%)1.005s (~)0.957s101.03x
💻 LocalNext.js (Turbopack)0.049s (+0.8%)1.007s (~)0.958s101.05x
🐘 PostgresNext.js (Turbopack)0.065s (+5.5% 🔺)1.013s (~)0.948s101.39x
🐘 PostgresNitro0.070s (+9.9% 🔺)1.012s (~)0.942s101.49x
🐘 PostgresExpress0.076s (+15.6% 🔺)1.012s (~)0.936s101.63x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.082s (~)2.006s (~)0.924s101.00x
💻 LocalNitro1.082s (~)2.007s (~)0.925s101.00x
💻 LocalNext.js (Turbopack)1.086s (+0.6%)2.006s (~)0.920s101.00x
🐘 PostgresNitro1.094s (~)2.009s (~)0.915s101.01x
🐘 PostgresExpress1.098s (~)2.012s (~)0.913s101.02x
🐘 PostgresNext.js (Turbopack)1.101s (-0.5%)2.010s (~)0.909s101.02x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.437s (~)11.023s (~)0.586s31.00x
🐘 PostgresNitro10.440s (~)11.012s (~)0.572s31.00x
💻 LocalNitro10.459s (~)11.022s (~)0.563s31.00x
💻 LocalNext.js (Turbopack)10.462s (~)11.022s (~)0.560s31.00x
🐘 PostgresExpress10.476s (~)11.019s (~)0.543s31.00x
🐘 PostgresNext.js (Turbopack)10.556s (~)11.024s (~)0.468s31.01x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro13.544s (~)14.019s (~)0.474s51.00x
💻 LocalExpress13.588s (~)14.028s (~)0.440s51.00x
💻 LocalNitro13.631s (~)14.027s (~)0.397s51.01x
🐘 PostgresExpress13.674s (-1.1%)14.019s (~)0.345s51.01x
🐘 PostgresNext.js (Turbopack)13.759s (~)14.025s (~)0.266s51.02x
💻 LocalNext.js (Turbopack)13.775s (+0.9%)14.027s (~)0.252s51.02x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express12.134s (~)13.025s (~)0.891s71.00x
🐘 PostgresExpress12.213s (~)13.017s (~)0.805s71.01x
💻 LocalNext.js (Turbopack)12.354s (+1.6%)13.024s (~)0.671s71.02x
💻 LocalNitro12.406s (+2.3%)13.024s (~)0.618s71.02x
🐘 PostgresNitro12.498s (+2.8%)13.159s (+1.1%)0.661s71.03x
🐘 PostgresNext.js (Turbopack)12.503s (+0.7%)13.020s (~)0.517s71.03x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.165s (-1.4%)2.008s (~)0.843s151.00x
🐘 PostgresExpress1.176s (~)2.007s (~)0.831s151.01x
🐘 PostgresNext.js (Turbopack)1.211s (~)2.011s (~)0.800s151.04x
💻 LocalNitro1.400s (~)2.006s (~)0.607s151.20x
💻 LocalExpress1.438s (+3.2%)2.006s (~)0.568s151.23x
💻 LocalNext.js (Turbopack)1.454s (-2.2%)2.007s (-3.2%)0.552s151.25x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.282s (-2.9%)2.316s (-7.7% 🟢)1.034s131.00x
🐘 PostgresNext.js (Turbopack)1.337s (-0.6%)3.110s (+3.3%)1.772s101.04x
🐘 PostgresExpress1.386s (+4.0%)2.737s (+14.4% 🔺)1.351s111.08x
💻 LocalExpress2.576s (+4.1%)3.009s (~)0.433s102.01x
💻 LocalNitro2.592s (+2.7%)2.917s (-3.0%)0.325s112.02x
💻 LocalNext.js (Turbopack)2.657s (+3.4%)3.109s (+3.3%)0.451s102.07x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.558s (-3.6%)4.010s (~)2.452s81.00x
🐘 PostgresExpress1.634s (~)4.136s (-3.8%)2.502s81.05x
🐘 PostgresNext.js (Turbopack)3.567s (+41.5% 🔺)8.529s (+54.7% 🔺)4.962s42.29x
💻 LocalNitro6.142s (+18.3% 🔺)6.620s (+13.2% 🔺)0.477s53.94x
💻 LocalExpress6.758s (+23.9% 🔺)7.217s (+16.1% 🔺)0.459s54.34x
💻 LocalNext.js (Turbopack)8.060s (+16.4% 🔺)8.769s (+18.2% 🔺)0.709s45.17x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.177s (-0.7%)2.008s (~)0.831s151.00x
🐘 PostgresNext.js (Turbopack)1.203s (-1.1%)2.009s (~)0.806s151.02x
🐘 PostgresNitro1.301s (+10.2% 🔺)2.074s (+3.3%)0.773s151.10x
💻 LocalExpress1.411s (+2.3%)2.007s (~)0.595s151.20x
💻 LocalNitro1.436s (-0.9%)2.007s (~)0.571s151.22x
💻 LocalNext.js (Turbopack)1.470s (+2.7%)2.007s (~)0.537s151.25x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.317s (~)2.508s (+12.8% 🔺)1.191s121.00x
🐘 PostgresNitro1.337s (+2.0%)2.394s (+3.3%)1.057s131.02x
🐘 PostgresNext.js (Turbopack)1.337s (~)3.011s (-3.1%)1.673s101.02x
💻 LocalNitro2.538s (-5.2% 🟢)3.009s (~)0.471s101.93x
💻 LocalExpress2.616s (+2.2%)3.109s (+3.3%)0.493s101.99x
💻 LocalNext.js (Turbopack)2.847s (+4.3%)3.208s (+3.2%)0.361s102.16x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.573s (-3.9%)4.135s (~)2.562s81.00x
🐘 PostgresExpress1.641s (+1.5%)4.014s (-3.0%)2.373s81.04x
🐘 PostgresNext.js (Turbopack)3.370s (+1.1%)6.618s (+10.0% 🔺)3.249s52.14x
💻 LocalNitro6.183s (-6.1% 🟢)7.015s (-2.8%)0.832s53.93x
💻 LocalNext.js (Turbopack)6.571s (+27.7% 🔺)7.217s (+27.1% 🔺)0.646s54.18x
💻 LocalExpress7.391s (+18.0% 🔺)8.019s (+21.3% 🔺)0.629s44.70x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.536s (-2.3%)1.006s (~)0.470s601.00x
💻 LocalExpress0.573s (+2.0%)1.005s (-1.6%)0.433s601.07x
🐘 PostgresNext.js (Turbopack)0.595s (+3.8%)1.008s (~)0.412s601.11x
💻 LocalNext.js (Turbopack)0.601s (+3.4%)1.005s (-1.7%)0.404s601.12x
🐘 PostgresNitro0.602s (+8.4% 🔺)1.077s (+3.5%)0.475s571.12x
💻 LocalNitro0.636s (+16.5% 🔺)1.022s (+1.7%)0.386s591.19x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.275s (-3.7%)2.007s (~)0.732s451.00x
🐘 PostgresExpress1.278s (-3.4%)2.008s (-1.1%)0.729s451.00x
🐘 PostgresNext.js (Turbopack)1.386s (-4.1%)2.007s (-1.1%)0.621s451.09x
💻 LocalNitro1.493s (+7.5% 🔺)2.006s (~)0.513s451.17x
💻 LocalExpress1.511s (+9.3% 🔺)2.051s (+2.3%)0.540s451.19x
💻 LocalNext.js (Turbopack)1.513s (+8.8% 🔺)2.006s (~)0.493s451.19x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.483s (-3.6%)3.033s (-1.7%)0.550s401.00x
🐘 PostgresExpress2.631s (-2.8%)3.085s (-1.7%)0.454s391.06x
🐘 PostgresNext.js (Turbopack)2.803s (~)3.059s (+1.6%)0.255s401.13x
💻 LocalExpress3.229s (+8.8% 🔺)4.010s (+21.3% 🔺)0.781s301.30x
💻 LocalNitro3.255s (+7.5% 🔺)3.945s (+10.6% 🔺)0.690s311.31x
💻 LocalNext.js (Turbopack)3.369s (+9.7% 🔺)4.043s (+9.1% 🔺)0.673s301.36x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.199s (+8.0% 🔺)1.007s (~)0.808s601.00x
🐘 PostgresNitro0.212s (~)1.006s (~)0.794s601.07x
🐘 PostgresExpress0.216s (+3.3%)1.006s (~)0.790s601.09x
💻 LocalNitro0.468s (+1.7%)1.005s (~)0.537s602.35x
💻 LocalExpress0.504s (+18.9% 🔺)1.022s (+1.8%)0.518s592.54x
💻 LocalNext.js (Turbopack)0.635s (+5.7% 🔺)1.005s (~)0.370s603.20x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.309s (~)1.030s (+2.3%)0.720s881.00x
🐘 PostgresNitro0.319s (~)1.006s (~)0.687s901.03x
🐘 PostgresExpress0.331s (+3.8%)1.006s (~)0.675s901.07x
💻 LocalExpress2.083s (-3.4%)2.714s (-0.8%)0.631s346.73x
💻 LocalNitro2.111s (-0.7%)2.656s (-5.0% 🟢)0.545s346.82x
💻 LocalNext.js (Turbopack)2.724s (-2.1%)3.223s (+4.8%)0.499s288.80x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.537s (-1.0%)3.086s (+2.5%)2.549s391.00x
🐘 PostgresExpress0.550s (+5.7% 🔺)1.059s (+1.8%)0.509s1141.03x
🐘 PostgresNitro0.563s (+3.6%)1.136s (+6.4% 🔺)0.574s1081.05x
💻 LocalNext.js (Turbopack)9.793s (-8.7% 🟢)10.699s (-5.3% 🟢)0.906s1218.24x
💻 LocalNitro10.012s (+11.2% 🔺)10.939s (+8.2% 🔺)0.927s1118.64x
💻 LocalExpress10.125s (+8.5% 🔺)11.118s (+6.4% 🔺)0.993s1118.86x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.142s (+0.9%)1.966s (~)0.012s (+16.7% 🔺)2.019s (~)0.877s101.00x
🐘 PostgresNitro1.152s (~)1.997s (~)0.001s (-23.1% 🟢)2.011s (~)0.859s101.01x
💻 LocalExpress1.157s (+1.1%)2.004s (~)0.012s (+28.7% 🔺)2.020s (~)0.862s101.01x
💻 LocalNitro1.160s (+1.8%)2.004s (~)0.012s (+9.3% 🔺)2.019s (~)0.859s101.02x
🐘 PostgresExpress1.161s (-0.6%)2.000s (~)0.001s (-29.4% 🟢)2.011s (~)0.851s101.02x
🐘 PostgresNext.js (Turbopack)1.174s (~)2.001s (~)0.001s (-8.3% 🟢)2.011s (~)0.837s101.03x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.536s (+1.2%)2.010s (~)0.012s (-6.8% 🟢)2.025s (~)0.489s301.00x
🐘 PostgresNitro1.537s (-1.0%)2.002s (~)0.005s (+8.8% 🔺)2.026s (~)0.489s301.00x
💻 LocalNitro1.544s (+1.9%)2.010s (~)0.012s (-3.3%)2.025s (~)0.481s301.01x
💻 LocalNext.js (Turbopack)1.576s (+3.3%)1.970s (~)0.014s (~)2.027s (~)0.451s301.03x
🐘 PostgresExpress1.577s (-2.6%)2.006s (-1.5%)0.005s (+9.1% 🔺)2.026s (-1.7%)0.449s301.03x
🐘 PostgresNext.js (Turbopack)1.658s (+2.2%)2.017s (~)0.005s (~)2.034s (~)0.376s301.08x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.749s (-3.5%)1.062s (-1.5%)0.000s (+Infinity% 🔺)1.078s (-2.5%)0.329s561.00x
🐘 PostgresExpress0.758s (-6.9% 🟢)1.028s (-6.7% 🟢)0.000s (+Infinity% 🔺)1.050s (-6.1% 🟢)0.292s581.01x
🐘 PostgresNext.js (Turbopack)0.977s (-5.7% 🟢)1.354s (-5.2% 🟢)0.000s (NaN%)1.372s (-4.5%)0.395s451.30x
💻 LocalNitro1.256s (-1.2%)1.980s (+1.7%)0.000s (+85.7% 🔺)1.983s (+1.7%)0.728s311.68x
💻 LocalExpress1.262s (-1.1%)1.948s (-3.1%)0.000s (+10.6% 🔺)1.950s (-3.2%)0.689s311.68x
💻 LocalNext.js (Turbopack)1.392s (+5.0% 🔺)1.979s (~)0.001s (+400.0% 🔺)2.017s (~)0.624s301.86x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.674s (-3.8%)2.253s (-3.7%)0.000s (+Infinity% 🔺)2.269s (-4.4%)0.595s271.00x
🐘 PostgresNitro1.809s (+5.1% 🔺)2.435s (+4.1%)0.000s (+Infinity% 🔺)2.450s (+4.0%)0.641s251.08x
🐘 PostgresNext.js (Turbopack)2.411s (-8.1% 🟢)2.952s (-6.6% 🟢)0.000s (-100.0% 🟢)2.962s (-6.5% 🟢)0.551s211.44x
💻 LocalExpress3.435s (+8.5% 🔺)4.093s (+9.8% 🔺)0.001s (-11.0% 🟢)4.097s (+9.8% 🔺)0.661s152.05x
💻 LocalNext.js (Turbopack)3.453s (+8.5% 🔺)3.989s (+11.6% 🔺)0.001s (-49.6% 🟢)4.032s (+11.4% 🔺)0.578s152.06x
💻 LocalNitro3.642s (+3.5%)4.092s (-3.2%)0.001s (+70.0% 🔺)4.099s (-3.1%)0.458s152.17x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress11/21
🐘 PostgresNitro12/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres14/21
Next.js (Turbopack)🐘 Postgres15/21
Nitro🐘 Postgres18/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)
  • 🌐 Platformatic: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

…-vercel)
world-vercel installs the global `require` shim itself (and falls back to H1
when node:http2 is unreachable), so the per-bundler banners in the nitro and
sveltekit integrations are redundant. Remove them; their e2e-vercel-prod lanes
(nitro, vite, tanstack-start via nitro; sveltekit) now validate that
world-vercel's built-in shim carries those bundles on its own.
The @workflow/web banner is intentionally kept for now — workflow-web has no
e2e coverage, so it stays as belt-and-suspenders until a deployed-web smoke
test exists.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the load-time `node:http2` capability probe (which checked
`globalThis.require`, the wrong binding — it false-positives in bundlers like
nitro/rollup where undici's `require` is a tool-injected per-chunk binding the
global never reaches, so it kept H2 on and still hung) with a runtime fallback.
`fetchWithH2Fallback(path, ...)` issues the request over the H2 dispatcher and,
on the bundling failure signature (`http2.connect is not a function` —
detected via `isHttp2ConnectUnavailableError`), retries the same request on an
HTTP/1.1 dispatcher and latches the downgrade process-wide so later requests
skip the dead H2 attempt and its ~16s connect-retry backoff. The connect
failure is pre-send, so the replay is safe even for the non-idempotent stream
writes; the stream fallback preserves STREAM_RETRY_OPTIONS (never retries 5xx).
This recovers regardless of how the bundler bound undici's `require`, unlike
the probe. Layer A (the global `require` self-install) stays as a best-effort
H2 preserver; the framework banners remain for full H2 perf where we ship a
builder. Routes v4 events and stream write/close through the new helper.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@VaguelySeriousVaguelySerious changed the title [world-vercel] Best-effort HTTP/2 bundling backstop (global require + H1 fallback)[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM serversJun 26, 2026
Sign up for freeto 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

@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' [world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers by VaguelySerious · Pull Request #2633 · vercel/workflow · GitHub
Skip to content

[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers - #2633

Open
VaguelySerious wants to merge 4 commits into
mainfrom
peter/world-vercel-h2-resilient
Open

[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers#2633
VaguelySerious wants to merge 4 commits into
mainfrom
peter/world-vercel-h2-resilient

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problem

When @workflow/world-vercel is bundled into an ESM server output (a custom Vite/Rollup/esbuild build, or a framework integration that doesn't externalize undici), undici's lazy require('node:http2') can be left un-wired. undici swallows the failure and falls back to a stub whose http2.connect is undefined, so the first HTTP/2 connect throws http2.connect is not a function — surfacing (after undici's ~16s connect-retry backoff) as a failed request. On the events/stream H2 paths this silently breaks observability reads (and stream writes) for any such consumer.

What this does

A runtime HTTP/2 → HTTP/1.1 fallback, plus a best-effort H2 preserver:

  • fetchWithH2Fallback(path, …) issues the request over the H2 dispatcher and, on the bundling failure signature (isHttp2ConnectUnavailableError), retries the same request on an HTTP/1.1 dispatcher and latches the downgrade process-wide so later requests skip the dead H2 attempt and its ~16s backoff. The connect failure is pre-send, so replaying is safe even for the non-idempotent stream writes — and the stream fallback preserves STREAM_RETRY_OPTIONS (never retries 5xx). v4 events and stream write/close now route through this helper.
  • Layer A (global require self-install) stays as a best-effort H2 preserver: where undici's bundled require is a free identifier it restores real H2; where it isn't (notably nitro/rollup per-chunk bindings) the runtime fallback covers correctness.

Why the previous load-time probe was replaced

The earlier approach probed globalThis.require('node:http2') at load time to decide whether to keep H2. That checks the wrong binding: in bundlers like nitro/rollup undici's require resolves to a tool-injected per-chunk binding the global never reaches, so the probe false-positived (saw H2 "available", kept allowH2: true) and the request still hung. The runtime fallback triggers on the actual connect failure, so it recovers regardless of how the bundler bound undici's require.

The framework build banners (@workflow/sveltekit, @workflow/nitro, @workflow/web) remain the way to keep full H2 performance in the bundlers we ship a builder for; this is the correctness catch-all for consumers we don't.

Verification

  • Full @workflow/world-vercel suite green (182 tests), typecheck + lint clean.
  • New unit tests: isHttp2ConnectUnavailableError signature matching (incl. minified .connect, non-match on ECONNREFUSED/unrelated/nullish); fetchWithH2Fallback retry-on-distinct-H1-dispatcher, downgrade latching, stream-policy preservation, non-H2 rethrow, override-verbatim.
  • End-to-end against real undici: forced undici onto the stub path (http2.connect = undefined) against a dual h1/h2 server — fetchWithH2Fallback('events', …) returns 200 over HTTP/1.1 after the H2 backoff (call update docs sidebar to auto expand #1 ~15.6s), and call Home tweaks #2 is ~9ms (latched to H1).

🤖 Generated with Claude Code

… fallback)
undici loads node:http2 lazily via a bare require('node:http2'). When
world-vercel is bundled into an ESM server (a custom Vite/Rollup/esbuild build,
or any consumer that doesn't externalize undici), there is no require in scope:
the call throws, undici falls back to a stub with no http2.connect, and every
HTTP/2 request (the events API + stream writes) hangs on a dead connection
through RetryAgent's backoff (~16s) then fails. Framework integrations have been
patching this one bundler at a time with a build banner; a custom or third-party
bundled consumer gets no protection.
Move the defense into the package itself, two layers:
A. Install a working `globalThis.require` (createRequire-backed) at module load
so undici's bare require resolves the real node:http2 regardless of how a
consumer bundles us. Guarded to a no-op wherever a real require already
exists.
B. Detect whether node:http2 is actually usable and, if not, build the H2
dispatchers with allowH2:false and warn once — so requests degrade to working
HTTP/1.1 instead of silently failing.
Exports isHttp2Available() and shouldFallBackToH1() with unit coverage,
including a simulated bundled-undici stub (http2 without connect).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6988e7f

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

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production144202301672
✅ 💻 Local Development160502191824
✅ 📦 Local Production160502191824
✅ 🐘 Local Postgres159302311824
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7282010788360

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nextjs-turbopack14903
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.047s (-2.5%)1.007s (~)0.960s101.00x
💻 LocalExpress0.048s (+3.2%)1.005s (~)0.957s101.03x
💻 LocalNext.js (Turbopack)0.049s (+0.8%)1.007s (~)0.958s101.05x
🐘 PostgresNext.js (Turbopack)0.065s (+5.5% 🔺)1.013s (~)0.948s101.39x
🐘 PostgresNitro0.070s (+9.9% 🔺)1.012s (~)0.942s101.49x
🐘 PostgresExpress0.076s (+15.6% 🔺)1.012s (~)0.936s101.63x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.082s (~)2.006s (~)0.924s101.00x
💻 LocalNitro1.082s (~)2.007s (~)0.925s101.00x
💻 LocalNext.js (Turbopack)1.086s (+0.6%)2.006s (~)0.920s101.00x
🐘 PostgresNitro1.094s (~)2.009s (~)0.915s101.01x
🐘 PostgresExpress1.098s (~)2.012s (~)0.913s101.02x
🐘 PostgresNext.js (Turbopack)1.101s (-0.5%)2.010s (~)0.909s101.02x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.437s (~)11.023s (~)0.586s31.00x
🐘 PostgresNitro10.440s (~)11.012s (~)0.572s31.00x
💻 LocalNitro10.459s (~)11.022s (~)0.563s31.00x
💻 LocalNext.js (Turbopack)10.462s (~)11.022s (~)0.560s31.00x
🐘 PostgresExpress10.476s (~)11.019s (~)0.543s31.00x
🐘 PostgresNext.js (Turbopack)10.556s (~)11.024s (~)0.468s31.01x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro13.544s (~)14.019s (~)0.474s51.00x
💻 LocalExpress13.588s (~)14.028s (~)0.440s51.00x
💻 LocalNitro13.631s (~)14.027s (~)0.397s51.01x
🐘 PostgresExpress13.674s (-1.1%)14.019s (~)0.345s51.01x
🐘 PostgresNext.js (Turbopack)13.759s (~)14.025s (~)0.266s51.02x
💻 LocalNext.js (Turbopack)13.775s (+0.9%)14.027s (~)0.252s51.02x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express12.134s (~)13.025s (~)0.891s71.00x
🐘 PostgresExpress12.213s (~)13.017s (~)0.805s71.01x
💻 LocalNext.js (Turbopack)12.354s (+1.6%)13.024s (~)0.671s71.02x
💻 LocalNitro12.406s (+2.3%)13.024s (~)0.618s71.02x
🐘 PostgresNitro12.498s (+2.8%)13.159s (+1.1%)0.661s71.03x
🐘 PostgresNext.js (Turbopack)12.503s (+0.7%)13.020s (~)0.517s71.03x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.165s (-1.4%)2.008s (~)0.843s151.00x
🐘 PostgresExpress1.176s (~)2.007s (~)0.831s151.01x
🐘 PostgresNext.js (Turbopack)1.211s (~)2.011s (~)0.800s151.04x
💻 LocalNitro1.400s (~)2.006s (~)0.607s151.20x
💻 LocalExpress1.438s (+3.2%)2.006s (~)0.568s151.23x
💻 LocalNext.js (Turbopack)1.454s (-2.2%)2.007s (-3.2%)0.552s151.25x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.282s (-2.9%)2.316s (-7.7% 🟢)1.034s131.00x
🐘 PostgresNext.js (Turbopack)1.337s (-0.6%)3.110s (+3.3%)1.772s101.04x
🐘 PostgresExpress1.386s (+4.0%)2.737s (+14.4% 🔺)1.351s111.08x
💻 LocalExpress2.576s (+4.1%)3.009s (~)0.433s102.01x
💻 LocalNitro2.592s (+2.7%)2.917s (-3.0%)0.325s112.02x
💻 LocalNext.js (Turbopack)2.657s (+3.4%)3.109s (+3.3%)0.451s102.07x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.558s (-3.6%)4.010s (~)2.452s81.00x
🐘 PostgresExpress1.634s (~)4.136s (-3.8%)2.502s81.05x
🐘 PostgresNext.js (Turbopack)3.567s (+41.5% 🔺)8.529s (+54.7% 🔺)4.962s42.29x
💻 LocalNitro6.142s (+18.3% 🔺)6.620s (+13.2% 🔺)0.477s53.94x
💻 LocalExpress6.758s (+23.9% 🔺)7.217s (+16.1% 🔺)0.459s54.34x
💻 LocalNext.js (Turbopack)8.060s (+16.4% 🔺)8.769s (+18.2% 🔺)0.709s45.17x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.177s (-0.7%)2.008s (~)0.831s151.00x
🐘 PostgresNext.js (Turbopack)1.203s (-1.1%)2.009s (~)0.806s151.02x
🐘 PostgresNitro1.301s (+10.2% 🔺)2.074s (+3.3%)0.773s151.10x
💻 LocalExpress1.411s (+2.3%)2.007s (~)0.595s151.20x
💻 LocalNitro1.436s (-0.9%)2.007s (~)0.571s151.22x
💻 LocalNext.js (Turbopack)1.470s (+2.7%)2.007s (~)0.537s151.25x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.317s (~)2.508s (+12.8% 🔺)1.191s121.00x
🐘 PostgresNitro1.337s (+2.0%)2.394s (+3.3%)1.057s131.02x
🐘 PostgresNext.js (Turbopack)1.337s (~)3.011s (-3.1%)1.673s101.02x
💻 LocalNitro2.538s (-5.2% 🟢)3.009s (~)0.471s101.93x
💻 LocalExpress2.616s (+2.2%)3.109s (+3.3%)0.493s101.99x
💻 LocalNext.js (Turbopack)2.847s (+4.3%)3.208s (+3.2%)0.361s102.16x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.573s (-3.9%)4.135s (~)2.562s81.00x
🐘 PostgresExpress1.641s (+1.5%)4.014s (-3.0%)2.373s81.04x
🐘 PostgresNext.js (Turbopack)3.370s (+1.1%)6.618s (+10.0% 🔺)3.249s52.14x
💻 LocalNitro6.183s (-6.1% 🟢)7.015s (-2.8%)0.832s53.93x
💻 LocalNext.js (Turbopack)6.571s (+27.7% 🔺)7.217s (+27.1% 🔺)0.646s54.18x
💻 LocalExpress7.391s (+18.0% 🔺)8.019s (+21.3% 🔺)0.629s44.70x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.536s (-2.3%)1.006s (~)0.470s601.00x
💻 LocalExpress0.573s (+2.0%)1.005s (-1.6%)0.433s601.07x
🐘 PostgresNext.js (Turbopack)0.595s (+3.8%)1.008s (~)0.412s601.11x
💻 LocalNext.js (Turbopack)0.601s (+3.4%)1.005s (-1.7%)0.404s601.12x
🐘 PostgresNitro0.602s (+8.4% 🔺)1.077s (+3.5%)0.475s571.12x
💻 LocalNitro0.636s (+16.5% 🔺)1.022s (+1.7%)0.386s591.19x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.275s (-3.7%)2.007s (~)0.732s451.00x
🐘 PostgresExpress1.278s (-3.4%)2.008s (-1.1%)0.729s451.00x
🐘 PostgresNext.js (Turbopack)1.386s (-4.1%)2.007s (-1.1%)0.621s451.09x
💻 LocalNitro1.493s (+7.5% 🔺)2.006s (~)0.513s451.17x
💻 LocalExpress1.511s (+9.3% 🔺)2.051s (+2.3%)0.540s451.19x
💻 LocalNext.js (Turbopack)1.513s (+8.8% 🔺)2.006s (~)0.493s451.19x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.483s (-3.6%)3.033s (-1.7%)0.550s401.00x
🐘 PostgresExpress2.631s (-2.8%)3.085s (-1.7%)0.454s391.06x
🐘 PostgresNext.js (Turbopack)2.803s (~)3.059s (+1.6%)0.255s401.13x
💻 LocalExpress3.229s (+8.8% 🔺)4.010s (+21.3% 🔺)0.781s301.30x
💻 LocalNitro3.255s (+7.5% 🔺)3.945s (+10.6% 🔺)0.690s311.31x
💻 LocalNext.js (Turbopack)3.369s (+9.7% 🔺)4.043s (+9.1% 🔺)0.673s301.36x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.199s (+8.0% 🔺)1.007s (~)0.808s601.00x
🐘 PostgresNitro0.212s (~)1.006s (~)0.794s601.07x
🐘 PostgresExpress0.216s (+3.3%)1.006s (~)0.790s601.09x
💻 LocalNitro0.468s (+1.7%)1.005s (~)0.537s602.35x
💻 LocalExpress0.504s (+18.9% 🔺)1.022s (+1.8%)0.518s592.54x
💻 LocalNext.js (Turbopack)0.635s (+5.7% 🔺)1.005s (~)0.370s603.20x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.309s (~)1.030s (+2.3%)0.720s881.00x
🐘 PostgresNitro0.319s (~)1.006s (~)0.687s901.03x
🐘 PostgresExpress0.331s (+3.8%)1.006s (~)0.675s901.07x
💻 LocalExpress2.083s (-3.4%)2.714s (-0.8%)0.631s346.73x
💻 LocalNitro2.111s (-0.7%)2.656s (-5.0% 🟢)0.545s346.82x
💻 LocalNext.js (Turbopack)2.724s (-2.1%)3.223s (+4.8%)0.499s288.80x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.537s (-1.0%)3.086s (+2.5%)2.549s391.00x
🐘 PostgresExpress0.550s (+5.7% 🔺)1.059s (+1.8%)0.509s1141.03x
🐘 PostgresNitro0.563s (+3.6%)1.136s (+6.4% 🔺)0.574s1081.05x
💻 LocalNext.js (Turbopack)9.793s (-8.7% 🟢)10.699s (-5.3% 🟢)0.906s1218.24x
💻 LocalNitro10.012s (+11.2% 🔺)10.939s (+8.2% 🔺)0.927s1118.64x
💻 LocalExpress10.125s (+8.5% 🔺)11.118s (+6.4% 🔺)0.993s1118.86x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.142s (+0.9%)1.966s (~)0.012s (+16.7% 🔺)2.019s (~)0.877s101.00x
🐘 PostgresNitro1.152s (~)1.997s (~)0.001s (-23.1% 🟢)2.011s (~)0.859s101.01x
💻 LocalExpress1.157s (+1.1%)2.004s (~)0.012s (+28.7% 🔺)2.020s (~)0.862s101.01x
💻 LocalNitro1.160s (+1.8%)2.004s (~)0.012s (+9.3% 🔺)2.019s (~)0.859s101.02x
🐘 PostgresExpress1.161s (-0.6%)2.000s (~)0.001s (-29.4% 🟢)2.011s (~)0.851s101.02x
🐘 PostgresNext.js (Turbopack)1.174s (~)2.001s (~)0.001s (-8.3% 🟢)2.011s (~)0.837s101.03x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.536s (+1.2%)2.010s (~)0.012s (-6.8% 🟢)2.025s (~)0.489s301.00x
🐘 PostgresNitro1.537s (-1.0%)2.002s (~)0.005s (+8.8% 🔺)2.026s (~)0.489s301.00x
💻 LocalNitro1.544s (+1.9%)2.010s (~)0.012s (-3.3%)2.025s (~)0.481s301.01x
💻 LocalNext.js (Turbopack)1.576s (+3.3%)1.970s (~)0.014s (~)2.027s (~)0.451s301.03x
🐘 PostgresExpress1.577s (-2.6%)2.006s (-1.5%)0.005s (+9.1% 🔺)2.026s (-1.7%)0.449s301.03x
🐘 PostgresNext.js (Turbopack)1.658s (+2.2%)2.017s (~)0.005s (~)2.034s (~)0.376s301.08x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.749s (-3.5%)1.062s (-1.5%)0.000s (+Infinity% 🔺)1.078s (-2.5%)0.329s561.00x
🐘 PostgresExpress0.758s (-6.9% 🟢)1.028s (-6.7% 🟢)0.000s (+Infinity% 🔺)1.050s (-6.1% 🟢)0.292s581.01x
🐘 PostgresNext.js (Turbopack)0.977s (-5.7% 🟢)1.354s (-5.2% 🟢)0.000s (NaN%)1.372s (-4.5%)0.395s451.30x
💻 LocalNitro1.256s (-1.2%)1.980s (+1.7%)0.000s (+85.7% 🔺)1.983s (+1.7%)0.728s311.68x
💻 LocalExpress1.262s (-1.1%)1.948s (-3.1%)0.000s (+10.6% 🔺)1.950s (-3.2%)0.689s311.68x
💻 LocalNext.js (Turbopack)1.392s (+5.0% 🔺)1.979s (~)0.001s (+400.0% 🔺)2.017s (~)0.624s301.86x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.674s (-3.8%)2.253s (-3.7%)0.000s (+Infinity% 🔺)2.269s (-4.4%)0.595s271.00x
🐘 PostgresNitro1.809s (+5.1% 🔺)2.435s (+4.1%)0.000s (+Infinity% 🔺)2.450s (+4.0%)0.641s251.08x
🐘 PostgresNext.js (Turbopack)2.411s (-8.1% 🟢)2.952s (-6.6% 🟢)0.000s (-100.0% 🟢)2.962s (-6.5% 🟢)0.551s211.44x
💻 LocalExpress3.435s (+8.5% 🔺)4.093s (+9.8% 🔺)0.001s (-11.0% 🟢)4.097s (+9.8% 🔺)0.661s152.05x
💻 LocalNext.js (Turbopack)3.453s (+8.5% 🔺)3.989s (+11.6% 🔺)0.001s (-49.6% 🟢)4.032s (+11.4% 🔺)0.578s152.06x
💻 LocalNitro3.642s (+3.5%)4.092s (-3.2%)0.001s (+70.0% 🔺)4.099s (-3.1%)0.458s152.17x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress11/21
🐘 PostgresNitro12/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres14/21
Next.js (Turbopack)🐘 Postgres15/21
Nitro🐘 Postgres18/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)
  • 🌐 Platformatic: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

…-vercel)
world-vercel installs the global `require` shim itself (and falls back to H1
when node:http2 is unreachable), so the per-bundler banners in the nitro and
sveltekit integrations are redundant. Remove them; their e2e-vercel-prod lanes
(nitro, vite, tanstack-start via nitro; sveltekit) now validate that
world-vercel's built-in shim carries those bundles on its own.
The @workflow/web banner is intentionally kept for now — workflow-web has no
e2e coverage, so it stays as belt-and-suspenders until a deployed-web smoke
test exists.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the load-time `node:http2` capability probe (which checked
`globalThis.require`, the wrong binding — it false-positives in bundlers like
nitro/rollup where undici's `require` is a tool-injected per-chunk binding the
global never reaches, so it kept H2 on and still hung) with a runtime fallback.
`fetchWithH2Fallback(path, ...)` issues the request over the H2 dispatcher and,
on the bundling failure signature (`http2.connect is not a function` —
detected via `isHttp2ConnectUnavailableError`), retries the same request on an
HTTP/1.1 dispatcher and latches the downgrade process-wide so later requests
skip the dead H2 attempt and its ~16s connect-retry backoff. The connect
failure is pre-send, so the replay is safe even for the non-idempotent stream
writes; the stream fallback preserves STREAM_RETRY_OPTIONS (never retries 5xx).
This recovers regardless of how the bundler bound undici's `require`, unlike
the probe. Layer A (the global `require` self-install) stays as a best-effort
H2 preserver; the framework banners remain for full H2 perf where we ship a
builder. Routes v4 events and stream write/close through the new helper.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@VaguelySeriousVaguelySerious changed the title [world-vercel] Best-effort HTTP/2 bundling backstop (global require + H1 fallback)[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM serversJun 26, 2026
Sign up for freeto 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

@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' [world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers by VaguelySerious · Pull Request #2633 · vercel/workflow · GitHub
Skip to content

[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers - #2633

Open
VaguelySerious wants to merge 4 commits into
mainfrom
peter/world-vercel-h2-resilient
Open

[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers#2633
VaguelySerious wants to merge 4 commits into
mainfrom
peter/world-vercel-h2-resilient

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problem

When @workflow/world-vercel is bundled into an ESM server output (a custom Vite/Rollup/esbuild build, or a framework integration that doesn't externalize undici), undici's lazy require('node:http2') can be left un-wired. undici swallows the failure and falls back to a stub whose http2.connect is undefined, so the first HTTP/2 connect throws http2.connect is not a function — surfacing (after undici's ~16s connect-retry backoff) as a failed request. On the events/stream H2 paths this silently breaks observability reads (and stream writes) for any such consumer.

What this does

A runtime HTTP/2 → HTTP/1.1 fallback, plus a best-effort H2 preserver:

  • fetchWithH2Fallback(path, …) issues the request over the H2 dispatcher and, on the bundling failure signature (isHttp2ConnectUnavailableError), retries the same request on an HTTP/1.1 dispatcher and latches the downgrade process-wide so later requests skip the dead H2 attempt and its ~16s backoff. The connect failure is pre-send, so replaying is safe even for the non-idempotent stream writes — and the stream fallback preserves STREAM_RETRY_OPTIONS (never retries 5xx). v4 events and stream write/close now route through this helper.
  • Layer A (global require self-install) stays as a best-effort H2 preserver: where undici's bundled require is a free identifier it restores real H2; where it isn't (notably nitro/rollup per-chunk bindings) the runtime fallback covers correctness.

Why the previous load-time probe was replaced

The earlier approach probed globalThis.require('node:http2') at load time to decide whether to keep H2. That checks the wrong binding: in bundlers like nitro/rollup undici's require resolves to a tool-injected per-chunk binding the global never reaches, so the probe false-positived (saw H2 "available", kept allowH2: true) and the request still hung. The runtime fallback triggers on the actual connect failure, so it recovers regardless of how the bundler bound undici's require.

The framework build banners (@workflow/sveltekit, @workflow/nitro, @workflow/web) remain the way to keep full H2 performance in the bundlers we ship a builder for; this is the correctness catch-all for consumers we don't.

Verification

  • Full @workflow/world-vercel suite green (182 tests), typecheck + lint clean.
  • New unit tests: isHttp2ConnectUnavailableError signature matching (incl. minified .connect, non-match on ECONNREFUSED/unrelated/nullish); fetchWithH2Fallback retry-on-distinct-H1-dispatcher, downgrade latching, stream-policy preservation, non-H2 rethrow, override-verbatim.
  • End-to-end against real undici: forced undici onto the stub path (http2.connect = undefined) against a dual h1/h2 server — fetchWithH2Fallback('events', …) returns 200 over HTTP/1.1 after the H2 backoff (call update docs sidebar to auto expand #1 ~15.6s), and call Home tweaks #2 is ~9ms (latched to H1).

🤖 Generated with Claude Code

… fallback)
undici loads node:http2 lazily via a bare require('node:http2'). When
world-vercel is bundled into an ESM server (a custom Vite/Rollup/esbuild build,
or any consumer that doesn't externalize undici), there is no require in scope:
the call throws, undici falls back to a stub with no http2.connect, and every
HTTP/2 request (the events API + stream writes) hangs on a dead connection
through RetryAgent's backoff (~16s) then fails. Framework integrations have been
patching this one bundler at a time with a build banner; a custom or third-party
bundled consumer gets no protection.
Move the defense into the package itself, two layers:
A. Install a working `globalThis.require` (createRequire-backed) at module load
so undici's bare require resolves the real node:http2 regardless of how a
consumer bundles us. Guarded to a no-op wherever a real require already
exists.
B. Detect whether node:http2 is actually usable and, if not, build the H2
dispatchers with allowH2:false and warn once — so requests degrade to working
HTTP/1.1 instead of silently failing.
Exports isHttp2Available() and shouldFallBackToH1() with unit coverage,
including a simulated bundled-undici stub (http2 without connect).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6988e7f

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

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production144202301672
✅ 💻 Local Development160502191824
✅ 📦 Local Production160502191824
✅ 🐘 Local Postgres159302311824
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7282010788360

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nextjs-turbopack14903
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.047s (-2.5%)1.007s (~)0.960s101.00x
💻 LocalExpress0.048s (+3.2%)1.005s (~)0.957s101.03x
💻 LocalNext.js (Turbopack)0.049s (+0.8%)1.007s (~)0.958s101.05x
🐘 PostgresNext.js (Turbopack)0.065s (+5.5% 🔺)1.013s (~)0.948s101.39x
🐘 PostgresNitro0.070s (+9.9% 🔺)1.012s (~)0.942s101.49x
🐘 PostgresExpress0.076s (+15.6% 🔺)1.012s (~)0.936s101.63x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.082s (~)2.006s (~)0.924s101.00x
💻 LocalNitro1.082s (~)2.007s (~)0.925s101.00x
💻 LocalNext.js (Turbopack)1.086s (+0.6%)2.006s (~)0.920s101.00x
🐘 PostgresNitro1.094s (~)2.009s (~)0.915s101.01x
🐘 PostgresExpress1.098s (~)2.012s (~)0.913s101.02x
🐘 PostgresNext.js (Turbopack)1.101s (-0.5%)2.010s (~)0.909s101.02x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.437s (~)11.023s (~)0.586s31.00x
🐘 PostgresNitro10.440s (~)11.012s (~)0.572s31.00x
💻 LocalNitro10.459s (~)11.022s (~)0.563s31.00x
💻 LocalNext.js (Turbopack)10.462s (~)11.022s (~)0.560s31.00x
🐘 PostgresExpress10.476s (~)11.019s (~)0.543s31.00x
🐘 PostgresNext.js (Turbopack)10.556s (~)11.024s (~)0.468s31.01x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro13.544s (~)14.019s (~)0.474s51.00x
💻 LocalExpress13.588s (~)14.028s (~)0.440s51.00x
💻 LocalNitro13.631s (~)14.027s (~)0.397s51.01x
🐘 PostgresExpress13.674s (-1.1%)14.019s (~)0.345s51.01x
🐘 PostgresNext.js (Turbopack)13.759s (~)14.025s (~)0.266s51.02x
💻 LocalNext.js (Turbopack)13.775s (+0.9%)14.027s (~)0.252s51.02x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express12.134s (~)13.025s (~)0.891s71.00x
🐘 PostgresExpress12.213s (~)13.017s (~)0.805s71.01x
💻 LocalNext.js (Turbopack)12.354s (+1.6%)13.024s (~)0.671s71.02x
💻 LocalNitro12.406s (+2.3%)13.024s (~)0.618s71.02x
🐘 PostgresNitro12.498s (+2.8%)13.159s (+1.1%)0.661s71.03x
🐘 PostgresNext.js (Turbopack)12.503s (+0.7%)13.020s (~)0.517s71.03x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.165s (-1.4%)2.008s (~)0.843s151.00x
🐘 PostgresExpress1.176s (~)2.007s (~)0.831s151.01x
🐘 PostgresNext.js (Turbopack)1.211s (~)2.011s (~)0.800s151.04x
💻 LocalNitro1.400s (~)2.006s (~)0.607s151.20x
💻 LocalExpress1.438s (+3.2%)2.006s (~)0.568s151.23x
💻 LocalNext.js (Turbopack)1.454s (-2.2%)2.007s (-3.2%)0.552s151.25x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.282s (-2.9%)2.316s (-7.7% 🟢)1.034s131.00x
🐘 PostgresNext.js (Turbopack)1.337s (-0.6%)3.110s (+3.3%)1.772s101.04x
🐘 PostgresExpress1.386s (+4.0%)2.737s (+14.4% 🔺)1.351s111.08x
💻 LocalExpress2.576s (+4.1%)3.009s (~)0.433s102.01x
💻 LocalNitro2.592s (+2.7%)2.917s (-3.0%)0.325s112.02x
💻 LocalNext.js (Turbopack)2.657s (+3.4%)3.109s (+3.3%)0.451s102.07x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.558s (-3.6%)4.010s (~)2.452s81.00x
🐘 PostgresExpress1.634s (~)4.136s (-3.8%)2.502s81.05x
🐘 PostgresNext.js (Turbopack)3.567s (+41.5% 🔺)8.529s (+54.7% 🔺)4.962s42.29x
💻 LocalNitro6.142s (+18.3% 🔺)6.620s (+13.2% 🔺)0.477s53.94x
💻 LocalExpress6.758s (+23.9% 🔺)7.217s (+16.1% 🔺)0.459s54.34x
💻 LocalNext.js (Turbopack)8.060s (+16.4% 🔺)8.769s (+18.2% 🔺)0.709s45.17x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.177s (-0.7%)2.008s (~)0.831s151.00x
🐘 PostgresNext.js (Turbopack)1.203s (-1.1%)2.009s (~)0.806s151.02x
🐘 PostgresNitro1.301s (+10.2% 🔺)2.074s (+3.3%)0.773s151.10x
💻 LocalExpress1.411s (+2.3%)2.007s (~)0.595s151.20x
💻 LocalNitro1.436s (-0.9%)2.007s (~)0.571s151.22x
💻 LocalNext.js (Turbopack)1.470s (+2.7%)2.007s (~)0.537s151.25x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.317s (~)2.508s (+12.8% 🔺)1.191s121.00x
🐘 PostgresNitro1.337s (+2.0%)2.394s (+3.3%)1.057s131.02x
🐘 PostgresNext.js (Turbopack)1.337s (~)3.011s (-3.1%)1.673s101.02x
💻 LocalNitro2.538s (-5.2% 🟢)3.009s (~)0.471s101.93x
💻 LocalExpress2.616s (+2.2%)3.109s (+3.3%)0.493s101.99x
💻 LocalNext.js (Turbopack)2.847s (+4.3%)3.208s (+3.2%)0.361s102.16x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.573s (-3.9%)4.135s (~)2.562s81.00x
🐘 PostgresExpress1.641s (+1.5%)4.014s (-3.0%)2.373s81.04x
🐘 PostgresNext.js (Turbopack)3.370s (+1.1%)6.618s (+10.0% 🔺)3.249s52.14x
💻 LocalNitro6.183s (-6.1% 🟢)7.015s (-2.8%)0.832s53.93x
💻 LocalNext.js (Turbopack)6.571s (+27.7% 🔺)7.217s (+27.1% 🔺)0.646s54.18x
💻 LocalExpress7.391s (+18.0% 🔺)8.019s (+21.3% 🔺)0.629s44.70x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.536s (-2.3%)1.006s (~)0.470s601.00x
💻 LocalExpress0.573s (+2.0%)1.005s (-1.6%)0.433s601.07x
🐘 PostgresNext.js (Turbopack)0.595s (+3.8%)1.008s (~)0.412s601.11x
💻 LocalNext.js (Turbopack)0.601s (+3.4%)1.005s (-1.7%)0.404s601.12x
🐘 PostgresNitro0.602s (+8.4% 🔺)1.077s (+3.5%)0.475s571.12x
💻 LocalNitro0.636s (+16.5% 🔺)1.022s (+1.7%)0.386s591.19x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.275s (-3.7%)2.007s (~)0.732s451.00x
🐘 PostgresExpress1.278s (-3.4%)2.008s (-1.1%)0.729s451.00x
🐘 PostgresNext.js (Turbopack)1.386s (-4.1%)2.007s (-1.1%)0.621s451.09x
💻 LocalNitro1.493s (+7.5% 🔺)2.006s (~)0.513s451.17x
💻 LocalExpress1.511s (+9.3% 🔺)2.051s (+2.3%)0.540s451.19x
💻 LocalNext.js (Turbopack)1.513s (+8.8% 🔺)2.006s (~)0.493s451.19x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.483s (-3.6%)3.033s (-1.7%)0.550s401.00x
🐘 PostgresExpress2.631s (-2.8%)3.085s (-1.7%)0.454s391.06x
🐘 PostgresNext.js (Turbopack)2.803s (~)3.059s (+1.6%)0.255s401.13x
💻 LocalExpress3.229s (+8.8% 🔺)4.010s (+21.3% 🔺)0.781s301.30x
💻 LocalNitro3.255s (+7.5% 🔺)3.945s (+10.6% 🔺)0.690s311.31x
💻 LocalNext.js (Turbopack)3.369s (+9.7% 🔺)4.043s (+9.1% 🔺)0.673s301.36x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.199s (+8.0% 🔺)1.007s (~)0.808s601.00x
🐘 PostgresNitro0.212s (~)1.006s (~)0.794s601.07x
🐘 PostgresExpress0.216s (+3.3%)1.006s (~)0.790s601.09x
💻 LocalNitro0.468s (+1.7%)1.005s (~)0.537s602.35x
💻 LocalExpress0.504s (+18.9% 🔺)1.022s (+1.8%)0.518s592.54x
💻 LocalNext.js (Turbopack)0.635s (+5.7% 🔺)1.005s (~)0.370s603.20x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.309s (~)1.030s (+2.3%)0.720s881.00x
🐘 PostgresNitro0.319s (~)1.006s (~)0.687s901.03x
🐘 PostgresExpress0.331s (+3.8%)1.006s (~)0.675s901.07x
💻 LocalExpress2.083s (-3.4%)2.714s (-0.8%)0.631s346.73x
💻 LocalNitro2.111s (-0.7%)2.656s (-5.0% 🟢)0.545s346.82x
💻 LocalNext.js (Turbopack)2.724s (-2.1%)3.223s (+4.8%)0.499s288.80x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.537s (-1.0%)3.086s (+2.5%)2.549s391.00x
🐘 PostgresExpress0.550s (+5.7% 🔺)1.059s (+1.8%)0.509s1141.03x
🐘 PostgresNitro0.563s (+3.6%)1.136s (+6.4% 🔺)0.574s1081.05x
💻 LocalNext.js (Turbopack)9.793s (-8.7% 🟢)10.699s (-5.3% 🟢)0.906s1218.24x
💻 LocalNitro10.012s (+11.2% 🔺)10.939s (+8.2% 🔺)0.927s1118.64x
💻 LocalExpress10.125s (+8.5% 🔺)11.118s (+6.4% 🔺)0.993s1118.86x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.142s (+0.9%)1.966s (~)0.012s (+16.7% 🔺)2.019s (~)0.877s101.00x
🐘 PostgresNitro1.152s (~)1.997s (~)0.001s (-23.1% 🟢)2.011s (~)0.859s101.01x
💻 LocalExpress1.157s (+1.1%)2.004s (~)0.012s (+28.7% 🔺)2.020s (~)0.862s101.01x
💻 LocalNitro1.160s (+1.8%)2.004s (~)0.012s (+9.3% 🔺)2.019s (~)0.859s101.02x
🐘 PostgresExpress1.161s (-0.6%)2.000s (~)0.001s (-29.4% 🟢)2.011s (~)0.851s101.02x
🐘 PostgresNext.js (Turbopack)1.174s (~)2.001s (~)0.001s (-8.3% 🟢)2.011s (~)0.837s101.03x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.536s (+1.2%)2.010s (~)0.012s (-6.8% 🟢)2.025s (~)0.489s301.00x
🐘 PostgresNitro1.537s (-1.0%)2.002s (~)0.005s (+8.8% 🔺)2.026s (~)0.489s301.00x
💻 LocalNitro1.544s (+1.9%)2.010s (~)0.012s (-3.3%)2.025s (~)0.481s301.01x
💻 LocalNext.js (Turbopack)1.576s (+3.3%)1.970s (~)0.014s (~)2.027s (~)0.451s301.03x
🐘 PostgresExpress1.577s (-2.6%)2.006s (-1.5%)0.005s (+9.1% 🔺)2.026s (-1.7%)0.449s301.03x
🐘 PostgresNext.js (Turbopack)1.658s (+2.2%)2.017s (~)0.005s (~)2.034s (~)0.376s301.08x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.749s (-3.5%)1.062s (-1.5%)0.000s (+Infinity% 🔺)1.078s (-2.5%)0.329s561.00x
🐘 PostgresExpress0.758s (-6.9% 🟢)1.028s (-6.7% 🟢)0.000s (+Infinity% 🔺)1.050s (-6.1% 🟢)0.292s581.01x
🐘 PostgresNext.js (Turbopack)0.977s (-5.7% 🟢)1.354s (-5.2% 🟢)0.000s (NaN%)1.372s (-4.5%)0.395s451.30x
💻 LocalNitro1.256s (-1.2%)1.980s (+1.7%)0.000s (+85.7% 🔺)1.983s (+1.7%)0.728s311.68x
💻 LocalExpress1.262s (-1.1%)1.948s (-3.1%)0.000s (+10.6% 🔺)1.950s (-3.2%)0.689s311.68x
💻 LocalNext.js (Turbopack)1.392s (+5.0% 🔺)1.979s (~)0.001s (+400.0% 🔺)2.017s (~)0.624s301.86x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.674s (-3.8%)2.253s (-3.7%)0.000s (+Infinity% 🔺)2.269s (-4.4%)0.595s271.00x
🐘 PostgresNitro1.809s (+5.1% 🔺)2.435s (+4.1%)0.000s (+Infinity% 🔺)2.450s (+4.0%)0.641s251.08x
🐘 PostgresNext.js (Turbopack)2.411s (-8.1% 🟢)2.952s (-6.6% 🟢)0.000s (-100.0% 🟢)2.962s (-6.5% 🟢)0.551s211.44x
💻 LocalExpress3.435s (+8.5% 🔺)4.093s (+9.8% 🔺)0.001s (-11.0% 🟢)4.097s (+9.8% 🔺)0.661s152.05x
💻 LocalNext.js (Turbopack)3.453s (+8.5% 🔺)3.989s (+11.6% 🔺)0.001s (-49.6% 🟢)4.032s (+11.4% 🔺)0.578s152.06x
💻 LocalNitro3.642s (+3.5%)4.092s (-3.2%)0.001s (+70.0% 🔺)4.099s (-3.1%)0.458s152.17x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress11/21
🐘 PostgresNitro12/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres14/21
Next.js (Turbopack)🐘 Postgres15/21
Nitro🐘 Postgres18/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)
  • 🌐 Platformatic: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

…-vercel)
world-vercel installs the global `require` shim itself (and falls back to H1
when node:http2 is unreachable), so the per-bundler banners in the nitro and
sveltekit integrations are redundant. Remove them; their e2e-vercel-prod lanes
(nitro, vite, tanstack-start via nitro; sveltekit) now validate that
world-vercel's built-in shim carries those bundles on its own.
The @workflow/web banner is intentionally kept for now — workflow-web has no
e2e coverage, so it stays as belt-and-suspenders until a deployed-web smoke
test exists.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the load-time `node:http2` capability probe (which checked
`globalThis.require`, the wrong binding — it false-positives in bundlers like
nitro/rollup where undici's `require` is a tool-injected per-chunk binding the
global never reaches, so it kept H2 on and still hung) with a runtime fallback.
`fetchWithH2Fallback(path, ...)` issues the request over the H2 dispatcher and,
on the bundling failure signature (`http2.connect is not a function` —
detected via `isHttp2ConnectUnavailableError`), retries the same request on an
HTTP/1.1 dispatcher and latches the downgrade process-wide so later requests
skip the dead H2 attempt and its ~16s connect-retry backoff. The connect
failure is pre-send, so the replay is safe even for the non-idempotent stream
writes; the stream fallback preserves STREAM_RETRY_OPTIONS (never retries 5xx).
This recovers regardless of how the bundler bound undici's `require`, unlike
the probe. Layer A (the global `require` self-install) stays as a best-effort
H2 preserver; the framework banners remain for full H2 perf where we ship a
builder. Routes v4 events and stream write/close through the new helper.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@VaguelySeriousVaguelySerious changed the title [world-vercel] Best-effort HTTP/2 bundling backstop (global require + H1 fallback)[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM serversJun 26, 2026
Sign up for freeto 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

@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' [world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers by VaguelySerious · Pull Request #2633 · vercel/workflow · GitHub
Skip to content

[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers - #2633

Open
VaguelySerious wants to merge 4 commits into
mainfrom
peter/world-vercel-h2-resilient
Open

[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers#2633
VaguelySerious wants to merge 4 commits into
mainfrom
peter/world-vercel-h2-resilient

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problem

When @workflow/world-vercel is bundled into an ESM server output (a custom Vite/Rollup/esbuild build, or a framework integration that doesn't externalize undici), undici's lazy require('node:http2') can be left un-wired. undici swallows the failure and falls back to a stub whose http2.connect is undefined, so the first HTTP/2 connect throws http2.connect is not a function — surfacing (after undici's ~16s connect-retry backoff) as a failed request. On the events/stream H2 paths this silently breaks observability reads (and stream writes) for any such consumer.

What this does

A runtime HTTP/2 → HTTP/1.1 fallback, plus a best-effort H2 preserver:

  • fetchWithH2Fallback(path, …) issues the request over the H2 dispatcher and, on the bundling failure signature (isHttp2ConnectUnavailableError), retries the same request on an HTTP/1.1 dispatcher and latches the downgrade process-wide so later requests skip the dead H2 attempt and its ~16s backoff. The connect failure is pre-send, so replaying is safe even for the non-idempotent stream writes — and the stream fallback preserves STREAM_RETRY_OPTIONS (never retries 5xx). v4 events and stream write/close now route through this helper.
  • Layer A (global require self-install) stays as a best-effort H2 preserver: where undici's bundled require is a free identifier it restores real H2; where it isn't (notably nitro/rollup per-chunk bindings) the runtime fallback covers correctness.

Why the previous load-time probe was replaced

The earlier approach probed globalThis.require('node:http2') at load time to decide whether to keep H2. That checks the wrong binding: in bundlers like nitro/rollup undici's require resolves to a tool-injected per-chunk binding the global never reaches, so the probe false-positived (saw H2 "available", kept allowH2: true) and the request still hung. The runtime fallback triggers on the actual connect failure, so it recovers regardless of how the bundler bound undici's require.

The framework build banners (@workflow/sveltekit, @workflow/nitro, @workflow/web) remain the way to keep full H2 performance in the bundlers we ship a builder for; this is the correctness catch-all for consumers we don't.

Verification

  • Full @workflow/world-vercel suite green (182 tests), typecheck + lint clean.
  • New unit tests: isHttp2ConnectUnavailableError signature matching (incl. minified .connect, non-match on ECONNREFUSED/unrelated/nullish); fetchWithH2Fallback retry-on-distinct-H1-dispatcher, downgrade latching, stream-policy preservation, non-H2 rethrow, override-verbatim.
  • End-to-end against real undici: forced undici onto the stub path (http2.connect = undefined) against a dual h1/h2 server — fetchWithH2Fallback('events', …) returns 200 over HTTP/1.1 after the H2 backoff (call update docs sidebar to auto expand #1 ~15.6s), and call Home tweaks #2 is ~9ms (latched to H1).

🤖 Generated with Claude Code

… fallback)
undici loads node:http2 lazily via a bare require('node:http2'). When
world-vercel is bundled into an ESM server (a custom Vite/Rollup/esbuild build,
or any consumer that doesn't externalize undici), there is no require in scope:
the call throws, undici falls back to a stub with no http2.connect, and every
HTTP/2 request (the events API + stream writes) hangs on a dead connection
through RetryAgent's backoff (~16s) then fails. Framework integrations have been
patching this one bundler at a time with a build banner; a custom or third-party
bundled consumer gets no protection.
Move the defense into the package itself, two layers:
A. Install a working `globalThis.require` (createRequire-backed) at module load
so undici's bare require resolves the real node:http2 regardless of how a
consumer bundles us. Guarded to a no-op wherever a real require already
exists.
B. Detect whether node:http2 is actually usable and, if not, build the H2
dispatchers with allowH2:false and warn once — so requests degrade to working
HTTP/1.1 instead of silently failing.
Exports isHttp2Available() and shouldFallBackToH1() with unit coverage,
including a simulated bundled-undici stub (http2 without connect).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6988e7f

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

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production144202301672
✅ 💻 Local Development160502191824
✅ 📦 Local Production160502191824
✅ 🐘 Local Postgres159302311824
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7282010788360

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nextjs-turbopack14903
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.047s (-2.5%)1.007s (~)0.960s101.00x
💻 LocalExpress0.048s (+3.2%)1.005s (~)0.957s101.03x
💻 LocalNext.js (Turbopack)0.049s (+0.8%)1.007s (~)0.958s101.05x
🐘 PostgresNext.js (Turbopack)0.065s (+5.5% 🔺)1.013s (~)0.948s101.39x
🐘 PostgresNitro0.070s (+9.9% 🔺)1.012s (~)0.942s101.49x
🐘 PostgresExpress0.076s (+15.6% 🔺)1.012s (~)0.936s101.63x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.082s (~)2.006s (~)0.924s101.00x
💻 LocalNitro1.082s (~)2.007s (~)0.925s101.00x
💻 LocalNext.js (Turbopack)1.086s (+0.6%)2.006s (~)0.920s101.00x
🐘 PostgresNitro1.094s (~)2.009s (~)0.915s101.01x
🐘 PostgresExpress1.098s (~)2.012s (~)0.913s101.02x
🐘 PostgresNext.js (Turbopack)1.101s (-0.5%)2.010s (~)0.909s101.02x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.437s (~)11.023s (~)0.586s31.00x
🐘 PostgresNitro10.440s (~)11.012s (~)0.572s31.00x
💻 LocalNitro10.459s (~)11.022s (~)0.563s31.00x
💻 LocalNext.js (Turbopack)10.462s (~)11.022s (~)0.560s31.00x
🐘 PostgresExpress10.476s (~)11.019s (~)0.543s31.00x
🐘 PostgresNext.js (Turbopack)10.556s (~)11.024s (~)0.468s31.01x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro13.544s (~)14.019s (~)0.474s51.00x
💻 LocalExpress13.588s (~)14.028s (~)0.440s51.00x
💻 LocalNitro13.631s (~)14.027s (~)0.397s51.01x
🐘 PostgresExpress13.674s (-1.1%)14.019s (~)0.345s51.01x
🐘 PostgresNext.js (Turbopack)13.759s (~)14.025s (~)0.266s51.02x
💻 LocalNext.js (Turbopack)13.775s (+0.9%)14.027s (~)0.252s51.02x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express12.134s (~)13.025s (~)0.891s71.00x
🐘 PostgresExpress12.213s (~)13.017s (~)0.805s71.01x
💻 LocalNext.js (Turbopack)12.354s (+1.6%)13.024s (~)0.671s71.02x
💻 LocalNitro12.406s (+2.3%)13.024s (~)0.618s71.02x
🐘 PostgresNitro12.498s (+2.8%)13.159s (+1.1%)0.661s71.03x
🐘 PostgresNext.js (Turbopack)12.503s (+0.7%)13.020s (~)0.517s71.03x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.165s (-1.4%)2.008s (~)0.843s151.00x
🐘 PostgresExpress1.176s (~)2.007s (~)0.831s151.01x
🐘 PostgresNext.js (Turbopack)1.211s (~)2.011s (~)0.800s151.04x
💻 LocalNitro1.400s (~)2.006s (~)0.607s151.20x
💻 LocalExpress1.438s (+3.2%)2.006s (~)0.568s151.23x
💻 LocalNext.js (Turbopack)1.454s (-2.2%)2.007s (-3.2%)0.552s151.25x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.282s (-2.9%)2.316s (-7.7% 🟢)1.034s131.00x
🐘 PostgresNext.js (Turbopack)1.337s (-0.6%)3.110s (+3.3%)1.772s101.04x
🐘 PostgresExpress1.386s (+4.0%)2.737s (+14.4% 🔺)1.351s111.08x
💻 LocalExpress2.576s (+4.1%)3.009s (~)0.433s102.01x
💻 LocalNitro2.592s (+2.7%)2.917s (-3.0%)0.325s112.02x
💻 LocalNext.js (Turbopack)2.657s (+3.4%)3.109s (+3.3%)0.451s102.07x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.558s (-3.6%)4.010s (~)2.452s81.00x
🐘 PostgresExpress1.634s (~)4.136s (-3.8%)2.502s81.05x
🐘 PostgresNext.js (Turbopack)3.567s (+41.5% 🔺)8.529s (+54.7% 🔺)4.962s42.29x
💻 LocalNitro6.142s (+18.3% 🔺)6.620s (+13.2% 🔺)0.477s53.94x
💻 LocalExpress6.758s (+23.9% 🔺)7.217s (+16.1% 🔺)0.459s54.34x
💻 LocalNext.js (Turbopack)8.060s (+16.4% 🔺)8.769s (+18.2% 🔺)0.709s45.17x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.177s (-0.7%)2.008s (~)0.831s151.00x
🐘 PostgresNext.js (Turbopack)1.203s (-1.1%)2.009s (~)0.806s151.02x
🐘 PostgresNitro1.301s (+10.2% 🔺)2.074s (+3.3%)0.773s151.10x
💻 LocalExpress1.411s (+2.3%)2.007s (~)0.595s151.20x
💻 LocalNitro1.436s (-0.9%)2.007s (~)0.571s151.22x
💻 LocalNext.js (Turbopack)1.470s (+2.7%)2.007s (~)0.537s151.25x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.317s (~)2.508s (+12.8% 🔺)1.191s121.00x
🐘 PostgresNitro1.337s (+2.0%)2.394s (+3.3%)1.057s131.02x
🐘 PostgresNext.js (Turbopack)1.337s (~)3.011s (-3.1%)1.673s101.02x
💻 LocalNitro2.538s (-5.2% 🟢)3.009s (~)0.471s101.93x
💻 LocalExpress2.616s (+2.2%)3.109s (+3.3%)0.493s101.99x
💻 LocalNext.js (Turbopack)2.847s (+4.3%)3.208s (+3.2%)0.361s102.16x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.573s (-3.9%)4.135s (~)2.562s81.00x
🐘 PostgresExpress1.641s (+1.5%)4.014s (-3.0%)2.373s81.04x
🐘 PostgresNext.js (Turbopack)3.370s (+1.1%)6.618s (+10.0% 🔺)3.249s52.14x
💻 LocalNitro6.183s (-6.1% 🟢)7.015s (-2.8%)0.832s53.93x
💻 LocalNext.js (Turbopack)6.571s (+27.7% 🔺)7.217s (+27.1% 🔺)0.646s54.18x
💻 LocalExpress7.391s (+18.0% 🔺)8.019s (+21.3% 🔺)0.629s44.70x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.536s (-2.3%)1.006s (~)0.470s601.00x
💻 LocalExpress0.573s (+2.0%)1.005s (-1.6%)0.433s601.07x
🐘 PostgresNext.js (Turbopack)0.595s (+3.8%)1.008s (~)0.412s601.11x
💻 LocalNext.js (Turbopack)0.601s (+3.4%)1.005s (-1.7%)0.404s601.12x
🐘 PostgresNitro0.602s (+8.4% 🔺)1.077s (+3.5%)0.475s571.12x
💻 LocalNitro0.636s (+16.5% 🔺)1.022s (+1.7%)0.386s591.19x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.275s (-3.7%)2.007s (~)0.732s451.00x
🐘 PostgresExpress1.278s (-3.4%)2.008s (-1.1%)0.729s451.00x
🐘 PostgresNext.js (Turbopack)1.386s (-4.1%)2.007s (-1.1%)0.621s451.09x
💻 LocalNitro1.493s (+7.5% 🔺)2.006s (~)0.513s451.17x
💻 LocalExpress1.511s (+9.3% 🔺)2.051s (+2.3%)0.540s451.19x
💻 LocalNext.js (Turbopack)1.513s (+8.8% 🔺)2.006s (~)0.493s451.19x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.483s (-3.6%)3.033s (-1.7%)0.550s401.00x
🐘 PostgresExpress2.631s (-2.8%)3.085s (-1.7%)0.454s391.06x
🐘 PostgresNext.js (Turbopack)2.803s (~)3.059s (+1.6%)0.255s401.13x
💻 LocalExpress3.229s (+8.8% 🔺)4.010s (+21.3% 🔺)0.781s301.30x
💻 LocalNitro3.255s (+7.5% 🔺)3.945s (+10.6% 🔺)0.690s311.31x
💻 LocalNext.js (Turbopack)3.369s (+9.7% 🔺)4.043s (+9.1% 🔺)0.673s301.36x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.199s (+8.0% 🔺)1.007s (~)0.808s601.00x
🐘 PostgresNitro0.212s (~)1.006s (~)0.794s601.07x
🐘 PostgresExpress0.216s (+3.3%)1.006s (~)0.790s601.09x
💻 LocalNitro0.468s (+1.7%)1.005s (~)0.537s602.35x
💻 LocalExpress0.504s (+18.9% 🔺)1.022s (+1.8%)0.518s592.54x
💻 LocalNext.js (Turbopack)0.635s (+5.7% 🔺)1.005s (~)0.370s603.20x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.309s (~)1.030s (+2.3%)0.720s881.00x
🐘 PostgresNitro0.319s (~)1.006s (~)0.687s901.03x
🐘 PostgresExpress0.331s (+3.8%)1.006s (~)0.675s901.07x
💻 LocalExpress2.083s (-3.4%)2.714s (-0.8%)0.631s346.73x
💻 LocalNitro2.111s (-0.7%)2.656s (-5.0% 🟢)0.545s346.82x
💻 LocalNext.js (Turbopack)2.724s (-2.1%)3.223s (+4.8%)0.499s288.80x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.537s (-1.0%)3.086s (+2.5%)2.549s391.00x
🐘 PostgresExpress0.550s (+5.7% 🔺)1.059s (+1.8%)0.509s1141.03x
🐘 PostgresNitro0.563s (+3.6%)1.136s (+6.4% 🔺)0.574s1081.05x
💻 LocalNext.js (Turbopack)9.793s (-8.7% 🟢)10.699s (-5.3% 🟢)0.906s1218.24x
💻 LocalNitro10.012s (+11.2% 🔺)10.939s (+8.2% 🔺)0.927s1118.64x
💻 LocalExpress10.125s (+8.5% 🔺)11.118s (+6.4% 🔺)0.993s1118.86x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.142s (+0.9%)1.966s (~)0.012s (+16.7% 🔺)2.019s (~)0.877s101.00x
🐘 PostgresNitro1.152s (~)1.997s (~)0.001s (-23.1% 🟢)2.011s (~)0.859s101.01x
💻 LocalExpress1.157s (+1.1%)2.004s (~)0.012s (+28.7% 🔺)2.020s (~)0.862s101.01x
💻 LocalNitro1.160s (+1.8%)2.004s (~)0.012s (+9.3% 🔺)2.019s (~)0.859s101.02x
🐘 PostgresExpress1.161s (-0.6%)2.000s (~)0.001s (-29.4% 🟢)2.011s (~)0.851s101.02x
🐘 PostgresNext.js (Turbopack)1.174s (~)2.001s (~)0.001s (-8.3% 🟢)2.011s (~)0.837s101.03x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.536s (+1.2%)2.010s (~)0.012s (-6.8% 🟢)2.025s (~)0.489s301.00x
🐘 PostgresNitro1.537s (-1.0%)2.002s (~)0.005s (+8.8% 🔺)2.026s (~)0.489s301.00x
💻 LocalNitro1.544s (+1.9%)2.010s (~)0.012s (-3.3%)2.025s (~)0.481s301.01x
💻 LocalNext.js (Turbopack)1.576s (+3.3%)1.970s (~)0.014s (~)2.027s (~)0.451s301.03x
🐘 PostgresExpress1.577s (-2.6%)2.006s (-1.5%)0.005s (+9.1% 🔺)2.026s (-1.7%)0.449s301.03x
🐘 PostgresNext.js (Turbopack)1.658s (+2.2%)2.017s (~)0.005s (~)2.034s (~)0.376s301.08x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.749s (-3.5%)1.062s (-1.5%)0.000s (+Infinity% 🔺)1.078s (-2.5%)0.329s561.00x
🐘 PostgresExpress0.758s (-6.9% 🟢)1.028s (-6.7% 🟢)0.000s (+Infinity% 🔺)1.050s (-6.1% 🟢)0.292s581.01x
🐘 PostgresNext.js (Turbopack)0.977s (-5.7% 🟢)1.354s (-5.2% 🟢)0.000s (NaN%)1.372s (-4.5%)0.395s451.30x
💻 LocalNitro1.256s (-1.2%)1.980s (+1.7%)0.000s (+85.7% 🔺)1.983s (+1.7%)0.728s311.68x
💻 LocalExpress1.262s (-1.1%)1.948s (-3.1%)0.000s (+10.6% 🔺)1.950s (-3.2%)0.689s311.68x
💻 LocalNext.js (Turbopack)1.392s (+5.0% 🔺)1.979s (~)0.001s (+400.0% 🔺)2.017s (~)0.624s301.86x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.674s (-3.8%)2.253s (-3.7%)0.000s (+Infinity% 🔺)2.269s (-4.4%)0.595s271.00x
🐘 PostgresNitro1.809s (+5.1% 🔺)2.435s (+4.1%)0.000s (+Infinity% 🔺)2.450s (+4.0%)0.641s251.08x
🐘 PostgresNext.js (Turbopack)2.411s (-8.1% 🟢)2.952s (-6.6% 🟢)0.000s (-100.0% 🟢)2.962s (-6.5% 🟢)0.551s211.44x
💻 LocalExpress3.435s (+8.5% 🔺)4.093s (+9.8% 🔺)0.001s (-11.0% 🟢)4.097s (+9.8% 🔺)0.661s152.05x
💻 LocalNext.js (Turbopack)3.453s (+8.5% 🔺)3.989s (+11.6% 🔺)0.001s (-49.6% 🟢)4.032s (+11.4% 🔺)0.578s152.06x
💻 LocalNitro3.642s (+3.5%)4.092s (-3.2%)0.001s (+70.0% 🔺)4.099s (-3.1%)0.458s152.17x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress11/21
🐘 PostgresNitro12/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres14/21
Next.js (Turbopack)🐘 Postgres15/21
Nitro🐘 Postgres18/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)
  • 🌐 Platformatic: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

…-vercel)
world-vercel installs the global `require` shim itself (and falls back to H1
when node:http2 is unreachable), so the per-bundler banners in the nitro and
sveltekit integrations are redundant. Remove them; their e2e-vercel-prod lanes
(nitro, vite, tanstack-start via nitro; sveltekit) now validate that
world-vercel's built-in shim carries those bundles on its own.
The @workflow/web banner is intentionally kept for now — workflow-web has no
e2e coverage, so it stays as belt-and-suspenders until a deployed-web smoke
test exists.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the load-time `node:http2` capability probe (which checked
`globalThis.require`, the wrong binding — it false-positives in bundlers like
nitro/rollup where undici's `require` is a tool-injected per-chunk binding the
global never reaches, so it kept H2 on and still hung) with a runtime fallback.
`fetchWithH2Fallback(path, ...)` issues the request over the H2 dispatcher and,
on the bundling failure signature (`http2.connect is not a function` —
detected via `isHttp2ConnectUnavailableError`), retries the same request on an
HTTP/1.1 dispatcher and latches the downgrade process-wide so later requests
skip the dead H2 attempt and its ~16s connect-retry backoff. The connect
failure is pre-send, so the replay is safe even for the non-idempotent stream
writes; the stream fallback preserves STREAM_RETRY_OPTIONS (never retries 5xx).
This recovers regardless of how the bundler bound undici's `require`, unlike
the probe. Layer A (the global `require` self-install) stays as a best-effort
H2 preserver; the framework banners remain for full H2 perf where we ship a
builder. Routes v4 events and stream write/close through the new helper.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@VaguelySeriousVaguelySerious changed the title [world-vercel] Best-effort HTTP/2 bundling backstop (global require + H1 fallback)[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM serversJun 26, 2026
Sign up for freeto 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

@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); [world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers by VaguelySerious · Pull Request #2633 · vercel/workflow · GitHub
Skip to content

[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers - #2633

Open
VaguelySerious wants to merge 4 commits into
mainfrom
peter/world-vercel-h2-resilient
Open

[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM servers#2633
VaguelySerious wants to merge 4 commits into
mainfrom
peter/world-vercel-h2-resilient

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problem

When @workflow/world-vercel is bundled into an ESM server output (a custom Vite/Rollup/esbuild build, or a framework integration that doesn't externalize undici), undici's lazy require('node:http2') can be left un-wired. undici swallows the failure and falls back to a stub whose http2.connect is undefined, so the first HTTP/2 connect throws http2.connect is not a function — surfacing (after undici's ~16s connect-retry backoff) as a failed request. On the events/stream H2 paths this silently breaks observability reads (and stream writes) for any such consumer.

What this does

A runtime HTTP/2 → HTTP/1.1 fallback, plus a best-effort H2 preserver:

  • fetchWithH2Fallback(path, …) issues the request over the H2 dispatcher and, on the bundling failure signature (isHttp2ConnectUnavailableError), retries the same request on an HTTP/1.1 dispatcher and latches the downgrade process-wide so later requests skip the dead H2 attempt and its ~16s backoff. The connect failure is pre-send, so replaying is safe even for the non-idempotent stream writes — and the stream fallback preserves STREAM_RETRY_OPTIONS (never retries 5xx). v4 events and stream write/close now route through this helper.
  • Layer A (global require self-install) stays as a best-effort H2 preserver: where undici's bundled require is a free identifier it restores real H2; where it isn't (notably nitro/rollup per-chunk bindings) the runtime fallback covers correctness.

Why the previous load-time probe was replaced

The earlier approach probed globalThis.require('node:http2') at load time to decide whether to keep H2. That checks the wrong binding: in bundlers like nitro/rollup undici's require resolves to a tool-injected per-chunk binding the global never reaches, so the probe false-positived (saw H2 "available", kept allowH2: true) and the request still hung. The runtime fallback triggers on the actual connect failure, so it recovers regardless of how the bundler bound undici's require.

The framework build banners (@workflow/sveltekit, @workflow/nitro, @workflow/web) remain the way to keep full H2 performance in the bundlers we ship a builder for; this is the correctness catch-all for consumers we don't.

Verification

  • Full @workflow/world-vercel suite green (182 tests), typecheck + lint clean.
  • New unit tests: isHttp2ConnectUnavailableError signature matching (incl. minified .connect, non-match on ECONNREFUSED/unrelated/nullish); fetchWithH2Fallback retry-on-distinct-H1-dispatcher, downgrade latching, stream-policy preservation, non-H2 rethrow, override-verbatim.
  • End-to-end against real undici: forced undici onto the stub path (http2.connect = undefined) against a dual h1/h2 server — fetchWithH2Fallback('events', …) returns 200 over HTTP/1.1 after the H2 backoff (call update docs sidebar to auto expand #1 ~15.6s), and call Home tweaks #2 is ~9ms (latched to H1).

🤖 Generated with Claude Code

… fallback)
undici loads node:http2 lazily via a bare require('node:http2'). When
world-vercel is bundled into an ESM server (a custom Vite/Rollup/esbuild build,
or any consumer that doesn't externalize undici), there is no require in scope:
the call throws, undici falls back to a stub with no http2.connect, and every
HTTP/2 request (the events API + stream writes) hangs on a dead connection
through RetryAgent's backoff (~16s) then fails. Framework integrations have been
patching this one bundler at a time with a build banner; a custom or third-party
bundled consumer gets no protection.
Move the defense into the package itself, two layers:
A. Install a working `globalThis.require` (createRequire-backed) at module load
so undici's bare require resolves the real node:http2 regardless of how a
consumer bundles us. Guarded to a no-op wherever a real require already
exists.
B. Detect whether node:http2 is actually usable and, if not, build the H2
dispatchers with allowH2:false and warn once — so requests degrade to working
HTTP/1.1 instead of silently failing.
Exports isHttp2Available() and shouldFallBackToH1() with unit coverage,
including a simulated bundled-undici stub (http2 without connect).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6988e7f

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

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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

@vercel

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production144202301672
✅ 💻 Local Development160502191824
✅ 📦 Local Production160502191824
✅ 🐘 Local Postgres159302311824
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7282010788360

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nextjs-turbopack14903
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.047s (-2.5%)1.007s (~)0.960s101.00x
💻 LocalExpress0.048s (+3.2%)1.005s (~)0.957s101.03x
💻 LocalNext.js (Turbopack)0.049s (+0.8%)1.007s (~)0.958s101.05x
🐘 PostgresNext.js (Turbopack)0.065s (+5.5% 🔺)1.013s (~)0.948s101.39x
🐘 PostgresNitro0.070s (+9.9% 🔺)1.012s (~)0.942s101.49x
🐘 PostgresExpress0.076s (+15.6% 🔺)1.012s (~)0.936s101.63x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.082s (~)2.006s (~)0.924s101.00x
💻 LocalNitro1.082s (~)2.007s (~)0.925s101.00x
💻 LocalNext.js (Turbopack)1.086s (+0.6%)2.006s (~)0.920s101.00x
🐘 PostgresNitro1.094s (~)2.009s (~)0.915s101.01x
🐘 PostgresExpress1.098s (~)2.012s (~)0.913s101.02x
🐘 PostgresNext.js (Turbopack)1.101s (-0.5%)2.010s (~)0.909s101.02x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.437s (~)11.023s (~)0.586s31.00x
🐘 PostgresNitro10.440s (~)11.012s (~)0.572s31.00x
💻 LocalNitro10.459s (~)11.022s (~)0.563s31.00x
💻 LocalNext.js (Turbopack)10.462s (~)11.022s (~)0.560s31.00x
🐘 PostgresExpress10.476s (~)11.019s (~)0.543s31.00x
🐘 PostgresNext.js (Turbopack)10.556s (~)11.024s (~)0.468s31.01x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro13.544s (~)14.019s (~)0.474s51.00x
💻 LocalExpress13.588s (~)14.028s (~)0.440s51.00x
💻 LocalNitro13.631s (~)14.027s (~)0.397s51.01x
🐘 PostgresExpress13.674s (-1.1%)14.019s (~)0.345s51.01x
🐘 PostgresNext.js (Turbopack)13.759s (~)14.025s (~)0.266s51.02x
💻 LocalNext.js (Turbopack)13.775s (+0.9%)14.027s (~)0.252s51.02x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express12.134s (~)13.025s (~)0.891s71.00x
🐘 PostgresExpress12.213s (~)13.017s (~)0.805s71.01x
💻 LocalNext.js (Turbopack)12.354s (+1.6%)13.024s (~)0.671s71.02x
💻 LocalNitro12.406s (+2.3%)13.024s (~)0.618s71.02x
🐘 PostgresNitro12.498s (+2.8%)13.159s (+1.1%)0.661s71.03x
🐘 PostgresNext.js (Turbopack)12.503s (+0.7%)13.020s (~)0.517s71.03x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.165s (-1.4%)2.008s (~)0.843s151.00x
🐘 PostgresExpress1.176s (~)2.007s (~)0.831s151.01x
🐘 PostgresNext.js (Turbopack)1.211s (~)2.011s (~)0.800s151.04x
💻 LocalNitro1.400s (~)2.006s (~)0.607s151.20x
💻 LocalExpress1.438s (+3.2%)2.006s (~)0.568s151.23x
💻 LocalNext.js (Turbopack)1.454s (-2.2%)2.007s (-3.2%)0.552s151.25x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.282s (-2.9%)2.316s (-7.7% 🟢)1.034s131.00x
🐘 PostgresNext.js (Turbopack)1.337s (-0.6%)3.110s (+3.3%)1.772s101.04x
🐘 PostgresExpress1.386s (+4.0%)2.737s (+14.4% 🔺)1.351s111.08x
💻 LocalExpress2.576s (+4.1%)3.009s (~)0.433s102.01x
💻 LocalNitro2.592s (+2.7%)2.917s (-3.0%)0.325s112.02x
💻 LocalNext.js (Turbopack)2.657s (+3.4%)3.109s (+3.3%)0.451s102.07x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.558s (-3.6%)4.010s (~)2.452s81.00x
🐘 PostgresExpress1.634s (~)4.136s (-3.8%)2.502s81.05x
🐘 PostgresNext.js (Turbopack)3.567s (+41.5% 🔺)8.529s (+54.7% 🔺)4.962s42.29x
💻 LocalNitro6.142s (+18.3% 🔺)6.620s (+13.2% 🔺)0.477s53.94x
💻 LocalExpress6.758s (+23.9% 🔺)7.217s (+16.1% 🔺)0.459s54.34x
💻 LocalNext.js (Turbopack)8.060s (+16.4% 🔺)8.769s (+18.2% 🔺)0.709s45.17x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.177s (-0.7%)2.008s (~)0.831s151.00x
🐘 PostgresNext.js (Turbopack)1.203s (-1.1%)2.009s (~)0.806s151.02x
🐘 PostgresNitro1.301s (+10.2% 🔺)2.074s (+3.3%)0.773s151.10x
💻 LocalExpress1.411s (+2.3%)2.007s (~)0.595s151.20x
💻 LocalNitro1.436s (-0.9%)2.007s (~)0.571s151.22x
💻 LocalNext.js (Turbopack)1.470s (+2.7%)2.007s (~)0.537s151.25x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.317s (~)2.508s (+12.8% 🔺)1.191s121.00x
🐘 PostgresNitro1.337s (+2.0%)2.394s (+3.3%)1.057s131.02x
🐘 PostgresNext.js (Turbopack)1.337s (~)3.011s (-3.1%)1.673s101.02x
💻 LocalNitro2.538s (-5.2% 🟢)3.009s (~)0.471s101.93x
💻 LocalExpress2.616s (+2.2%)3.109s (+3.3%)0.493s101.99x
💻 LocalNext.js (Turbopack)2.847s (+4.3%)3.208s (+3.2%)0.361s102.16x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.573s (-3.9%)4.135s (~)2.562s81.00x
🐘 PostgresExpress1.641s (+1.5%)4.014s (-3.0%)2.373s81.04x
🐘 PostgresNext.js (Turbopack)3.370s (+1.1%)6.618s (+10.0% 🔺)3.249s52.14x
💻 LocalNitro6.183s (-6.1% 🟢)7.015s (-2.8%)0.832s53.93x
💻 LocalNext.js (Turbopack)6.571s (+27.7% 🔺)7.217s (+27.1% 🔺)0.646s54.18x
💻 LocalExpress7.391s (+18.0% 🔺)8.019s (+21.3% 🔺)0.629s44.70x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.536s (-2.3%)1.006s (~)0.470s601.00x
💻 LocalExpress0.573s (+2.0%)1.005s (-1.6%)0.433s601.07x
🐘 PostgresNext.js (Turbopack)0.595s (+3.8%)1.008s (~)0.412s601.11x
💻 LocalNext.js (Turbopack)0.601s (+3.4%)1.005s (-1.7%)0.404s601.12x
🐘 PostgresNitro0.602s (+8.4% 🔺)1.077s (+3.5%)0.475s571.12x
💻 LocalNitro0.636s (+16.5% 🔺)1.022s (+1.7%)0.386s591.19x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.275s (-3.7%)2.007s (~)0.732s451.00x
🐘 PostgresExpress1.278s (-3.4%)2.008s (-1.1%)0.729s451.00x
🐘 PostgresNext.js (Turbopack)1.386s (-4.1%)2.007s (-1.1%)0.621s451.09x
💻 LocalNitro1.493s (+7.5% 🔺)2.006s (~)0.513s451.17x
💻 LocalExpress1.511s (+9.3% 🔺)2.051s (+2.3%)0.540s451.19x
💻 LocalNext.js (Turbopack)1.513s (+8.8% 🔺)2.006s (~)0.493s451.19x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.483s (-3.6%)3.033s (-1.7%)0.550s401.00x
🐘 PostgresExpress2.631s (-2.8%)3.085s (-1.7%)0.454s391.06x
🐘 PostgresNext.js (Turbopack)2.803s (~)3.059s (+1.6%)0.255s401.13x
💻 LocalExpress3.229s (+8.8% 🔺)4.010s (+21.3% 🔺)0.781s301.30x
💻 LocalNitro3.255s (+7.5% 🔺)3.945s (+10.6% 🔺)0.690s311.31x
💻 LocalNext.js (Turbopack)3.369s (+9.7% 🔺)4.043s (+9.1% 🔺)0.673s301.36x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.199s (+8.0% 🔺)1.007s (~)0.808s601.00x
🐘 PostgresNitro0.212s (~)1.006s (~)0.794s601.07x
🐘 PostgresExpress0.216s (+3.3%)1.006s (~)0.790s601.09x
💻 LocalNitro0.468s (+1.7%)1.005s (~)0.537s602.35x
💻 LocalExpress0.504s (+18.9% 🔺)1.022s (+1.8%)0.518s592.54x
💻 LocalNext.js (Turbopack)0.635s (+5.7% 🔺)1.005s (~)0.370s603.20x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.309s (~)1.030s (+2.3%)0.720s881.00x
🐘 PostgresNitro0.319s (~)1.006s (~)0.687s901.03x
🐘 PostgresExpress0.331s (+3.8%)1.006s (~)0.675s901.07x
💻 LocalExpress2.083s (-3.4%)2.714s (-0.8%)0.631s346.73x
💻 LocalNitro2.111s (-0.7%)2.656s (-5.0% 🟢)0.545s346.82x
💻 LocalNext.js (Turbopack)2.724s (-2.1%)3.223s (+4.8%)0.499s288.80x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.537s (-1.0%)3.086s (+2.5%)2.549s391.00x
🐘 PostgresExpress0.550s (+5.7% 🔺)1.059s (+1.8%)0.509s1141.03x
🐘 PostgresNitro0.563s (+3.6%)1.136s (+6.4% 🔺)0.574s1081.05x
💻 LocalNext.js (Turbopack)9.793s (-8.7% 🟢)10.699s (-5.3% 🟢)0.906s1218.24x
💻 LocalNitro10.012s (+11.2% 🔺)10.939s (+8.2% 🔺)0.927s1118.64x
💻 LocalExpress10.125s (+8.5% 🔺)11.118s (+6.4% 🔺)0.993s1118.86x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.142s (+0.9%)1.966s (~)0.012s (+16.7% 🔺)2.019s (~)0.877s101.00x
🐘 PostgresNitro1.152s (~)1.997s (~)0.001s (-23.1% 🟢)2.011s (~)0.859s101.01x
💻 LocalExpress1.157s (+1.1%)2.004s (~)0.012s (+28.7% 🔺)2.020s (~)0.862s101.01x
💻 LocalNitro1.160s (+1.8%)2.004s (~)0.012s (+9.3% 🔺)2.019s (~)0.859s101.02x
🐘 PostgresExpress1.161s (-0.6%)2.000s (~)0.001s (-29.4% 🟢)2.011s (~)0.851s101.02x
🐘 PostgresNext.js (Turbopack)1.174s (~)2.001s (~)0.001s (-8.3% 🟢)2.011s (~)0.837s101.03x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.536s (+1.2%)2.010s (~)0.012s (-6.8% 🟢)2.025s (~)0.489s301.00x
🐘 PostgresNitro1.537s (-1.0%)2.002s (~)0.005s (+8.8% 🔺)2.026s (~)0.489s301.00x
💻 LocalNitro1.544s (+1.9%)2.010s (~)0.012s (-3.3%)2.025s (~)0.481s301.01x
💻 LocalNext.js (Turbopack)1.576s (+3.3%)1.970s (~)0.014s (~)2.027s (~)0.451s301.03x
🐘 PostgresExpress1.577s (-2.6%)2.006s (-1.5%)0.005s (+9.1% 🔺)2.026s (-1.7%)0.449s301.03x
🐘 PostgresNext.js (Turbopack)1.658s (+2.2%)2.017s (~)0.005s (~)2.034s (~)0.376s301.08x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.749s (-3.5%)1.062s (-1.5%)0.000s (+Infinity% 🔺)1.078s (-2.5%)0.329s561.00x
🐘 PostgresExpress0.758s (-6.9% 🟢)1.028s (-6.7% 🟢)0.000s (+Infinity% 🔺)1.050s (-6.1% 🟢)0.292s581.01x
🐘 PostgresNext.js (Turbopack)0.977s (-5.7% 🟢)1.354s (-5.2% 🟢)0.000s (NaN%)1.372s (-4.5%)0.395s451.30x
💻 LocalNitro1.256s (-1.2%)1.980s (+1.7%)0.000s (+85.7% 🔺)1.983s (+1.7%)0.728s311.68x
💻 LocalExpress1.262s (-1.1%)1.948s (-3.1%)0.000s (+10.6% 🔺)1.950s (-3.2%)0.689s311.68x
💻 LocalNext.js (Turbopack)1.392s (+5.0% 🔺)1.979s (~)0.001s (+400.0% 🔺)2.017s (~)0.624s301.86x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.674s (-3.8%)2.253s (-3.7%)0.000s (+Infinity% 🔺)2.269s (-4.4%)0.595s271.00x
🐘 PostgresNitro1.809s (+5.1% 🔺)2.435s (+4.1%)0.000s (+Infinity% 🔺)2.450s (+4.0%)0.641s251.08x
🐘 PostgresNext.js (Turbopack)2.411s (-8.1% 🟢)2.952s (-6.6% 🟢)0.000s (-100.0% 🟢)2.962s (-6.5% 🟢)0.551s211.44x
💻 LocalExpress3.435s (+8.5% 🔺)4.093s (+9.8% 🔺)0.001s (-11.0% 🟢)4.097s (+9.8% 🔺)0.661s152.05x
💻 LocalNext.js (Turbopack)3.453s (+8.5% 🔺)3.989s (+11.6% 🔺)0.001s (-49.6% 🟢)4.032s (+11.4% 🔺)0.578s152.06x
💻 LocalNitro3.642s (+3.5%)4.092s (-3.2%)0.001s (+70.0% 🔺)4.099s (-3.1%)0.458s152.17x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress11/21
🐘 PostgresNitro12/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres14/21
Next.js (Turbopack)🐘 Postgres15/21
Nitro🐘 Postgres18/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)
  • 🌐 Platformatic: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

…-vercel)
world-vercel installs the global `require` shim itself (and falls back to H1
when node:http2 is unreachable), so the per-bundler banners in the nitro and
sveltekit integrations are redundant. Remove them; their e2e-vercel-prod lanes
(nitro, vite, tanstack-start via nitro; sveltekit) now validate that
world-vercel's built-in shim carries those bundles on its own.
The @workflow/web banner is intentionally kept for now — workflow-web has no
e2e coverage, so it stays as belt-and-suspenders until a deployed-web smoke
test exists.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the load-time `node:http2` capability probe (which checked
`globalThis.require`, the wrong binding — it false-positives in bundlers like
nitro/rollup where undici's `require` is a tool-injected per-chunk binding the
global never reaches, so it kept H2 on and still hung) with a runtime fallback.
`fetchWithH2Fallback(path, ...)` issues the request over the H2 dispatcher and,
on the bundling failure signature (`http2.connect is not a function` —
detected via `isHttp2ConnectUnavailableError`), retries the same request on an
HTTP/1.1 dispatcher and latches the downgrade process-wide so later requests
skip the dead H2 attempt and its ~16s connect-retry backoff. The connect
failure is pre-send, so the replay is safe even for the non-idempotent stream
writes; the stream fallback preserves STREAM_RETRY_OPTIONS (never retries 5xx).
This recovers regardless of how the bundler bound undici's `require`, unlike
the probe. Layer A (the global `require` self-install) stays as a best-effort
H2 preserver; the framework banners remain for full H2 perf where we ship a
builder. Routes v4 events and stream write/close through the new helper.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@VaguelySeriousVaguelySerious changed the title [world-vercel] Best-effort HTTP/2 bundling backstop (global require + H1 fallback)[world-vercel] Runtime HTTP/2 → HTTP/1.1 fallback for bundled ESM serversJun 26, 2026
Sign up for freeto 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

@VaguelySerious