fix: add Request and Response revivers to web and CLI hydration#1414
fix: add Request and Response revivers to web and CLI hydration#1414TooTallNate wants to merge 1 commit intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 80c4ae2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
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 |
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express workflow with 25 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 50 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.all with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.race with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
|
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (55 failed)mongodb (3 failed):
redis (2 failed):
turso (50 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
❌ Some E2E test jobs failed:
Check the workflow run for details. |
There was a problem hiding this comment.
Pull request overview
Adds missing hydration revivers for serialized Request/Response objects so observability UIs (web + CLI) can deserialize and display them instead of failing on unknown devalue types.
Changes:
- Add web-side
Request/Responserevivers that create display-friendly objects with the correctconstructor.nameforreact-inspector. - Add CLI-side
Request/Responserevivers intended to reconstruct realRequest/Responseinstances. - Publish patch changesets for
@workflow/web-sharedand@workflow/cli.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/web-shared/src/lib/hydration.ts | Adds web revivers for Request/Response to improve observability UI hydration. |
| packages/cli/src/lib/inspect/hydration.ts | Adds CLI revivers for Request/Response to improve workflow inspect hydration parity. |
| .changeset/puny-oranges-speak.md | Patch release note for both packages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| Request: (value) => | ||
| new Request(value.url, { | ||
| method: value.method, | ||
| headers: new Headers(value.headers), | ||
| body: value.body, | ||
| duplex: value.duplex, | ||
| }), | ||
| Response: (value) => | ||
| new Response(value.body, { | ||
| status: value.status, | ||
| statusText: value.statusText, | ||
| headers: new Headers(value.headers), | ||
| }), |
| Request: (value) => { | ||
| // biome-ignore lint/complexity/useArrowFunction: arrow functions have no .prototype | ||
| const ctor = { Request: function () {} }.Request!; | ||
| const obj = Object.create(ctor.prototype); | ||
| Object.assign(obj, { | ||
| method: value.method, | ||
| url: value.url, | ||
| headers: new Headers(value.headers), | ||
| }); | ||
| return obj; | ||
| }, | ||
| Response: (value) => { | ||
| // biome-ignore lint/complexity/useArrowFunction: arrow functions have no .prototype | ||
| const ctor = { Response: function () {} }.Response!; | ||
| const obj = Object.create(ctor.prototype); | ||
| Object.assign(obj, { | ||
| status: value.status, | ||
| statusText: value.statusText, | ||
| url: value.url, | ||
| headers: new Headers(value.headers), | ||
| redirected: value.redirected, | ||
| type: value.type, | ||
| }); |

Summary
RequestandResponserevivers to the web observability UI hydration (@workflow/web-shared) so serialized Request/Response objects render correctly instead of showing "Unknown type Response"@workflow/cli) for parityconstructor.namefor react-inspector); CLI revivers create realRequest/Responseinstances