Replace eval with JSON.parse in serialization revive helper - #1848

Merged
pranaygp merged 3 commits into
mainfrom
pranaygp/great-austin-e06cf4
Apr 28, 2026
Merged

Replace eval with JSON.parse in serialization revive helper#1848
pranaygp merged 3 commits into
mainfrom
pranaygp/great-austin-e06cf4

Conversation

@pranaygp

@pranaygppranaygp commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Description

The revive() helper in packages/core/src/serialization.ts used (0, eval) to deserialize the output of devalue.stringify() into its flattened-array form (used by v1Compat paths and later consumed by devalue.unflatten). While the input was controlled (always the result of devalue.stringify() called moments earlier), eval is still an unnecessary anti-pattern flagged by the security review.

devalue.stringify() is documented and implemented to always emit valid JSON — special values (undefined, NaN, Infinity, -Infinity, -0) are encoded as negative integer sentinels (-1, -3, -4, -5, -6), and the rest of the structure is ordinary JSON. devalue.parse() itself internally does unflatten(JSON.parse(serialized)). So JSON.parse is a safe drop-in replacement.

Note: devalue 5.6.3 does not export a public flatten() function (only unflatten), so the stringify-then-parse approach is retained — just without eval.

How did you test your changes?

  • Ran pnpm vitest run src/serialization.test.ts in packages/core. 116 tests pass; 7 DOMException failures are pre-existing on main (verified via git stash) and unrelated to this change.
  • No new tests needed: the v1Compat dehydrator paths exercised by existing serialization tests round-trip through revive().

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)
  • 📝 Ping @vercel/workflow in a comment once the PR is ready, and the above checklist is complete

devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings April 24, 2026 00:37
@changeset-bot

changeset-botBot commented Apr 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3c7e59a

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

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

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 Apr 24, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, CommentApr 28, 2026 10:28pm
example-nextjs-workflow-webpackReadyReadyPreview, CommentApr 28, 2026 10:28pm
example-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-astro-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-express-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-fastify-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-hono-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-nitro-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-nuxt-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-sveltekit-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-vite-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workflow-docsReadyReadyPreview, Comment, Open in v0Apr 28, 2026 10:28pm
workflow-swc-playgroundReadyReadyPreview, CommentApr 28, 2026 10:28pm
workflow-webReadyReadyPreview, CommentApr 28, 2026 10:28pm

Comment thread.changeset/no-eval-in-revive.md Outdated
@@ -0,0 +1,6 @@
---
"@workflow/core": patch
"workflow": patch

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't add workflow to changeset. that's implicit from deps like @workflow/core

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in e2da618.

@github-actions

github-actionsBot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production9780671045
✅ 💻 Local Development10540861140
✅ 📦 Local Production10540861140
✅ 🐘 Local Postgres10540861140
✅ 🪟 Windows950095
✅ 📋 Other267018285
Total450203434845

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro8807
✅ example8807
✅ express8807
✅ fastify8807
✅ hono8807
✅ nextjs-turbopack9302
✅ nextjs-webpack9302
✅ nitro8807
✅ nuxt8807
✅ sveltekit8807
✅ vite8807
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack9500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable8906
✅ e2e-local-postgres-nest-stable8906
✅ e2e-local-prod-nest-stable8906

📋 View full workflow run

@github-actions

github-actionsBot commented Apr 24, 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🥇 Next.js (Turbopack)0.039s1.007s0.968s101.00x
💻 LocalNitro0.040s (-6.3% 🟢)1.005s (~)0.964s101.03x
💻 LocalExpress0.041s (-7.2% 🟢)1.005s (~)0.964s101.05x
🐘 PostgresNext.js (Turbopack)0.056s1.009s0.953s101.44x
🐘 PostgresNitro0.060s (-37.4% 🟢)1.010s (-3.2%)0.950s101.52x
🐘 PostgresExpress0.060s (+4.1%)1.009s (~)0.949s101.54x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.089s2.006s0.916s101.00x
💻 LocalExpress1.128s (~)2.006s (~)0.877s101.04x
💻 LocalNitro1.128s (~)2.005s (~)0.877s101.04x
🐘 PostgresNext.js (Turbopack)1.131s2.009s0.879s101.04x
🐘 PostgresExpress1.139s (-0.6%)2.010s (~)0.870s101.05x
🐘 PostgresNitro1.143s (~)2.009s (~)0.867s101.05x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.637s11.023s0.386s31.00x
🐘 PostgresNitro10.847s (~)11.020s (~)0.173s31.02x
🐘 PostgresNext.js (Turbopack)10.863s11.024s0.161s31.02x
🐘 PostgresExpress10.871s (-0.8%)11.023s (~)0.152s31.02x
💻 LocalNitro10.931s (~)11.023s (~)0.093s31.03x
💻 LocalExpress10.934s (~)11.023s (~)0.089s31.03x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)14.138s15.029s0.890s41.00x
🐘 PostgresNitro14.523s (~)15.022s (~)0.499s41.03x
🐘 PostgresExpress14.557s (~)15.026s (~)0.470s41.03x
🐘 PostgresNext.js (Turbopack)14.571s15.026s0.455s41.03x
💻 LocalNitro14.964s (-0.7%)15.028s (-6.3% 🟢)0.064s41.06x
💻 LocalExpress15.002s (~)15.280s (+1.7%)0.277s41.06x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)13.913s14.454s0.541s71.00x
🐘 PostgresNitro13.951s (~)14.164s (-1.0%)0.213s71.00x
🐘 PostgresExpress14.135s (+0.9%)14.737s (+1.0%)0.602s71.02x
💻 LocalNext.js (Turbopack)14.733s15.027s0.294s61.06x
💻 LocalNitro16.728s (~)17.030s (~)0.302s61.20x
💻 LocalExpress16.756s (+0.9%)17.032s (~)0.276s61.20x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.223s2.009s0.786s151.00x
🐘 PostgresExpress1.268s (+0.6%)2.010s (~)0.742s151.04x
🐘 PostgresNitro1.274s (~)2.010s (~)0.737s151.04x
💻 LocalNext.js (Turbopack)1.455s2.005s0.550s151.19x
💻 LocalNitro1.524s (-6.6% 🟢)2.007s (-3.2%)0.483s151.25x
💻 LocalExpress1.536s (+3.2%)2.006s (~)0.470s151.26x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.333s (-0.8%)3.008s (~)0.675s101.00x
🐘 PostgresExpress2.360s (~)3.008s (~)0.648s101.01x
🐘 PostgresNext.js (Turbopack)2.374s3.009s0.635s101.02x
💻 LocalNext.js (Turbopack)2.587s3.007s0.420s101.11x
💻 LocalNitro2.973s (-5.4% 🟢)3.564s (-8.3% 🟢)0.591s91.27x
💻 LocalExpress3.029s (+2.6%)3.676s (+6.4% 🔺)0.647s91.30x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.479s (~)4.012s (~)0.532s81.00x
🐘 PostgresNitro3.483s (~)4.011s (~)0.528s81.00x
🐘 PostgresNext.js (Turbopack)3.639s4.009s0.371s81.05x
💻 LocalNext.js (Turbopack)6.286s6.813s0.527s51.81x
💻 LocalNitro8.477s (+1.5%)9.021s (~)0.544s42.44x
💻 LocalExpress8.756s (+5.0% 🔺)9.270s (+2.7%)0.513s42.52x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.231s2.008s0.777s151.00x
🐘 PostgresNitro1.259s (~)2.009s (~)0.750s151.02x
🐘 PostgresExpress1.289s (+2.5%)2.008s (~)0.719s151.05x
💻 LocalNext.js (Turbopack)1.453s2.006s0.553s151.18x
💻 LocalExpress1.547s (-18.3% 🟢)2.005s (-15.2% 🟢)0.458s151.26x
💻 LocalNitro1.555s (-16.6% 🟢)2.006s (-14.3% 🟢)0.450s151.26x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.326s (-0.6%)3.010s (~)0.684s101.00x
🐘 PostgresNext.js (Turbopack)2.392s3.009s0.617s101.03x
🐘 PostgresExpress2.409s (+2.9%)3.013s (~)0.603s101.04x
💻 LocalNext.js (Turbopack)2.672s3.008s0.336s101.15x
💻 LocalNitro3.038s (-0.9%)3.884s (~)0.846s81.31x
💻 LocalExpress3.102s (-1.0%)4.011s (+6.6% 🔺)0.910s81.33x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.468s (~)4.010s (~)0.542s81.00x
🐘 PostgresExpress3.481s (-0.5%)4.012s (~)0.531s81.00x
🐘 PostgresNext.js (Turbopack)3.646s4.012s0.366s81.05x
💻 LocalNext.js (Turbopack)6.437s7.015s0.578s51.86x
💻 LocalNitro8.681s (-5.1% 🟢)9.022s (-10.0% 🟢)0.341s42.50x
💻 LocalExpress9.027s (+2.6%)9.526s (+2.7%)0.499s42.60x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.671s1.021s0.350s591.00x
🐘 PostgresNext.js (Turbopack)0.794s1.023s0.229s591.18x
🐘 PostgresNitro0.801s (-2.4%)1.006s (~)0.205s601.19x
🐘 PostgresExpress0.841s (~)1.023s (~)0.181s591.25x
💻 LocalNitro0.989s (+0.8%)1.178s (+7.7% 🔺)0.189s521.47x
💻 LocalExpress0.993s (+1.0%)1.281s (+19.1% 🔺)0.288s471.48x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.898s (-1.5%)2.053s (-2.3%)0.155s441.00x
🐘 PostgresNext.js (Turbopack)1.922s2.100s0.179s431.01x
🐘 PostgresExpress1.930s (-2.4%)2.123s (-6.0% 🟢)0.193s431.02x
💻 LocalNext.js (Turbopack)2.129s3.007s0.878s301.12x
💻 LocalNitro3.020s (~)3.729s (-0.8%)0.709s251.59x
💻 LocalExpress3.029s (~)3.586s (~)0.557s261.60x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.863s (-5.9% 🟢)4.148s (-9.9% 🟢)0.285s291.00x
🐘 PostgresNext.js (Turbopack)3.881s4.149s0.267s291.00x
🐘 PostgresExpress3.911s (-2.0%)4.147s (-5.1% 🟢)0.236s291.01x
💻 LocalNext.js (Turbopack)7.000s7.425s0.425s171.81x
💻 LocalNitro9.161s (-1.5%)9.864s (-1.5%)0.703s132.37x
💻 LocalExpress9.338s (+1.4%)9.942s (-0.8%)0.603s132.42x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.250s1.007s0.757s601.00x
🐘 PostgresNitro0.287s (+1.2%)1.007s (~)0.721s601.15x
🐘 PostgresExpress0.288s (+2.1%)1.007s (~)0.718s601.15x
💻 LocalNext.js (Turbopack)0.547s1.004s0.457s602.19x
💻 LocalNitro0.573s (-5.2% 🟢)1.021s (~)0.448s592.29x
💻 LocalExpress0.595s (+6.2% 🔺)1.004s (~)0.409s602.38x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.482s1.018s0.536s891.00x
🐘 PostgresExpress0.496s (-2.7%)1.007s (~)0.510s901.03x
🐘 PostgresNitro0.504s (+1.6%)1.007s (~)0.502s901.05x
💻 LocalNext.js (Turbopack)2.388s3.008s0.620s304.96x
💻 LocalNitro2.507s (-1.2%)3.009s (~)0.502s305.21x
💻 LocalExpress2.587s (+2.9%)3.008s (~)0.422s305.37x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.764s1.007s0.243s1201.00x
🐘 PostgresExpress0.793s (-3.2%)1.016s (~)0.223s1191.04x
🐘 PostgresNitro0.796s (+0.7%)1.008s (~)0.212s1201.04x
💻 LocalNext.js (Turbopack)9.109s9.636s0.527s1311.92x
💻 LocalNitro11.000s (-1.7%)11.663s (~)0.663s1114.40x
💻 LocalExpress11.425s (+2.1%)12.030s (+0.7%)0.605s1014.95x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.138s1.003s0.009s1.015s0.878s101.00x
🐘 PostgresNext.js (Turbopack)0.193s1.001s0.001s1.010s0.817s101.40x
🐘 PostgresNitro0.196s (-4.3%)1.000s (~)0.001s (-13.3% 🟢)1.010s (~)0.814s101.43x
💻 LocalExpress0.205s (+2.8%)1.004s (~)0.012s (-1.7%)1.018s (~)0.814s101.49x
🐘 PostgresExpress0.208s (+1.4%)0.993s (-0.6%)0.002s (+12.5% 🔺)1.010s (~)0.803s101.51x
💻 LocalNitro0.213s (~)1.004s (~)0.012s (-4.0%)1.018s (~)0.805s101.55x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.619s (-0.9%)1.005s (~)0.013s (+225.8% 🔺)1.031s (+0.9%)0.413s591.00x
🐘 PostgresExpress0.621s (-1.4%)1.001s (-0.6%)0.013s (+242.5% 🔺)1.030s (+0.7%)0.409s591.00x
🐘 PostgresNext.js (Turbopack)0.640s1.026s0.007s1.041s0.401s581.03x
💻 LocalNitro0.745s (-11.2% 🟢)1.013s (~)0.009s (-2.9%)1.023s (-8.3% 🟢)0.279s591.20x
💻 LocalNext.js (Turbopack)0.768s1.010s0.009s1.226s0.459s491.24x
💻 LocalExpress0.864s (+14.1% 🔺)1.013s (-1.5%)0.010s (+5.2% 🔺)1.118s (+7.5% 🔺)0.254s541.40x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.929s1.112s0.000s1.119s0.190s541.00x
🐘 PostgresExpress0.951s (-1.0%)1.147s (-10.2% 🟢)0.000s (-11.5% 🟢)1.162s (-11.1% 🟢)0.210s521.02x
🐘 PostgresNitro0.973s (~)1.245s (~)0.000s (~)1.257s (~)0.284s481.05x
💻 LocalNext.js (Turbopack)1.161s2.016s0.000s2.019s0.858s301.25x
💻 LocalNitro1.224s (~)2.020s (~)0.000s (+366.7% 🔺)2.022s (~)0.798s301.32x
💻 LocalExpress1.283s (+4.7%)2.022s (~)0.001s (+80.0% 🔺)2.025s (~)0.742s301.38x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.764s (-1.5%)2.139s (~)0.000s (-100.0% 🟢)2.152s (-1.0%)0.388s281.00x
🐘 PostgresNext.js (Turbopack)1.800s2.147s0.000s2.168s0.368s281.02x
🐘 PostgresExpress1.829s (+3.2%)2.176s (~)0.000s (+Infinity% 🔺)2.189s (~)0.360s281.04x
💻 LocalNext.js (Turbopack)3.360s3.968s0.001s3.971s0.611s161.90x
💻 LocalNitro3.518s (+3.9%)4.100s (+1.7%)0.000s (-12.5% 🟢)4.103s (+1.6%)0.585s151.99x
💻 LocalExpress3.568s (+2.9%)4.098s (+1.6%)0.001s (-33.3% 🟢)4.101s (+1.6%)0.533s152.02x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)20/21
🐘 PostgresNext.js (Turbopack)11/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres18/21
Next.js (Turbopack)🐘 Postgres15/21
Nitro🐘 Postgres19/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)

📋 View full workflow run

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@karthikscale3karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix seems straightforward. I will let others take a pass.

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified devalue.stringify() output is always valid JSON — special values (undefined, NaN, ±Infinity, -0, holes, sparse arrays) are encoded as negative integer sentinels (see constants.js: UNDEFINED=-1, HOLE=-2, NAN=-3, POSITIVE_INFINITY=-4, NEGATIVE_INFINITY=-5, NEGATIVE_ZERO=-6, SPARSE=-7), and the top-level short-circuit in stringify.js returns a stringified integer (\${index}`) rather than a raw JS literal. The devalue README's evalguidance applies touneval(), not stringify()devalue.parse()itself is internallyunflatten(JSON.parse(serialized)), so JSON.parseis the canonical way to consumestringify()` output.

Empirically verified JSON.parse and (0, eval)(\(${s})`)produce identical results forundefined, NaN, ±Infinity, -0`, and compound structures containing them.

Non-blocking follow-up: once this lands, the revive() wrapper itself becomes trivial and could be inlined — the 4 call sites could just call JSON.parse(str) directly and the helper deleted. Happy to open a follow-up PR for that.

@pranaygp
pranaygp enabled auto-merge (squash) April 24, 2026 01:46
@pranaygp
pranaygp merged commit 7d07fab into mainApr 28, 2026
155 of 163 checks passed
@pranaygp
pranaygp deleted the pranaygp/great-austin-e06cf4 branch April 28, 2026 22:58
karthikscale3 pushed a commit that referenced this pull request Apr 28, 2026
* Replace eval with JSON.parse in serialization revive helper
devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Drop redundant workflow package from changeset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
karthikscale3 added a commit that referenced this pull request Apr 29, 2026
* Decode typed array stream chunks
* Render decoded stream bytes with raw view
* Render decoded bytes in data inspector
* Use generic byte inspector for streams
* review feedback: narrow stream-display exports, fix tab a11y, add collapseRefs tests
- Remove unused formatStreamChunkForDisplay/sanitizeStreamChunkForDisplay
exports; keep only the formatArrayBufferViewForDisplay path actually used
by DataInspector.
- Replace broken role=tablist/role=tab on the Decoded/Bytes switcher
with aria-pressed toggle-button semantics.
- Export collapseRefs/isBytesDisplay and add regression tests covering
typed-array detection (top-level, nested in object/array/Map/Set,
DataView exclusion).
* Replace eval with JSON.parse in serialization revive helper (#1848)
* Replace eval with JSON.parse in serialization revive helper
devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Drop redundant workflow package from changeset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* Add e2e test for UTF-8 parseable stream chunks
Emits Uint8Array chunks containing multi-byte UTF-8 (Latin Extended,
CJK, emoji, RTL Arabic) plus a UTF-8 encoded JSON document, and
asserts each chunk round-trips through TextDecoder({ fatal: true }).
Exercises the same decode path the web inspector relies on for
typed-array stream values.
Made-with: Cursor
---------
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

5 participants

@pranaygp@TooTallNate@VaguelySerious@karthikscale3
, '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" + '
Skip to content

Replace eval with JSON.parse in serialization revive helper - #1848

Merged
pranaygp merged 3 commits into
mainfrom
pranaygp/great-austin-e06cf4
Apr 28, 2026
Merged

Replace eval with JSON.parse in serialization revive helper#1848
pranaygp merged 3 commits into
mainfrom
pranaygp/great-austin-e06cf4

Conversation

@pranaygp

@pranaygppranaygp commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Description

The revive() helper in packages/core/src/serialization.ts used (0, eval) to deserialize the output of devalue.stringify() into its flattened-array form (used by v1Compat paths and later consumed by devalue.unflatten). While the input was controlled (always the result of devalue.stringify() called moments earlier), eval is still an unnecessary anti-pattern flagged by the security review.

devalue.stringify() is documented and implemented to always emit valid JSON — special values (undefined, NaN, Infinity, -Infinity, -0) are encoded as negative integer sentinels (-1, -3, -4, -5, -6), and the rest of the structure is ordinary JSON. devalue.parse() itself internally does unflatten(JSON.parse(serialized)). So JSON.parse is a safe drop-in replacement.

Note: devalue 5.6.3 does not export a public flatten() function (only unflatten), so the stringify-then-parse approach is retained — just without eval.

How did you test your changes?

  • Ran pnpm vitest run src/serialization.test.ts in packages/core. 116 tests pass; 7 DOMException failures are pre-existing on main (verified via git stash) and unrelated to this change.
  • No new tests needed: the v1Compat dehydrator paths exercised by existing serialization tests round-trip through revive().

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)
  • 📝 Ping @vercel/workflow in a comment once the PR is ready, and the above checklist is complete

devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings April 24, 2026 00:37
@changeset-bot

changeset-botBot commented Apr 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3c7e59a

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

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

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 Apr 24, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, CommentApr 28, 2026 10:28pm
example-nextjs-workflow-webpackReadyReadyPreview, CommentApr 28, 2026 10:28pm
example-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-astro-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-express-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-fastify-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-hono-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-nitro-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-nuxt-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-sveltekit-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-vite-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workflow-docsReadyReadyPreview, Comment, Open in v0Apr 28, 2026 10:28pm
workflow-swc-playgroundReadyReadyPreview, CommentApr 28, 2026 10:28pm
workflow-webReadyReadyPreview, CommentApr 28, 2026 10:28pm

Comment thread.changeset/no-eval-in-revive.md Outdated
@@ -0,0 +1,6 @@
---
"@workflow/core": patch
"workflow": patch

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't add workflow to changeset. that's implicit from deps like @workflow/core

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in e2da618.

@github-actions

github-actionsBot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production9780671045
✅ 💻 Local Development10540861140
✅ 📦 Local Production10540861140
✅ 🐘 Local Postgres10540861140
✅ 🪟 Windows950095
✅ 📋 Other267018285
Total450203434845

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro8807
✅ example8807
✅ express8807
✅ fastify8807
✅ hono8807
✅ nextjs-turbopack9302
✅ nextjs-webpack9302
✅ nitro8807
✅ nuxt8807
✅ sveltekit8807
✅ vite8807
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack9500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable8906
✅ e2e-local-postgres-nest-stable8906
✅ e2e-local-prod-nest-stable8906

📋 View full workflow run

@github-actions

github-actionsBot commented Apr 24, 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🥇 Next.js (Turbopack)0.039s1.007s0.968s101.00x
💻 LocalNitro0.040s (-6.3% 🟢)1.005s (~)0.964s101.03x
💻 LocalExpress0.041s (-7.2% 🟢)1.005s (~)0.964s101.05x
🐘 PostgresNext.js (Turbopack)0.056s1.009s0.953s101.44x
🐘 PostgresNitro0.060s (-37.4% 🟢)1.010s (-3.2%)0.950s101.52x
🐘 PostgresExpress0.060s (+4.1%)1.009s (~)0.949s101.54x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.089s2.006s0.916s101.00x
💻 LocalExpress1.128s (~)2.006s (~)0.877s101.04x
💻 LocalNitro1.128s (~)2.005s (~)0.877s101.04x
🐘 PostgresNext.js (Turbopack)1.131s2.009s0.879s101.04x
🐘 PostgresExpress1.139s (-0.6%)2.010s (~)0.870s101.05x
🐘 PostgresNitro1.143s (~)2.009s (~)0.867s101.05x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.637s11.023s0.386s31.00x
🐘 PostgresNitro10.847s (~)11.020s (~)0.173s31.02x
🐘 PostgresNext.js (Turbopack)10.863s11.024s0.161s31.02x
🐘 PostgresExpress10.871s (-0.8%)11.023s (~)0.152s31.02x
💻 LocalNitro10.931s (~)11.023s (~)0.093s31.03x
💻 LocalExpress10.934s (~)11.023s (~)0.089s31.03x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)14.138s15.029s0.890s41.00x
🐘 PostgresNitro14.523s (~)15.022s (~)0.499s41.03x
🐘 PostgresExpress14.557s (~)15.026s (~)0.470s41.03x
🐘 PostgresNext.js (Turbopack)14.571s15.026s0.455s41.03x
💻 LocalNitro14.964s (-0.7%)15.028s (-6.3% 🟢)0.064s41.06x
💻 LocalExpress15.002s (~)15.280s (+1.7%)0.277s41.06x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)13.913s14.454s0.541s71.00x
🐘 PostgresNitro13.951s (~)14.164s (-1.0%)0.213s71.00x
🐘 PostgresExpress14.135s (+0.9%)14.737s (+1.0%)0.602s71.02x
💻 LocalNext.js (Turbopack)14.733s15.027s0.294s61.06x
💻 LocalNitro16.728s (~)17.030s (~)0.302s61.20x
💻 LocalExpress16.756s (+0.9%)17.032s (~)0.276s61.20x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.223s2.009s0.786s151.00x
🐘 PostgresExpress1.268s (+0.6%)2.010s (~)0.742s151.04x
🐘 PostgresNitro1.274s (~)2.010s (~)0.737s151.04x
💻 LocalNext.js (Turbopack)1.455s2.005s0.550s151.19x
💻 LocalNitro1.524s (-6.6% 🟢)2.007s (-3.2%)0.483s151.25x
💻 LocalExpress1.536s (+3.2%)2.006s (~)0.470s151.26x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.333s (-0.8%)3.008s (~)0.675s101.00x
🐘 PostgresExpress2.360s (~)3.008s (~)0.648s101.01x
🐘 PostgresNext.js (Turbopack)2.374s3.009s0.635s101.02x
💻 LocalNext.js (Turbopack)2.587s3.007s0.420s101.11x
💻 LocalNitro2.973s (-5.4% 🟢)3.564s (-8.3% 🟢)0.591s91.27x
💻 LocalExpress3.029s (+2.6%)3.676s (+6.4% 🔺)0.647s91.30x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.479s (~)4.012s (~)0.532s81.00x
🐘 PostgresNitro3.483s (~)4.011s (~)0.528s81.00x
🐘 PostgresNext.js (Turbopack)3.639s4.009s0.371s81.05x
💻 LocalNext.js (Turbopack)6.286s6.813s0.527s51.81x
💻 LocalNitro8.477s (+1.5%)9.021s (~)0.544s42.44x
💻 LocalExpress8.756s (+5.0% 🔺)9.270s (+2.7%)0.513s42.52x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.231s2.008s0.777s151.00x
🐘 PostgresNitro1.259s (~)2.009s (~)0.750s151.02x
🐘 PostgresExpress1.289s (+2.5%)2.008s (~)0.719s151.05x
💻 LocalNext.js (Turbopack)1.453s2.006s0.553s151.18x
💻 LocalExpress1.547s (-18.3% 🟢)2.005s (-15.2% 🟢)0.458s151.26x
💻 LocalNitro1.555s (-16.6% 🟢)2.006s (-14.3% 🟢)0.450s151.26x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.326s (-0.6%)3.010s (~)0.684s101.00x
🐘 PostgresNext.js (Turbopack)2.392s3.009s0.617s101.03x
🐘 PostgresExpress2.409s (+2.9%)3.013s (~)0.603s101.04x
💻 LocalNext.js (Turbopack)2.672s3.008s0.336s101.15x
💻 LocalNitro3.038s (-0.9%)3.884s (~)0.846s81.31x
💻 LocalExpress3.102s (-1.0%)4.011s (+6.6% 🔺)0.910s81.33x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.468s (~)4.010s (~)0.542s81.00x
🐘 PostgresExpress3.481s (-0.5%)4.012s (~)0.531s81.00x
🐘 PostgresNext.js (Turbopack)3.646s4.012s0.366s81.05x
💻 LocalNext.js (Turbopack)6.437s7.015s0.578s51.86x
💻 LocalNitro8.681s (-5.1% 🟢)9.022s (-10.0% 🟢)0.341s42.50x
💻 LocalExpress9.027s (+2.6%)9.526s (+2.7%)0.499s42.60x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.671s1.021s0.350s591.00x
🐘 PostgresNext.js (Turbopack)0.794s1.023s0.229s591.18x
🐘 PostgresNitro0.801s (-2.4%)1.006s (~)0.205s601.19x
🐘 PostgresExpress0.841s (~)1.023s (~)0.181s591.25x
💻 LocalNitro0.989s (+0.8%)1.178s (+7.7% 🔺)0.189s521.47x
💻 LocalExpress0.993s (+1.0%)1.281s (+19.1% 🔺)0.288s471.48x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.898s (-1.5%)2.053s (-2.3%)0.155s441.00x
🐘 PostgresNext.js (Turbopack)1.922s2.100s0.179s431.01x
🐘 PostgresExpress1.930s (-2.4%)2.123s (-6.0% 🟢)0.193s431.02x
💻 LocalNext.js (Turbopack)2.129s3.007s0.878s301.12x
💻 LocalNitro3.020s (~)3.729s (-0.8%)0.709s251.59x
💻 LocalExpress3.029s (~)3.586s (~)0.557s261.60x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.863s (-5.9% 🟢)4.148s (-9.9% 🟢)0.285s291.00x
🐘 PostgresNext.js (Turbopack)3.881s4.149s0.267s291.00x
🐘 PostgresExpress3.911s (-2.0%)4.147s (-5.1% 🟢)0.236s291.01x
💻 LocalNext.js (Turbopack)7.000s7.425s0.425s171.81x
💻 LocalNitro9.161s (-1.5%)9.864s (-1.5%)0.703s132.37x
💻 LocalExpress9.338s (+1.4%)9.942s (-0.8%)0.603s132.42x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.250s1.007s0.757s601.00x
🐘 PostgresNitro0.287s (+1.2%)1.007s (~)0.721s601.15x
🐘 PostgresExpress0.288s (+2.1%)1.007s (~)0.718s601.15x
💻 LocalNext.js (Turbopack)0.547s1.004s0.457s602.19x
💻 LocalNitro0.573s (-5.2% 🟢)1.021s (~)0.448s592.29x
💻 LocalExpress0.595s (+6.2% 🔺)1.004s (~)0.409s602.38x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.482s1.018s0.536s891.00x
🐘 PostgresExpress0.496s (-2.7%)1.007s (~)0.510s901.03x
🐘 PostgresNitro0.504s (+1.6%)1.007s (~)0.502s901.05x
💻 LocalNext.js (Turbopack)2.388s3.008s0.620s304.96x
💻 LocalNitro2.507s (-1.2%)3.009s (~)0.502s305.21x
💻 LocalExpress2.587s (+2.9%)3.008s (~)0.422s305.37x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.764s1.007s0.243s1201.00x
🐘 PostgresExpress0.793s (-3.2%)1.016s (~)0.223s1191.04x
🐘 PostgresNitro0.796s (+0.7%)1.008s (~)0.212s1201.04x
💻 LocalNext.js (Turbopack)9.109s9.636s0.527s1311.92x
💻 LocalNitro11.000s (-1.7%)11.663s (~)0.663s1114.40x
💻 LocalExpress11.425s (+2.1%)12.030s (+0.7%)0.605s1014.95x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.138s1.003s0.009s1.015s0.878s101.00x
🐘 PostgresNext.js (Turbopack)0.193s1.001s0.001s1.010s0.817s101.40x
🐘 PostgresNitro0.196s (-4.3%)1.000s (~)0.001s (-13.3% 🟢)1.010s (~)0.814s101.43x
💻 LocalExpress0.205s (+2.8%)1.004s (~)0.012s (-1.7%)1.018s (~)0.814s101.49x
🐘 PostgresExpress0.208s (+1.4%)0.993s (-0.6%)0.002s (+12.5% 🔺)1.010s (~)0.803s101.51x
💻 LocalNitro0.213s (~)1.004s (~)0.012s (-4.0%)1.018s (~)0.805s101.55x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.619s (-0.9%)1.005s (~)0.013s (+225.8% 🔺)1.031s (+0.9%)0.413s591.00x
🐘 PostgresExpress0.621s (-1.4%)1.001s (-0.6%)0.013s (+242.5% 🔺)1.030s (+0.7%)0.409s591.00x
🐘 PostgresNext.js (Turbopack)0.640s1.026s0.007s1.041s0.401s581.03x
💻 LocalNitro0.745s (-11.2% 🟢)1.013s (~)0.009s (-2.9%)1.023s (-8.3% 🟢)0.279s591.20x
💻 LocalNext.js (Turbopack)0.768s1.010s0.009s1.226s0.459s491.24x
💻 LocalExpress0.864s (+14.1% 🔺)1.013s (-1.5%)0.010s (+5.2% 🔺)1.118s (+7.5% 🔺)0.254s541.40x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.929s1.112s0.000s1.119s0.190s541.00x
🐘 PostgresExpress0.951s (-1.0%)1.147s (-10.2% 🟢)0.000s (-11.5% 🟢)1.162s (-11.1% 🟢)0.210s521.02x
🐘 PostgresNitro0.973s (~)1.245s (~)0.000s (~)1.257s (~)0.284s481.05x
💻 LocalNext.js (Turbopack)1.161s2.016s0.000s2.019s0.858s301.25x
💻 LocalNitro1.224s (~)2.020s (~)0.000s (+366.7% 🔺)2.022s (~)0.798s301.32x
💻 LocalExpress1.283s (+4.7%)2.022s (~)0.001s (+80.0% 🔺)2.025s (~)0.742s301.38x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.764s (-1.5%)2.139s (~)0.000s (-100.0% 🟢)2.152s (-1.0%)0.388s281.00x
🐘 PostgresNext.js (Turbopack)1.800s2.147s0.000s2.168s0.368s281.02x
🐘 PostgresExpress1.829s (+3.2%)2.176s (~)0.000s (+Infinity% 🔺)2.189s (~)0.360s281.04x
💻 LocalNext.js (Turbopack)3.360s3.968s0.001s3.971s0.611s161.90x
💻 LocalNitro3.518s (+3.9%)4.100s (+1.7%)0.000s (-12.5% 🟢)4.103s (+1.6%)0.585s151.99x
💻 LocalExpress3.568s (+2.9%)4.098s (+1.6%)0.001s (-33.3% 🟢)4.101s (+1.6%)0.533s152.02x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)20/21
🐘 PostgresNext.js (Turbopack)11/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres18/21
Next.js (Turbopack)🐘 Postgres15/21
Nitro🐘 Postgres19/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)

📋 View full workflow run

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@karthikscale3karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix seems straightforward. I will let others take a pass.

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified devalue.stringify() output is always valid JSON — special values (undefined, NaN, ±Infinity, -0, holes, sparse arrays) are encoded as negative integer sentinels (see constants.js: UNDEFINED=-1, HOLE=-2, NAN=-3, POSITIVE_INFINITY=-4, NEGATIVE_INFINITY=-5, NEGATIVE_ZERO=-6, SPARSE=-7), and the top-level short-circuit in stringify.js returns a stringified integer (\${index}`) rather than a raw JS literal. The devalue README's evalguidance applies touneval(), not stringify()devalue.parse()itself is internallyunflatten(JSON.parse(serialized)), so JSON.parseis the canonical way to consumestringify()` output.

Empirically verified JSON.parse and (0, eval)(\(${s})`)produce identical results forundefined, NaN, ±Infinity, -0`, and compound structures containing them.

Non-blocking follow-up: once this lands, the revive() wrapper itself becomes trivial and could be inlined — the 4 call sites could just call JSON.parse(str) directly and the helper deleted. Happy to open a follow-up PR for that.

@pranaygp
pranaygp enabled auto-merge (squash) April 24, 2026 01:46
@pranaygp
pranaygp merged commit 7d07fab into mainApr 28, 2026
155 of 163 checks passed
@pranaygp
pranaygp deleted the pranaygp/great-austin-e06cf4 branch April 28, 2026 22:58
karthikscale3 pushed a commit that referenced this pull request Apr 28, 2026
* Replace eval with JSON.parse in serialization revive helper
devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Drop redundant workflow package from changeset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
karthikscale3 added a commit that referenced this pull request Apr 29, 2026
* Decode typed array stream chunks
* Render decoded stream bytes with raw view
* Render decoded bytes in data inspector
* Use generic byte inspector for streams
* review feedback: narrow stream-display exports, fix tab a11y, add collapseRefs tests
- Remove unused formatStreamChunkForDisplay/sanitizeStreamChunkForDisplay
exports; keep only the formatArrayBufferViewForDisplay path actually used
by DataInspector.
- Replace broken role=tablist/role=tab on the Decoded/Bytes switcher
with aria-pressed toggle-button semantics.
- Export collapseRefs/isBytesDisplay and add regression tests covering
typed-array detection (top-level, nested in object/array/Map/Set,
DataView exclusion).
* Replace eval with JSON.parse in serialization revive helper (#1848)
* Replace eval with JSON.parse in serialization revive helper
devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Drop redundant workflow package from changeset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* Add e2e test for UTF-8 parseable stream chunks
Emits Uint8Array chunks containing multi-byte UTF-8 (Latin Extended,
CJK, emoji, RTL Arabic) plus a UTF-8 encoded JSON document, and
asserts each chunk round-trips through TextDecoder({ fatal: true }).
Exercises the same decode path the web inspector relies on for
typed-array stream values.
Made-with: Cursor
---------
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

5 participants

@pranaygp@TooTallNate@VaguelySerious@karthikscale3
, '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('^' + ".*" + '
Skip to content

Replace eval with JSON.parse in serialization revive helper - #1848

Merged
pranaygp merged 3 commits into
mainfrom
pranaygp/great-austin-e06cf4
Apr 28, 2026
Merged

Replace eval with JSON.parse in serialization revive helper#1848
pranaygp merged 3 commits into
mainfrom
pranaygp/great-austin-e06cf4

Conversation

@pranaygp

@pranaygppranaygp commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Description

The revive() helper in packages/core/src/serialization.ts used (0, eval) to deserialize the output of devalue.stringify() into its flattened-array form (used by v1Compat paths and later consumed by devalue.unflatten). While the input was controlled (always the result of devalue.stringify() called moments earlier), eval is still an unnecessary anti-pattern flagged by the security review.

devalue.stringify() is documented and implemented to always emit valid JSON — special values (undefined, NaN, Infinity, -Infinity, -0) are encoded as negative integer sentinels (-1, -3, -4, -5, -6), and the rest of the structure is ordinary JSON. devalue.parse() itself internally does unflatten(JSON.parse(serialized)). So JSON.parse is a safe drop-in replacement.

Note: devalue 5.6.3 does not export a public flatten() function (only unflatten), so the stringify-then-parse approach is retained — just without eval.

How did you test your changes?

  • Ran pnpm vitest run src/serialization.test.ts in packages/core. 116 tests pass; 7 DOMException failures are pre-existing on main (verified via git stash) and unrelated to this change.
  • No new tests needed: the v1Compat dehydrator paths exercised by existing serialization tests round-trip through revive().

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)
  • 📝 Ping @vercel/workflow in a comment once the PR is ready, and the above checklist is complete

devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings April 24, 2026 00:37
@changeset-bot

changeset-botBot commented Apr 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3c7e59a

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

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

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 Apr 24, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, CommentApr 28, 2026 10:28pm
example-nextjs-workflow-webpackReadyReadyPreview, CommentApr 28, 2026 10:28pm
example-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-astro-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-express-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-fastify-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-hono-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-nitro-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-nuxt-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-sveltekit-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-vite-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workflow-docsReadyReadyPreview, Comment, Open in v0Apr 28, 2026 10:28pm
workflow-swc-playgroundReadyReadyPreview, CommentApr 28, 2026 10:28pm
workflow-webReadyReadyPreview, CommentApr 28, 2026 10:28pm

Comment thread.changeset/no-eval-in-revive.md Outdated
@@ -0,0 +1,6 @@
---
"@workflow/core": patch
"workflow": patch

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't add workflow to changeset. that's implicit from deps like @workflow/core

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in e2da618.

@github-actions

github-actionsBot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production9780671045
✅ 💻 Local Development10540861140
✅ 📦 Local Production10540861140
✅ 🐘 Local Postgres10540861140
✅ 🪟 Windows950095
✅ 📋 Other267018285
Total450203434845

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro8807
✅ example8807
✅ express8807
✅ fastify8807
✅ hono8807
✅ nextjs-turbopack9302
✅ nextjs-webpack9302
✅ nitro8807
✅ nuxt8807
✅ sveltekit8807
✅ vite8807
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack9500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable8906
✅ e2e-local-postgres-nest-stable8906
✅ e2e-local-prod-nest-stable8906

📋 View full workflow run

@github-actions

github-actionsBot commented Apr 24, 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🥇 Next.js (Turbopack)0.039s1.007s0.968s101.00x
💻 LocalNitro0.040s (-6.3% 🟢)1.005s (~)0.964s101.03x
💻 LocalExpress0.041s (-7.2% 🟢)1.005s (~)0.964s101.05x
🐘 PostgresNext.js (Turbopack)0.056s1.009s0.953s101.44x
🐘 PostgresNitro0.060s (-37.4% 🟢)1.010s (-3.2%)0.950s101.52x
🐘 PostgresExpress0.060s (+4.1%)1.009s (~)0.949s101.54x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.089s2.006s0.916s101.00x
💻 LocalExpress1.128s (~)2.006s (~)0.877s101.04x
💻 LocalNitro1.128s (~)2.005s (~)0.877s101.04x
🐘 PostgresNext.js (Turbopack)1.131s2.009s0.879s101.04x
🐘 PostgresExpress1.139s (-0.6%)2.010s (~)0.870s101.05x
🐘 PostgresNitro1.143s (~)2.009s (~)0.867s101.05x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.637s11.023s0.386s31.00x
🐘 PostgresNitro10.847s (~)11.020s (~)0.173s31.02x
🐘 PostgresNext.js (Turbopack)10.863s11.024s0.161s31.02x
🐘 PostgresExpress10.871s (-0.8%)11.023s (~)0.152s31.02x
💻 LocalNitro10.931s (~)11.023s (~)0.093s31.03x
💻 LocalExpress10.934s (~)11.023s (~)0.089s31.03x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)14.138s15.029s0.890s41.00x
🐘 PostgresNitro14.523s (~)15.022s (~)0.499s41.03x
🐘 PostgresExpress14.557s (~)15.026s (~)0.470s41.03x
🐘 PostgresNext.js (Turbopack)14.571s15.026s0.455s41.03x
💻 LocalNitro14.964s (-0.7%)15.028s (-6.3% 🟢)0.064s41.06x
💻 LocalExpress15.002s (~)15.280s (+1.7%)0.277s41.06x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)13.913s14.454s0.541s71.00x
🐘 PostgresNitro13.951s (~)14.164s (-1.0%)0.213s71.00x
🐘 PostgresExpress14.135s (+0.9%)14.737s (+1.0%)0.602s71.02x
💻 LocalNext.js (Turbopack)14.733s15.027s0.294s61.06x
💻 LocalNitro16.728s (~)17.030s (~)0.302s61.20x
💻 LocalExpress16.756s (+0.9%)17.032s (~)0.276s61.20x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.223s2.009s0.786s151.00x
🐘 PostgresExpress1.268s (+0.6%)2.010s (~)0.742s151.04x
🐘 PostgresNitro1.274s (~)2.010s (~)0.737s151.04x
💻 LocalNext.js (Turbopack)1.455s2.005s0.550s151.19x
💻 LocalNitro1.524s (-6.6% 🟢)2.007s (-3.2%)0.483s151.25x
💻 LocalExpress1.536s (+3.2%)2.006s (~)0.470s151.26x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.333s (-0.8%)3.008s (~)0.675s101.00x
🐘 PostgresExpress2.360s (~)3.008s (~)0.648s101.01x
🐘 PostgresNext.js (Turbopack)2.374s3.009s0.635s101.02x
💻 LocalNext.js (Turbopack)2.587s3.007s0.420s101.11x
💻 LocalNitro2.973s (-5.4% 🟢)3.564s (-8.3% 🟢)0.591s91.27x
💻 LocalExpress3.029s (+2.6%)3.676s (+6.4% 🔺)0.647s91.30x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.479s (~)4.012s (~)0.532s81.00x
🐘 PostgresNitro3.483s (~)4.011s (~)0.528s81.00x
🐘 PostgresNext.js (Turbopack)3.639s4.009s0.371s81.05x
💻 LocalNext.js (Turbopack)6.286s6.813s0.527s51.81x
💻 LocalNitro8.477s (+1.5%)9.021s (~)0.544s42.44x
💻 LocalExpress8.756s (+5.0% 🔺)9.270s (+2.7%)0.513s42.52x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.231s2.008s0.777s151.00x
🐘 PostgresNitro1.259s (~)2.009s (~)0.750s151.02x
🐘 PostgresExpress1.289s (+2.5%)2.008s (~)0.719s151.05x
💻 LocalNext.js (Turbopack)1.453s2.006s0.553s151.18x
💻 LocalExpress1.547s (-18.3% 🟢)2.005s (-15.2% 🟢)0.458s151.26x
💻 LocalNitro1.555s (-16.6% 🟢)2.006s (-14.3% 🟢)0.450s151.26x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.326s (-0.6%)3.010s (~)0.684s101.00x
🐘 PostgresNext.js (Turbopack)2.392s3.009s0.617s101.03x
🐘 PostgresExpress2.409s (+2.9%)3.013s (~)0.603s101.04x
💻 LocalNext.js (Turbopack)2.672s3.008s0.336s101.15x
💻 LocalNitro3.038s (-0.9%)3.884s (~)0.846s81.31x
💻 LocalExpress3.102s (-1.0%)4.011s (+6.6% 🔺)0.910s81.33x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.468s (~)4.010s (~)0.542s81.00x
🐘 PostgresExpress3.481s (-0.5%)4.012s (~)0.531s81.00x
🐘 PostgresNext.js (Turbopack)3.646s4.012s0.366s81.05x
💻 LocalNext.js (Turbopack)6.437s7.015s0.578s51.86x
💻 LocalNitro8.681s (-5.1% 🟢)9.022s (-10.0% 🟢)0.341s42.50x
💻 LocalExpress9.027s (+2.6%)9.526s (+2.7%)0.499s42.60x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.671s1.021s0.350s591.00x
🐘 PostgresNext.js (Turbopack)0.794s1.023s0.229s591.18x
🐘 PostgresNitro0.801s (-2.4%)1.006s (~)0.205s601.19x
🐘 PostgresExpress0.841s (~)1.023s (~)0.181s591.25x
💻 LocalNitro0.989s (+0.8%)1.178s (+7.7% 🔺)0.189s521.47x
💻 LocalExpress0.993s (+1.0%)1.281s (+19.1% 🔺)0.288s471.48x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.898s (-1.5%)2.053s (-2.3%)0.155s441.00x
🐘 PostgresNext.js (Turbopack)1.922s2.100s0.179s431.01x
🐘 PostgresExpress1.930s (-2.4%)2.123s (-6.0% 🟢)0.193s431.02x
💻 LocalNext.js (Turbopack)2.129s3.007s0.878s301.12x
💻 LocalNitro3.020s (~)3.729s (-0.8%)0.709s251.59x
💻 LocalExpress3.029s (~)3.586s (~)0.557s261.60x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.863s (-5.9% 🟢)4.148s (-9.9% 🟢)0.285s291.00x
🐘 PostgresNext.js (Turbopack)3.881s4.149s0.267s291.00x
🐘 PostgresExpress3.911s (-2.0%)4.147s (-5.1% 🟢)0.236s291.01x
💻 LocalNext.js (Turbopack)7.000s7.425s0.425s171.81x
💻 LocalNitro9.161s (-1.5%)9.864s (-1.5%)0.703s132.37x
💻 LocalExpress9.338s (+1.4%)9.942s (-0.8%)0.603s132.42x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.250s1.007s0.757s601.00x
🐘 PostgresNitro0.287s (+1.2%)1.007s (~)0.721s601.15x
🐘 PostgresExpress0.288s (+2.1%)1.007s (~)0.718s601.15x
💻 LocalNext.js (Turbopack)0.547s1.004s0.457s602.19x
💻 LocalNitro0.573s (-5.2% 🟢)1.021s (~)0.448s592.29x
💻 LocalExpress0.595s (+6.2% 🔺)1.004s (~)0.409s602.38x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.482s1.018s0.536s891.00x
🐘 PostgresExpress0.496s (-2.7%)1.007s (~)0.510s901.03x
🐘 PostgresNitro0.504s (+1.6%)1.007s (~)0.502s901.05x
💻 LocalNext.js (Turbopack)2.388s3.008s0.620s304.96x
💻 LocalNitro2.507s (-1.2%)3.009s (~)0.502s305.21x
💻 LocalExpress2.587s (+2.9%)3.008s (~)0.422s305.37x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.764s1.007s0.243s1201.00x
🐘 PostgresExpress0.793s (-3.2%)1.016s (~)0.223s1191.04x
🐘 PostgresNitro0.796s (+0.7%)1.008s (~)0.212s1201.04x
💻 LocalNext.js (Turbopack)9.109s9.636s0.527s1311.92x
💻 LocalNitro11.000s (-1.7%)11.663s (~)0.663s1114.40x
💻 LocalExpress11.425s (+2.1%)12.030s (+0.7%)0.605s1014.95x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.138s1.003s0.009s1.015s0.878s101.00x
🐘 PostgresNext.js (Turbopack)0.193s1.001s0.001s1.010s0.817s101.40x
🐘 PostgresNitro0.196s (-4.3%)1.000s (~)0.001s (-13.3% 🟢)1.010s (~)0.814s101.43x
💻 LocalExpress0.205s (+2.8%)1.004s (~)0.012s (-1.7%)1.018s (~)0.814s101.49x
🐘 PostgresExpress0.208s (+1.4%)0.993s (-0.6%)0.002s (+12.5% 🔺)1.010s (~)0.803s101.51x
💻 LocalNitro0.213s (~)1.004s (~)0.012s (-4.0%)1.018s (~)0.805s101.55x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.619s (-0.9%)1.005s (~)0.013s (+225.8% 🔺)1.031s (+0.9%)0.413s591.00x
🐘 PostgresExpress0.621s (-1.4%)1.001s (-0.6%)0.013s (+242.5% 🔺)1.030s (+0.7%)0.409s591.00x
🐘 PostgresNext.js (Turbopack)0.640s1.026s0.007s1.041s0.401s581.03x
💻 LocalNitro0.745s (-11.2% 🟢)1.013s (~)0.009s (-2.9%)1.023s (-8.3% 🟢)0.279s591.20x
💻 LocalNext.js (Turbopack)0.768s1.010s0.009s1.226s0.459s491.24x
💻 LocalExpress0.864s (+14.1% 🔺)1.013s (-1.5%)0.010s (+5.2% 🔺)1.118s (+7.5% 🔺)0.254s541.40x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.929s1.112s0.000s1.119s0.190s541.00x
🐘 PostgresExpress0.951s (-1.0%)1.147s (-10.2% 🟢)0.000s (-11.5% 🟢)1.162s (-11.1% 🟢)0.210s521.02x
🐘 PostgresNitro0.973s (~)1.245s (~)0.000s (~)1.257s (~)0.284s481.05x
💻 LocalNext.js (Turbopack)1.161s2.016s0.000s2.019s0.858s301.25x
💻 LocalNitro1.224s (~)2.020s (~)0.000s (+366.7% 🔺)2.022s (~)0.798s301.32x
💻 LocalExpress1.283s (+4.7%)2.022s (~)0.001s (+80.0% 🔺)2.025s (~)0.742s301.38x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.764s (-1.5%)2.139s (~)0.000s (-100.0% 🟢)2.152s (-1.0%)0.388s281.00x
🐘 PostgresNext.js (Turbopack)1.800s2.147s0.000s2.168s0.368s281.02x
🐘 PostgresExpress1.829s (+3.2%)2.176s (~)0.000s (+Infinity% 🔺)2.189s (~)0.360s281.04x
💻 LocalNext.js (Turbopack)3.360s3.968s0.001s3.971s0.611s161.90x
💻 LocalNitro3.518s (+3.9%)4.100s (+1.7%)0.000s (-12.5% 🟢)4.103s (+1.6%)0.585s151.99x
💻 LocalExpress3.568s (+2.9%)4.098s (+1.6%)0.001s (-33.3% 🟢)4.101s (+1.6%)0.533s152.02x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)20/21
🐘 PostgresNext.js (Turbopack)11/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres18/21
Next.js (Turbopack)🐘 Postgres15/21
Nitro🐘 Postgres19/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)

📋 View full workflow run

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@karthikscale3karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix seems straightforward. I will let others take a pass.

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified devalue.stringify() output is always valid JSON — special values (undefined, NaN, ±Infinity, -0, holes, sparse arrays) are encoded as negative integer sentinels (see constants.js: UNDEFINED=-1, HOLE=-2, NAN=-3, POSITIVE_INFINITY=-4, NEGATIVE_INFINITY=-5, NEGATIVE_ZERO=-6, SPARSE=-7), and the top-level short-circuit in stringify.js returns a stringified integer (\${index}`) rather than a raw JS literal. The devalue README's evalguidance applies touneval(), not stringify()devalue.parse()itself is internallyunflatten(JSON.parse(serialized)), so JSON.parseis the canonical way to consumestringify()` output.

Empirically verified JSON.parse and (0, eval)(\(${s})`)produce identical results forundefined, NaN, ±Infinity, -0`, and compound structures containing them.

Non-blocking follow-up: once this lands, the revive() wrapper itself becomes trivial and could be inlined — the 4 call sites could just call JSON.parse(str) directly and the helper deleted. Happy to open a follow-up PR for that.

@pranaygp
pranaygp enabled auto-merge (squash) April 24, 2026 01:46
@pranaygp
pranaygp merged commit 7d07fab into mainApr 28, 2026
155 of 163 checks passed
@pranaygp
pranaygp deleted the pranaygp/great-austin-e06cf4 branch April 28, 2026 22:58
karthikscale3 pushed a commit that referenced this pull request Apr 28, 2026
* Replace eval with JSON.parse in serialization revive helper
devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Drop redundant workflow package from changeset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
karthikscale3 added a commit that referenced this pull request Apr 29, 2026
* Decode typed array stream chunks
* Render decoded stream bytes with raw view
* Render decoded bytes in data inspector
* Use generic byte inspector for streams
* review feedback: narrow stream-display exports, fix tab a11y, add collapseRefs tests
- Remove unused formatStreamChunkForDisplay/sanitizeStreamChunkForDisplay
exports; keep only the formatArrayBufferViewForDisplay path actually used
by DataInspector.
- Replace broken role=tablist/role=tab on the Decoded/Bytes switcher
with aria-pressed toggle-button semantics.
- Export collapseRefs/isBytesDisplay and add regression tests covering
typed-array detection (top-level, nested in object/array/Map/Set,
DataView exclusion).
* Replace eval with JSON.parse in serialization revive helper (#1848)
* Replace eval with JSON.parse in serialization revive helper
devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Drop redundant workflow package from changeset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* Add e2e test for UTF-8 parseable stream chunks
Emits Uint8Array chunks containing multi-byte UTF-8 (Latin Extended,
CJK, emoji, RTL Arabic) plus a UTF-8 encoded JSON document, and
asserts each chunk round-trips through TextDecoder({ fatal: true }).
Exercises the same decode path the web inspector relies on for
typed-array stream values.
Made-with: Cursor
---------
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

5 participants

@pranaygp@TooTallNate@VaguelySerious@karthikscale3
, '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('^' + ".*" + '
Skip to content

Replace eval with JSON.parse in serialization revive helper - #1848

Merged
pranaygp merged 3 commits into
mainfrom
pranaygp/great-austin-e06cf4
Apr 28, 2026
Merged

Replace eval with JSON.parse in serialization revive helper#1848
pranaygp merged 3 commits into
mainfrom
pranaygp/great-austin-e06cf4

Conversation

@pranaygp

@pranaygppranaygp commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Description

The revive() helper in packages/core/src/serialization.ts used (0, eval) to deserialize the output of devalue.stringify() into its flattened-array form (used by v1Compat paths and later consumed by devalue.unflatten). While the input was controlled (always the result of devalue.stringify() called moments earlier), eval is still an unnecessary anti-pattern flagged by the security review.

devalue.stringify() is documented and implemented to always emit valid JSON — special values (undefined, NaN, Infinity, -Infinity, -0) are encoded as negative integer sentinels (-1, -3, -4, -5, -6), and the rest of the structure is ordinary JSON. devalue.parse() itself internally does unflatten(JSON.parse(serialized)). So JSON.parse is a safe drop-in replacement.

Note: devalue 5.6.3 does not export a public flatten() function (only unflatten), so the stringify-then-parse approach is retained — just without eval.

How did you test your changes?

  • Ran pnpm vitest run src/serialization.test.ts in packages/core. 116 tests pass; 7 DOMException failures are pre-existing on main (verified via git stash) and unrelated to this change.
  • No new tests needed: the v1Compat dehydrator paths exercised by existing serialization tests round-trip through revive().

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)
  • 📝 Ping @vercel/workflow in a comment once the PR is ready, and the above checklist is complete

devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings April 24, 2026 00:37
@changeset-bot

changeset-botBot commented Apr 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3c7e59a

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

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

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 Apr 24, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, CommentApr 28, 2026 10:28pm
example-nextjs-workflow-webpackReadyReadyPreview, CommentApr 28, 2026 10:28pm
example-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-astro-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-express-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-fastify-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-hono-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-nitro-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-nuxt-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-sveltekit-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-vite-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workflow-docsReadyReadyPreview, Comment, Open in v0Apr 28, 2026 10:28pm
workflow-swc-playgroundReadyReadyPreview, CommentApr 28, 2026 10:28pm
workflow-webReadyReadyPreview, CommentApr 28, 2026 10:28pm

Comment thread.changeset/no-eval-in-revive.md Outdated
@@ -0,0 +1,6 @@
---
"@workflow/core": patch
"workflow": patch

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't add workflow to changeset. that's implicit from deps like @workflow/core

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in e2da618.

@github-actions

github-actionsBot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production9780671045
✅ 💻 Local Development10540861140
✅ 📦 Local Production10540861140
✅ 🐘 Local Postgres10540861140
✅ 🪟 Windows950095
✅ 📋 Other267018285
Total450203434845

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro8807
✅ example8807
✅ express8807
✅ fastify8807
✅ hono8807
✅ nextjs-turbopack9302
✅ nextjs-webpack9302
✅ nitro8807
✅ nuxt8807
✅ sveltekit8807
✅ vite8807
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack9500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable8906
✅ e2e-local-postgres-nest-stable8906
✅ e2e-local-prod-nest-stable8906

📋 View full workflow run

@github-actions

github-actionsBot commented Apr 24, 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🥇 Next.js (Turbopack)0.039s1.007s0.968s101.00x
💻 LocalNitro0.040s (-6.3% 🟢)1.005s (~)0.964s101.03x
💻 LocalExpress0.041s (-7.2% 🟢)1.005s (~)0.964s101.05x
🐘 PostgresNext.js (Turbopack)0.056s1.009s0.953s101.44x
🐘 PostgresNitro0.060s (-37.4% 🟢)1.010s (-3.2%)0.950s101.52x
🐘 PostgresExpress0.060s (+4.1%)1.009s (~)0.949s101.54x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.089s2.006s0.916s101.00x
💻 LocalExpress1.128s (~)2.006s (~)0.877s101.04x
💻 LocalNitro1.128s (~)2.005s (~)0.877s101.04x
🐘 PostgresNext.js (Turbopack)1.131s2.009s0.879s101.04x
🐘 PostgresExpress1.139s (-0.6%)2.010s (~)0.870s101.05x
🐘 PostgresNitro1.143s (~)2.009s (~)0.867s101.05x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.637s11.023s0.386s31.00x
🐘 PostgresNitro10.847s (~)11.020s (~)0.173s31.02x
🐘 PostgresNext.js (Turbopack)10.863s11.024s0.161s31.02x
🐘 PostgresExpress10.871s (-0.8%)11.023s (~)0.152s31.02x
💻 LocalNitro10.931s (~)11.023s (~)0.093s31.03x
💻 LocalExpress10.934s (~)11.023s (~)0.089s31.03x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)14.138s15.029s0.890s41.00x
🐘 PostgresNitro14.523s (~)15.022s (~)0.499s41.03x
🐘 PostgresExpress14.557s (~)15.026s (~)0.470s41.03x
🐘 PostgresNext.js (Turbopack)14.571s15.026s0.455s41.03x
💻 LocalNitro14.964s (-0.7%)15.028s (-6.3% 🟢)0.064s41.06x
💻 LocalExpress15.002s (~)15.280s (+1.7%)0.277s41.06x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)13.913s14.454s0.541s71.00x
🐘 PostgresNitro13.951s (~)14.164s (-1.0%)0.213s71.00x
🐘 PostgresExpress14.135s (+0.9%)14.737s (+1.0%)0.602s71.02x
💻 LocalNext.js (Turbopack)14.733s15.027s0.294s61.06x
💻 LocalNitro16.728s (~)17.030s (~)0.302s61.20x
💻 LocalExpress16.756s (+0.9%)17.032s (~)0.276s61.20x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.223s2.009s0.786s151.00x
🐘 PostgresExpress1.268s (+0.6%)2.010s (~)0.742s151.04x
🐘 PostgresNitro1.274s (~)2.010s (~)0.737s151.04x
💻 LocalNext.js (Turbopack)1.455s2.005s0.550s151.19x
💻 LocalNitro1.524s (-6.6% 🟢)2.007s (-3.2%)0.483s151.25x
💻 LocalExpress1.536s (+3.2%)2.006s (~)0.470s151.26x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.333s (-0.8%)3.008s (~)0.675s101.00x
🐘 PostgresExpress2.360s (~)3.008s (~)0.648s101.01x
🐘 PostgresNext.js (Turbopack)2.374s3.009s0.635s101.02x
💻 LocalNext.js (Turbopack)2.587s3.007s0.420s101.11x
💻 LocalNitro2.973s (-5.4% 🟢)3.564s (-8.3% 🟢)0.591s91.27x
💻 LocalExpress3.029s (+2.6%)3.676s (+6.4% 🔺)0.647s91.30x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.479s (~)4.012s (~)0.532s81.00x
🐘 PostgresNitro3.483s (~)4.011s (~)0.528s81.00x
🐘 PostgresNext.js (Turbopack)3.639s4.009s0.371s81.05x
💻 LocalNext.js (Turbopack)6.286s6.813s0.527s51.81x
💻 LocalNitro8.477s (+1.5%)9.021s (~)0.544s42.44x
💻 LocalExpress8.756s (+5.0% 🔺)9.270s (+2.7%)0.513s42.52x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.231s2.008s0.777s151.00x
🐘 PostgresNitro1.259s (~)2.009s (~)0.750s151.02x
🐘 PostgresExpress1.289s (+2.5%)2.008s (~)0.719s151.05x
💻 LocalNext.js (Turbopack)1.453s2.006s0.553s151.18x
💻 LocalExpress1.547s (-18.3% 🟢)2.005s (-15.2% 🟢)0.458s151.26x
💻 LocalNitro1.555s (-16.6% 🟢)2.006s (-14.3% 🟢)0.450s151.26x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.326s (-0.6%)3.010s (~)0.684s101.00x
🐘 PostgresNext.js (Turbopack)2.392s3.009s0.617s101.03x
🐘 PostgresExpress2.409s (+2.9%)3.013s (~)0.603s101.04x
💻 LocalNext.js (Turbopack)2.672s3.008s0.336s101.15x
💻 LocalNitro3.038s (-0.9%)3.884s (~)0.846s81.31x
💻 LocalExpress3.102s (-1.0%)4.011s (+6.6% 🔺)0.910s81.33x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.468s (~)4.010s (~)0.542s81.00x
🐘 PostgresExpress3.481s (-0.5%)4.012s (~)0.531s81.00x
🐘 PostgresNext.js (Turbopack)3.646s4.012s0.366s81.05x
💻 LocalNext.js (Turbopack)6.437s7.015s0.578s51.86x
💻 LocalNitro8.681s (-5.1% 🟢)9.022s (-10.0% 🟢)0.341s42.50x
💻 LocalExpress9.027s (+2.6%)9.526s (+2.7%)0.499s42.60x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.671s1.021s0.350s591.00x
🐘 PostgresNext.js (Turbopack)0.794s1.023s0.229s591.18x
🐘 PostgresNitro0.801s (-2.4%)1.006s (~)0.205s601.19x
🐘 PostgresExpress0.841s (~)1.023s (~)0.181s591.25x
💻 LocalNitro0.989s (+0.8%)1.178s (+7.7% 🔺)0.189s521.47x
💻 LocalExpress0.993s (+1.0%)1.281s (+19.1% 🔺)0.288s471.48x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.898s (-1.5%)2.053s (-2.3%)0.155s441.00x
🐘 PostgresNext.js (Turbopack)1.922s2.100s0.179s431.01x
🐘 PostgresExpress1.930s (-2.4%)2.123s (-6.0% 🟢)0.193s431.02x
💻 LocalNext.js (Turbopack)2.129s3.007s0.878s301.12x
💻 LocalNitro3.020s (~)3.729s (-0.8%)0.709s251.59x
💻 LocalExpress3.029s (~)3.586s (~)0.557s261.60x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.863s (-5.9% 🟢)4.148s (-9.9% 🟢)0.285s291.00x
🐘 PostgresNext.js (Turbopack)3.881s4.149s0.267s291.00x
🐘 PostgresExpress3.911s (-2.0%)4.147s (-5.1% 🟢)0.236s291.01x
💻 LocalNext.js (Turbopack)7.000s7.425s0.425s171.81x
💻 LocalNitro9.161s (-1.5%)9.864s (-1.5%)0.703s132.37x
💻 LocalExpress9.338s (+1.4%)9.942s (-0.8%)0.603s132.42x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.250s1.007s0.757s601.00x
🐘 PostgresNitro0.287s (+1.2%)1.007s (~)0.721s601.15x
🐘 PostgresExpress0.288s (+2.1%)1.007s (~)0.718s601.15x
💻 LocalNext.js (Turbopack)0.547s1.004s0.457s602.19x
💻 LocalNitro0.573s (-5.2% 🟢)1.021s (~)0.448s592.29x
💻 LocalExpress0.595s (+6.2% 🔺)1.004s (~)0.409s602.38x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.482s1.018s0.536s891.00x
🐘 PostgresExpress0.496s (-2.7%)1.007s (~)0.510s901.03x
🐘 PostgresNitro0.504s (+1.6%)1.007s (~)0.502s901.05x
💻 LocalNext.js (Turbopack)2.388s3.008s0.620s304.96x
💻 LocalNitro2.507s (-1.2%)3.009s (~)0.502s305.21x
💻 LocalExpress2.587s (+2.9%)3.008s (~)0.422s305.37x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.764s1.007s0.243s1201.00x
🐘 PostgresExpress0.793s (-3.2%)1.016s (~)0.223s1191.04x
🐘 PostgresNitro0.796s (+0.7%)1.008s (~)0.212s1201.04x
💻 LocalNext.js (Turbopack)9.109s9.636s0.527s1311.92x
💻 LocalNitro11.000s (-1.7%)11.663s (~)0.663s1114.40x
💻 LocalExpress11.425s (+2.1%)12.030s (+0.7%)0.605s1014.95x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.138s1.003s0.009s1.015s0.878s101.00x
🐘 PostgresNext.js (Turbopack)0.193s1.001s0.001s1.010s0.817s101.40x
🐘 PostgresNitro0.196s (-4.3%)1.000s (~)0.001s (-13.3% 🟢)1.010s (~)0.814s101.43x
💻 LocalExpress0.205s (+2.8%)1.004s (~)0.012s (-1.7%)1.018s (~)0.814s101.49x
🐘 PostgresExpress0.208s (+1.4%)0.993s (-0.6%)0.002s (+12.5% 🔺)1.010s (~)0.803s101.51x
💻 LocalNitro0.213s (~)1.004s (~)0.012s (-4.0%)1.018s (~)0.805s101.55x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.619s (-0.9%)1.005s (~)0.013s (+225.8% 🔺)1.031s (+0.9%)0.413s591.00x
🐘 PostgresExpress0.621s (-1.4%)1.001s (-0.6%)0.013s (+242.5% 🔺)1.030s (+0.7%)0.409s591.00x
🐘 PostgresNext.js (Turbopack)0.640s1.026s0.007s1.041s0.401s581.03x
💻 LocalNitro0.745s (-11.2% 🟢)1.013s (~)0.009s (-2.9%)1.023s (-8.3% 🟢)0.279s591.20x
💻 LocalNext.js (Turbopack)0.768s1.010s0.009s1.226s0.459s491.24x
💻 LocalExpress0.864s (+14.1% 🔺)1.013s (-1.5%)0.010s (+5.2% 🔺)1.118s (+7.5% 🔺)0.254s541.40x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.929s1.112s0.000s1.119s0.190s541.00x
🐘 PostgresExpress0.951s (-1.0%)1.147s (-10.2% 🟢)0.000s (-11.5% 🟢)1.162s (-11.1% 🟢)0.210s521.02x
🐘 PostgresNitro0.973s (~)1.245s (~)0.000s (~)1.257s (~)0.284s481.05x
💻 LocalNext.js (Turbopack)1.161s2.016s0.000s2.019s0.858s301.25x
💻 LocalNitro1.224s (~)2.020s (~)0.000s (+366.7% 🔺)2.022s (~)0.798s301.32x
💻 LocalExpress1.283s (+4.7%)2.022s (~)0.001s (+80.0% 🔺)2.025s (~)0.742s301.38x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.764s (-1.5%)2.139s (~)0.000s (-100.0% 🟢)2.152s (-1.0%)0.388s281.00x
🐘 PostgresNext.js (Turbopack)1.800s2.147s0.000s2.168s0.368s281.02x
🐘 PostgresExpress1.829s (+3.2%)2.176s (~)0.000s (+Infinity% 🔺)2.189s (~)0.360s281.04x
💻 LocalNext.js (Turbopack)3.360s3.968s0.001s3.971s0.611s161.90x
💻 LocalNitro3.518s (+3.9%)4.100s (+1.7%)0.000s (-12.5% 🟢)4.103s (+1.6%)0.585s151.99x
💻 LocalExpress3.568s (+2.9%)4.098s (+1.6%)0.001s (-33.3% 🟢)4.101s (+1.6%)0.533s152.02x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)20/21
🐘 PostgresNext.js (Turbopack)11/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres18/21
Next.js (Turbopack)🐘 Postgres15/21
Nitro🐘 Postgres19/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)

📋 View full workflow run

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@karthikscale3karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix seems straightforward. I will let others take a pass.

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified devalue.stringify() output is always valid JSON — special values (undefined, NaN, ±Infinity, -0, holes, sparse arrays) are encoded as negative integer sentinels (see constants.js: UNDEFINED=-1, HOLE=-2, NAN=-3, POSITIVE_INFINITY=-4, NEGATIVE_INFINITY=-5, NEGATIVE_ZERO=-6, SPARSE=-7), and the top-level short-circuit in stringify.js returns a stringified integer (\${index}`) rather than a raw JS literal. The devalue README's evalguidance applies touneval(), not stringify()devalue.parse()itself is internallyunflatten(JSON.parse(serialized)), so JSON.parseis the canonical way to consumestringify()` output.

Empirically verified JSON.parse and (0, eval)(\(${s})`)produce identical results forundefined, NaN, ±Infinity, -0`, and compound structures containing them.

Non-blocking follow-up: once this lands, the revive() wrapper itself becomes trivial and could be inlined — the 4 call sites could just call JSON.parse(str) directly and the helper deleted. Happy to open a follow-up PR for that.

@pranaygp
pranaygp enabled auto-merge (squash) April 24, 2026 01:46
@pranaygp
pranaygp merged commit 7d07fab into mainApr 28, 2026
155 of 163 checks passed
@pranaygp
pranaygp deleted the pranaygp/great-austin-e06cf4 branch April 28, 2026 22:58
karthikscale3 pushed a commit that referenced this pull request Apr 28, 2026
* Replace eval with JSON.parse in serialization revive helper
devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Drop redundant workflow package from changeset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
karthikscale3 added a commit that referenced this pull request Apr 29, 2026
* Decode typed array stream chunks
* Render decoded stream bytes with raw view
* Render decoded bytes in data inspector
* Use generic byte inspector for streams
* review feedback: narrow stream-display exports, fix tab a11y, add collapseRefs tests
- Remove unused formatStreamChunkForDisplay/sanitizeStreamChunkForDisplay
exports; keep only the formatArrayBufferViewForDisplay path actually used
by DataInspector.
- Replace broken role=tablist/role=tab on the Decoded/Bytes switcher
with aria-pressed toggle-button semantics.
- Export collapseRefs/isBytesDisplay and add regression tests covering
typed-array detection (top-level, nested in object/array/Map/Set,
DataView exclusion).
* Replace eval with JSON.parse in serialization revive helper (#1848)
* Replace eval with JSON.parse in serialization revive helper
devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Drop redundant workflow package from changeset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* Add e2e test for UTF-8 parseable stream chunks
Emits Uint8Array chunks containing multi-byte UTF-8 (Latin Extended,
CJK, emoji, RTL Arabic) plus a UTF-8 encoded JSON document, and
asserts each chunk round-trips through TextDecoder({ fatal: true }).
Exercises the same decode path the web inspector relies on for
typed-array stream values.
Made-with: Cursor
---------
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

5 participants

@pranaygp@TooTallNate@VaguelySerious@karthikscale3
, '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" + '
Skip to content

Replace eval with JSON.parse in serialization revive helper - #1848

Merged
pranaygp merged 3 commits into
mainfrom
pranaygp/great-austin-e06cf4
Apr 28, 2026
Merged

Replace eval with JSON.parse in serialization revive helper#1848
pranaygp merged 3 commits into
mainfrom
pranaygp/great-austin-e06cf4

Conversation

@pranaygp

@pranaygppranaygp commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Description

The revive() helper in packages/core/src/serialization.ts used (0, eval) to deserialize the output of devalue.stringify() into its flattened-array form (used by v1Compat paths and later consumed by devalue.unflatten). While the input was controlled (always the result of devalue.stringify() called moments earlier), eval is still an unnecessary anti-pattern flagged by the security review.

devalue.stringify() is documented and implemented to always emit valid JSON — special values (undefined, NaN, Infinity, -Infinity, -0) are encoded as negative integer sentinels (-1, -3, -4, -5, -6), and the rest of the structure is ordinary JSON. devalue.parse() itself internally does unflatten(JSON.parse(serialized)). So JSON.parse is a safe drop-in replacement.

Note: devalue 5.6.3 does not export a public flatten() function (only unflatten), so the stringify-then-parse approach is retained — just without eval.

How did you test your changes?

  • Ran pnpm vitest run src/serialization.test.ts in packages/core. 116 tests pass; 7 DOMException failures are pre-existing on main (verified via git stash) and unrelated to this change.
  • No new tests needed: the v1Compat dehydrator paths exercised by existing serialization tests round-trip through revive().

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)
  • 📝 Ping @vercel/workflow in a comment once the PR is ready, and the above checklist is complete

devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings April 24, 2026 00:37
@changeset-bot

changeset-botBot commented Apr 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3c7e59a

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

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

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 Apr 24, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, CommentApr 28, 2026 10:28pm
example-nextjs-workflow-webpackReadyReadyPreview, CommentApr 28, 2026 10:28pm
example-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-astro-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-express-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-fastify-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-hono-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-nitro-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-nuxt-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-sveltekit-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-vite-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workflow-docsReadyReadyPreview, Comment, Open in v0Apr 28, 2026 10:28pm
workflow-swc-playgroundReadyReadyPreview, CommentApr 28, 2026 10:28pm
workflow-webReadyReadyPreview, CommentApr 28, 2026 10:28pm

Comment thread.changeset/no-eval-in-revive.md Outdated
@@ -0,0 +1,6 @@
---
"@workflow/core": patch
"workflow": patch

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't add workflow to changeset. that's implicit from deps like @workflow/core

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in e2da618.

@github-actions

github-actionsBot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production9780671045
✅ 💻 Local Development10540861140
✅ 📦 Local Production10540861140
✅ 🐘 Local Postgres10540861140
✅ 🪟 Windows950095
✅ 📋 Other267018285
Total450203434845

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro8807
✅ example8807
✅ express8807
✅ fastify8807
✅ hono8807
✅ nextjs-turbopack9302
✅ nextjs-webpack9302
✅ nitro8807
✅ nuxt8807
✅ sveltekit8807
✅ vite8807
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack9500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable8906
✅ e2e-local-postgres-nest-stable8906
✅ e2e-local-prod-nest-stable8906

📋 View full workflow run

@github-actions

github-actionsBot commented Apr 24, 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🥇 Next.js (Turbopack)0.039s1.007s0.968s101.00x
💻 LocalNitro0.040s (-6.3% 🟢)1.005s (~)0.964s101.03x
💻 LocalExpress0.041s (-7.2% 🟢)1.005s (~)0.964s101.05x
🐘 PostgresNext.js (Turbopack)0.056s1.009s0.953s101.44x
🐘 PostgresNitro0.060s (-37.4% 🟢)1.010s (-3.2%)0.950s101.52x
🐘 PostgresExpress0.060s (+4.1%)1.009s (~)0.949s101.54x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.089s2.006s0.916s101.00x
💻 LocalExpress1.128s (~)2.006s (~)0.877s101.04x
💻 LocalNitro1.128s (~)2.005s (~)0.877s101.04x
🐘 PostgresNext.js (Turbopack)1.131s2.009s0.879s101.04x
🐘 PostgresExpress1.139s (-0.6%)2.010s (~)0.870s101.05x
🐘 PostgresNitro1.143s (~)2.009s (~)0.867s101.05x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.637s11.023s0.386s31.00x
🐘 PostgresNitro10.847s (~)11.020s (~)0.173s31.02x
🐘 PostgresNext.js (Turbopack)10.863s11.024s0.161s31.02x
🐘 PostgresExpress10.871s (-0.8%)11.023s (~)0.152s31.02x
💻 LocalNitro10.931s (~)11.023s (~)0.093s31.03x
💻 LocalExpress10.934s (~)11.023s (~)0.089s31.03x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)14.138s15.029s0.890s41.00x
🐘 PostgresNitro14.523s (~)15.022s (~)0.499s41.03x
🐘 PostgresExpress14.557s (~)15.026s (~)0.470s41.03x
🐘 PostgresNext.js (Turbopack)14.571s15.026s0.455s41.03x
💻 LocalNitro14.964s (-0.7%)15.028s (-6.3% 🟢)0.064s41.06x
💻 LocalExpress15.002s (~)15.280s (+1.7%)0.277s41.06x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)13.913s14.454s0.541s71.00x
🐘 PostgresNitro13.951s (~)14.164s (-1.0%)0.213s71.00x
🐘 PostgresExpress14.135s (+0.9%)14.737s (+1.0%)0.602s71.02x
💻 LocalNext.js (Turbopack)14.733s15.027s0.294s61.06x
💻 LocalNitro16.728s (~)17.030s (~)0.302s61.20x
💻 LocalExpress16.756s (+0.9%)17.032s (~)0.276s61.20x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.223s2.009s0.786s151.00x
🐘 PostgresExpress1.268s (+0.6%)2.010s (~)0.742s151.04x
🐘 PostgresNitro1.274s (~)2.010s (~)0.737s151.04x
💻 LocalNext.js (Turbopack)1.455s2.005s0.550s151.19x
💻 LocalNitro1.524s (-6.6% 🟢)2.007s (-3.2%)0.483s151.25x
💻 LocalExpress1.536s (+3.2%)2.006s (~)0.470s151.26x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.333s (-0.8%)3.008s (~)0.675s101.00x
🐘 PostgresExpress2.360s (~)3.008s (~)0.648s101.01x
🐘 PostgresNext.js (Turbopack)2.374s3.009s0.635s101.02x
💻 LocalNext.js (Turbopack)2.587s3.007s0.420s101.11x
💻 LocalNitro2.973s (-5.4% 🟢)3.564s (-8.3% 🟢)0.591s91.27x
💻 LocalExpress3.029s (+2.6%)3.676s (+6.4% 🔺)0.647s91.30x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.479s (~)4.012s (~)0.532s81.00x
🐘 PostgresNitro3.483s (~)4.011s (~)0.528s81.00x
🐘 PostgresNext.js (Turbopack)3.639s4.009s0.371s81.05x
💻 LocalNext.js (Turbopack)6.286s6.813s0.527s51.81x
💻 LocalNitro8.477s (+1.5%)9.021s (~)0.544s42.44x
💻 LocalExpress8.756s (+5.0% 🔺)9.270s (+2.7%)0.513s42.52x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.231s2.008s0.777s151.00x
🐘 PostgresNitro1.259s (~)2.009s (~)0.750s151.02x
🐘 PostgresExpress1.289s (+2.5%)2.008s (~)0.719s151.05x
💻 LocalNext.js (Turbopack)1.453s2.006s0.553s151.18x
💻 LocalExpress1.547s (-18.3% 🟢)2.005s (-15.2% 🟢)0.458s151.26x
💻 LocalNitro1.555s (-16.6% 🟢)2.006s (-14.3% 🟢)0.450s151.26x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.326s (-0.6%)3.010s (~)0.684s101.00x
🐘 PostgresNext.js (Turbopack)2.392s3.009s0.617s101.03x
🐘 PostgresExpress2.409s (+2.9%)3.013s (~)0.603s101.04x
💻 LocalNext.js (Turbopack)2.672s3.008s0.336s101.15x
💻 LocalNitro3.038s (-0.9%)3.884s (~)0.846s81.31x
💻 LocalExpress3.102s (-1.0%)4.011s (+6.6% 🔺)0.910s81.33x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.468s (~)4.010s (~)0.542s81.00x
🐘 PostgresExpress3.481s (-0.5%)4.012s (~)0.531s81.00x
🐘 PostgresNext.js (Turbopack)3.646s4.012s0.366s81.05x
💻 LocalNext.js (Turbopack)6.437s7.015s0.578s51.86x
💻 LocalNitro8.681s (-5.1% 🟢)9.022s (-10.0% 🟢)0.341s42.50x
💻 LocalExpress9.027s (+2.6%)9.526s (+2.7%)0.499s42.60x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.671s1.021s0.350s591.00x
🐘 PostgresNext.js (Turbopack)0.794s1.023s0.229s591.18x
🐘 PostgresNitro0.801s (-2.4%)1.006s (~)0.205s601.19x
🐘 PostgresExpress0.841s (~)1.023s (~)0.181s591.25x
💻 LocalNitro0.989s (+0.8%)1.178s (+7.7% 🔺)0.189s521.47x
💻 LocalExpress0.993s (+1.0%)1.281s (+19.1% 🔺)0.288s471.48x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.898s (-1.5%)2.053s (-2.3%)0.155s441.00x
🐘 PostgresNext.js (Turbopack)1.922s2.100s0.179s431.01x
🐘 PostgresExpress1.930s (-2.4%)2.123s (-6.0% 🟢)0.193s431.02x
💻 LocalNext.js (Turbopack)2.129s3.007s0.878s301.12x
💻 LocalNitro3.020s (~)3.729s (-0.8%)0.709s251.59x
💻 LocalExpress3.029s (~)3.586s (~)0.557s261.60x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.863s (-5.9% 🟢)4.148s (-9.9% 🟢)0.285s291.00x
🐘 PostgresNext.js (Turbopack)3.881s4.149s0.267s291.00x
🐘 PostgresExpress3.911s (-2.0%)4.147s (-5.1% 🟢)0.236s291.01x
💻 LocalNext.js (Turbopack)7.000s7.425s0.425s171.81x
💻 LocalNitro9.161s (-1.5%)9.864s (-1.5%)0.703s132.37x
💻 LocalExpress9.338s (+1.4%)9.942s (-0.8%)0.603s132.42x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.250s1.007s0.757s601.00x
🐘 PostgresNitro0.287s (+1.2%)1.007s (~)0.721s601.15x
🐘 PostgresExpress0.288s (+2.1%)1.007s (~)0.718s601.15x
💻 LocalNext.js (Turbopack)0.547s1.004s0.457s602.19x
💻 LocalNitro0.573s (-5.2% 🟢)1.021s (~)0.448s592.29x
💻 LocalExpress0.595s (+6.2% 🔺)1.004s (~)0.409s602.38x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.482s1.018s0.536s891.00x
🐘 PostgresExpress0.496s (-2.7%)1.007s (~)0.510s901.03x
🐘 PostgresNitro0.504s (+1.6%)1.007s (~)0.502s901.05x
💻 LocalNext.js (Turbopack)2.388s3.008s0.620s304.96x
💻 LocalNitro2.507s (-1.2%)3.009s (~)0.502s305.21x
💻 LocalExpress2.587s (+2.9%)3.008s (~)0.422s305.37x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.764s1.007s0.243s1201.00x
🐘 PostgresExpress0.793s (-3.2%)1.016s (~)0.223s1191.04x
🐘 PostgresNitro0.796s (+0.7%)1.008s (~)0.212s1201.04x
💻 LocalNext.js (Turbopack)9.109s9.636s0.527s1311.92x
💻 LocalNitro11.000s (-1.7%)11.663s (~)0.663s1114.40x
💻 LocalExpress11.425s (+2.1%)12.030s (+0.7%)0.605s1014.95x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.138s1.003s0.009s1.015s0.878s101.00x
🐘 PostgresNext.js (Turbopack)0.193s1.001s0.001s1.010s0.817s101.40x
🐘 PostgresNitro0.196s (-4.3%)1.000s (~)0.001s (-13.3% 🟢)1.010s (~)0.814s101.43x
💻 LocalExpress0.205s (+2.8%)1.004s (~)0.012s (-1.7%)1.018s (~)0.814s101.49x
🐘 PostgresExpress0.208s (+1.4%)0.993s (-0.6%)0.002s (+12.5% 🔺)1.010s (~)0.803s101.51x
💻 LocalNitro0.213s (~)1.004s (~)0.012s (-4.0%)1.018s (~)0.805s101.55x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.619s (-0.9%)1.005s (~)0.013s (+225.8% 🔺)1.031s (+0.9%)0.413s591.00x
🐘 PostgresExpress0.621s (-1.4%)1.001s (-0.6%)0.013s (+242.5% 🔺)1.030s (+0.7%)0.409s591.00x
🐘 PostgresNext.js (Turbopack)0.640s1.026s0.007s1.041s0.401s581.03x
💻 LocalNitro0.745s (-11.2% 🟢)1.013s (~)0.009s (-2.9%)1.023s (-8.3% 🟢)0.279s591.20x
💻 LocalNext.js (Turbopack)0.768s1.010s0.009s1.226s0.459s491.24x
💻 LocalExpress0.864s (+14.1% 🔺)1.013s (-1.5%)0.010s (+5.2% 🔺)1.118s (+7.5% 🔺)0.254s541.40x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.929s1.112s0.000s1.119s0.190s541.00x
🐘 PostgresExpress0.951s (-1.0%)1.147s (-10.2% 🟢)0.000s (-11.5% 🟢)1.162s (-11.1% 🟢)0.210s521.02x
🐘 PostgresNitro0.973s (~)1.245s (~)0.000s (~)1.257s (~)0.284s481.05x
💻 LocalNext.js (Turbopack)1.161s2.016s0.000s2.019s0.858s301.25x
💻 LocalNitro1.224s (~)2.020s (~)0.000s (+366.7% 🔺)2.022s (~)0.798s301.32x
💻 LocalExpress1.283s (+4.7%)2.022s (~)0.001s (+80.0% 🔺)2.025s (~)0.742s301.38x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.764s (-1.5%)2.139s (~)0.000s (-100.0% 🟢)2.152s (-1.0%)0.388s281.00x
🐘 PostgresNext.js (Turbopack)1.800s2.147s0.000s2.168s0.368s281.02x
🐘 PostgresExpress1.829s (+3.2%)2.176s (~)0.000s (+Infinity% 🔺)2.189s (~)0.360s281.04x
💻 LocalNext.js (Turbopack)3.360s3.968s0.001s3.971s0.611s161.90x
💻 LocalNitro3.518s (+3.9%)4.100s (+1.7%)0.000s (-12.5% 🟢)4.103s (+1.6%)0.585s151.99x
💻 LocalExpress3.568s (+2.9%)4.098s (+1.6%)0.001s (-33.3% 🟢)4.101s (+1.6%)0.533s152.02x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)20/21
🐘 PostgresNext.js (Turbopack)11/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres18/21
Next.js (Turbopack)🐘 Postgres15/21
Nitro🐘 Postgres19/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)

📋 View full workflow run

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@karthikscale3karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix seems straightforward. I will let others take a pass.

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified devalue.stringify() output is always valid JSON — special values (undefined, NaN, ±Infinity, -0, holes, sparse arrays) are encoded as negative integer sentinels (see constants.js: UNDEFINED=-1, HOLE=-2, NAN=-3, POSITIVE_INFINITY=-4, NEGATIVE_INFINITY=-5, NEGATIVE_ZERO=-6, SPARSE=-7), and the top-level short-circuit in stringify.js returns a stringified integer (\${index}`) rather than a raw JS literal. The devalue README's evalguidance applies touneval(), not stringify()devalue.parse()itself is internallyunflatten(JSON.parse(serialized)), so JSON.parseis the canonical way to consumestringify()` output.

Empirically verified JSON.parse and (0, eval)(\(${s})`)produce identical results forundefined, NaN, ±Infinity, -0`, and compound structures containing them.

Non-blocking follow-up: once this lands, the revive() wrapper itself becomes trivial and could be inlined — the 4 call sites could just call JSON.parse(str) directly and the helper deleted. Happy to open a follow-up PR for that.

@pranaygp
pranaygp enabled auto-merge (squash) April 24, 2026 01:46
@pranaygp
pranaygp merged commit 7d07fab into mainApr 28, 2026
155 of 163 checks passed
@pranaygp
pranaygp deleted the pranaygp/great-austin-e06cf4 branch April 28, 2026 22:58
karthikscale3 pushed a commit that referenced this pull request Apr 28, 2026
* Replace eval with JSON.parse in serialization revive helper
devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Drop redundant workflow package from changeset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
karthikscale3 added a commit that referenced this pull request Apr 29, 2026
* Decode typed array stream chunks
* Render decoded stream bytes with raw view
* Render decoded bytes in data inspector
* Use generic byte inspector for streams
* review feedback: narrow stream-display exports, fix tab a11y, add collapseRefs tests
- Remove unused formatStreamChunkForDisplay/sanitizeStreamChunkForDisplay
exports; keep only the formatArrayBufferViewForDisplay path actually used
by DataInspector.
- Replace broken role=tablist/role=tab on the Decoded/Bytes switcher
with aria-pressed toggle-button semantics.
- Export collapseRefs/isBytesDisplay and add regression tests covering
typed-array detection (top-level, nested in object/array/Map/Set,
DataView exclusion).
* Replace eval with JSON.parse in serialization revive helper (#1848)
* Replace eval with JSON.parse in serialization revive helper
devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Drop redundant workflow package from changeset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* Add e2e test for UTF-8 parseable stream chunks
Emits Uint8Array chunks containing multi-byte UTF-8 (Latin Extended,
CJK, emoji, RTL Arabic) plus a UTF-8 encoded JSON document, and
asserts each chunk round-trips through TextDecoder({ fatal: true }).
Exercises the same decode path the web inspector relies on for
typed-array stream values.
Made-with: Cursor
---------
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

5 participants

@pranaygp@TooTallNate@VaguelySerious@karthikscale3
, '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('^' + ".*" + '
Skip to content

Replace eval with JSON.parse in serialization revive helper - #1848

Merged
pranaygp merged 3 commits into
mainfrom
pranaygp/great-austin-e06cf4
Apr 28, 2026
Merged

Replace eval with JSON.parse in serialization revive helper#1848
pranaygp merged 3 commits into
mainfrom
pranaygp/great-austin-e06cf4

Conversation

@pranaygp

@pranaygppranaygp commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Description

The revive() helper in packages/core/src/serialization.ts used (0, eval) to deserialize the output of devalue.stringify() into its flattened-array form (used by v1Compat paths and later consumed by devalue.unflatten). While the input was controlled (always the result of devalue.stringify() called moments earlier), eval is still an unnecessary anti-pattern flagged by the security review.

devalue.stringify() is documented and implemented to always emit valid JSON — special values (undefined, NaN, Infinity, -Infinity, -0) are encoded as negative integer sentinels (-1, -3, -4, -5, -6), and the rest of the structure is ordinary JSON. devalue.parse() itself internally does unflatten(JSON.parse(serialized)). So JSON.parse is a safe drop-in replacement.

Note: devalue 5.6.3 does not export a public flatten() function (only unflatten), so the stringify-then-parse approach is retained — just without eval.

How did you test your changes?

  • Ran pnpm vitest run src/serialization.test.ts in packages/core. 116 tests pass; 7 DOMException failures are pre-existing on main (verified via git stash) and unrelated to this change.
  • No new tests needed: the v1Compat dehydrator paths exercised by existing serialization tests round-trip through revive().

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)
  • 📝 Ping @vercel/workflow in a comment once the PR is ready, and the above checklist is complete

devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings April 24, 2026 00:37
@changeset-bot

changeset-botBot commented Apr 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3c7e59a

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

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

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 Apr 24, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, CommentApr 28, 2026 10:28pm
example-nextjs-workflow-webpackReadyReadyPreview, CommentApr 28, 2026 10:28pm
example-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-astro-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-express-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-fastify-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-hono-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-nitro-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-nuxt-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-sveltekit-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-vite-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workflow-docsReadyReadyPreview, Comment, Open in v0Apr 28, 2026 10:28pm
workflow-swc-playgroundReadyReadyPreview, CommentApr 28, 2026 10:28pm
workflow-webReadyReadyPreview, CommentApr 28, 2026 10:28pm

Comment thread.changeset/no-eval-in-revive.md Outdated
@@ -0,0 +1,6 @@
---
"@workflow/core": patch
"workflow": patch

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't add workflow to changeset. that's implicit from deps like @workflow/core

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in e2da618.

@github-actions

github-actionsBot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production9780671045
✅ 💻 Local Development10540861140
✅ 📦 Local Production10540861140
✅ 🐘 Local Postgres10540861140
✅ 🪟 Windows950095
✅ 📋 Other267018285
Total450203434845

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro8807
✅ example8807
✅ express8807
✅ fastify8807
✅ hono8807
✅ nextjs-turbopack9302
✅ nextjs-webpack9302
✅ nitro8807
✅ nuxt8807
✅ sveltekit8807
✅ vite8807
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack9500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable8906
✅ e2e-local-postgres-nest-stable8906
✅ e2e-local-prod-nest-stable8906

📋 View full workflow run

@github-actions

github-actionsBot commented Apr 24, 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🥇 Next.js (Turbopack)0.039s1.007s0.968s101.00x
💻 LocalNitro0.040s (-6.3% 🟢)1.005s (~)0.964s101.03x
💻 LocalExpress0.041s (-7.2% 🟢)1.005s (~)0.964s101.05x
🐘 PostgresNext.js (Turbopack)0.056s1.009s0.953s101.44x
🐘 PostgresNitro0.060s (-37.4% 🟢)1.010s (-3.2%)0.950s101.52x
🐘 PostgresExpress0.060s (+4.1%)1.009s (~)0.949s101.54x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.089s2.006s0.916s101.00x
💻 LocalExpress1.128s (~)2.006s (~)0.877s101.04x
💻 LocalNitro1.128s (~)2.005s (~)0.877s101.04x
🐘 PostgresNext.js (Turbopack)1.131s2.009s0.879s101.04x
🐘 PostgresExpress1.139s (-0.6%)2.010s (~)0.870s101.05x
🐘 PostgresNitro1.143s (~)2.009s (~)0.867s101.05x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.637s11.023s0.386s31.00x
🐘 PostgresNitro10.847s (~)11.020s (~)0.173s31.02x
🐘 PostgresNext.js (Turbopack)10.863s11.024s0.161s31.02x
🐘 PostgresExpress10.871s (-0.8%)11.023s (~)0.152s31.02x
💻 LocalNitro10.931s (~)11.023s (~)0.093s31.03x
💻 LocalExpress10.934s (~)11.023s (~)0.089s31.03x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)14.138s15.029s0.890s41.00x
🐘 PostgresNitro14.523s (~)15.022s (~)0.499s41.03x
🐘 PostgresExpress14.557s (~)15.026s (~)0.470s41.03x
🐘 PostgresNext.js (Turbopack)14.571s15.026s0.455s41.03x
💻 LocalNitro14.964s (-0.7%)15.028s (-6.3% 🟢)0.064s41.06x
💻 LocalExpress15.002s (~)15.280s (+1.7%)0.277s41.06x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)13.913s14.454s0.541s71.00x
🐘 PostgresNitro13.951s (~)14.164s (-1.0%)0.213s71.00x
🐘 PostgresExpress14.135s (+0.9%)14.737s (+1.0%)0.602s71.02x
💻 LocalNext.js (Turbopack)14.733s15.027s0.294s61.06x
💻 LocalNitro16.728s (~)17.030s (~)0.302s61.20x
💻 LocalExpress16.756s (+0.9%)17.032s (~)0.276s61.20x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.223s2.009s0.786s151.00x
🐘 PostgresExpress1.268s (+0.6%)2.010s (~)0.742s151.04x
🐘 PostgresNitro1.274s (~)2.010s (~)0.737s151.04x
💻 LocalNext.js (Turbopack)1.455s2.005s0.550s151.19x
💻 LocalNitro1.524s (-6.6% 🟢)2.007s (-3.2%)0.483s151.25x
💻 LocalExpress1.536s (+3.2%)2.006s (~)0.470s151.26x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.333s (-0.8%)3.008s (~)0.675s101.00x
🐘 PostgresExpress2.360s (~)3.008s (~)0.648s101.01x
🐘 PostgresNext.js (Turbopack)2.374s3.009s0.635s101.02x
💻 LocalNext.js (Turbopack)2.587s3.007s0.420s101.11x
💻 LocalNitro2.973s (-5.4% 🟢)3.564s (-8.3% 🟢)0.591s91.27x
💻 LocalExpress3.029s (+2.6%)3.676s (+6.4% 🔺)0.647s91.30x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.479s (~)4.012s (~)0.532s81.00x
🐘 PostgresNitro3.483s (~)4.011s (~)0.528s81.00x
🐘 PostgresNext.js (Turbopack)3.639s4.009s0.371s81.05x
💻 LocalNext.js (Turbopack)6.286s6.813s0.527s51.81x
💻 LocalNitro8.477s (+1.5%)9.021s (~)0.544s42.44x
💻 LocalExpress8.756s (+5.0% 🔺)9.270s (+2.7%)0.513s42.52x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.231s2.008s0.777s151.00x
🐘 PostgresNitro1.259s (~)2.009s (~)0.750s151.02x
🐘 PostgresExpress1.289s (+2.5%)2.008s (~)0.719s151.05x
💻 LocalNext.js (Turbopack)1.453s2.006s0.553s151.18x
💻 LocalExpress1.547s (-18.3% 🟢)2.005s (-15.2% 🟢)0.458s151.26x
💻 LocalNitro1.555s (-16.6% 🟢)2.006s (-14.3% 🟢)0.450s151.26x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.326s (-0.6%)3.010s (~)0.684s101.00x
🐘 PostgresNext.js (Turbopack)2.392s3.009s0.617s101.03x
🐘 PostgresExpress2.409s (+2.9%)3.013s (~)0.603s101.04x
💻 LocalNext.js (Turbopack)2.672s3.008s0.336s101.15x
💻 LocalNitro3.038s (-0.9%)3.884s (~)0.846s81.31x
💻 LocalExpress3.102s (-1.0%)4.011s (+6.6% 🔺)0.910s81.33x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.468s (~)4.010s (~)0.542s81.00x
🐘 PostgresExpress3.481s (-0.5%)4.012s (~)0.531s81.00x
🐘 PostgresNext.js (Turbopack)3.646s4.012s0.366s81.05x
💻 LocalNext.js (Turbopack)6.437s7.015s0.578s51.86x
💻 LocalNitro8.681s (-5.1% 🟢)9.022s (-10.0% 🟢)0.341s42.50x
💻 LocalExpress9.027s (+2.6%)9.526s (+2.7%)0.499s42.60x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.671s1.021s0.350s591.00x
🐘 PostgresNext.js (Turbopack)0.794s1.023s0.229s591.18x
🐘 PostgresNitro0.801s (-2.4%)1.006s (~)0.205s601.19x
🐘 PostgresExpress0.841s (~)1.023s (~)0.181s591.25x
💻 LocalNitro0.989s (+0.8%)1.178s (+7.7% 🔺)0.189s521.47x
💻 LocalExpress0.993s (+1.0%)1.281s (+19.1% 🔺)0.288s471.48x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.898s (-1.5%)2.053s (-2.3%)0.155s441.00x
🐘 PostgresNext.js (Turbopack)1.922s2.100s0.179s431.01x
🐘 PostgresExpress1.930s (-2.4%)2.123s (-6.0% 🟢)0.193s431.02x
💻 LocalNext.js (Turbopack)2.129s3.007s0.878s301.12x
💻 LocalNitro3.020s (~)3.729s (-0.8%)0.709s251.59x
💻 LocalExpress3.029s (~)3.586s (~)0.557s261.60x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.863s (-5.9% 🟢)4.148s (-9.9% 🟢)0.285s291.00x
🐘 PostgresNext.js (Turbopack)3.881s4.149s0.267s291.00x
🐘 PostgresExpress3.911s (-2.0%)4.147s (-5.1% 🟢)0.236s291.01x
💻 LocalNext.js (Turbopack)7.000s7.425s0.425s171.81x
💻 LocalNitro9.161s (-1.5%)9.864s (-1.5%)0.703s132.37x
💻 LocalExpress9.338s (+1.4%)9.942s (-0.8%)0.603s132.42x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.250s1.007s0.757s601.00x
🐘 PostgresNitro0.287s (+1.2%)1.007s (~)0.721s601.15x
🐘 PostgresExpress0.288s (+2.1%)1.007s (~)0.718s601.15x
💻 LocalNext.js (Turbopack)0.547s1.004s0.457s602.19x
💻 LocalNitro0.573s (-5.2% 🟢)1.021s (~)0.448s592.29x
💻 LocalExpress0.595s (+6.2% 🔺)1.004s (~)0.409s602.38x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.482s1.018s0.536s891.00x
🐘 PostgresExpress0.496s (-2.7%)1.007s (~)0.510s901.03x
🐘 PostgresNitro0.504s (+1.6%)1.007s (~)0.502s901.05x
💻 LocalNext.js (Turbopack)2.388s3.008s0.620s304.96x
💻 LocalNitro2.507s (-1.2%)3.009s (~)0.502s305.21x
💻 LocalExpress2.587s (+2.9%)3.008s (~)0.422s305.37x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.764s1.007s0.243s1201.00x
🐘 PostgresExpress0.793s (-3.2%)1.016s (~)0.223s1191.04x
🐘 PostgresNitro0.796s (+0.7%)1.008s (~)0.212s1201.04x
💻 LocalNext.js (Turbopack)9.109s9.636s0.527s1311.92x
💻 LocalNitro11.000s (-1.7%)11.663s (~)0.663s1114.40x
💻 LocalExpress11.425s (+2.1%)12.030s (+0.7%)0.605s1014.95x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.138s1.003s0.009s1.015s0.878s101.00x
🐘 PostgresNext.js (Turbopack)0.193s1.001s0.001s1.010s0.817s101.40x
🐘 PostgresNitro0.196s (-4.3%)1.000s (~)0.001s (-13.3% 🟢)1.010s (~)0.814s101.43x
💻 LocalExpress0.205s (+2.8%)1.004s (~)0.012s (-1.7%)1.018s (~)0.814s101.49x
🐘 PostgresExpress0.208s (+1.4%)0.993s (-0.6%)0.002s (+12.5% 🔺)1.010s (~)0.803s101.51x
💻 LocalNitro0.213s (~)1.004s (~)0.012s (-4.0%)1.018s (~)0.805s101.55x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.619s (-0.9%)1.005s (~)0.013s (+225.8% 🔺)1.031s (+0.9%)0.413s591.00x
🐘 PostgresExpress0.621s (-1.4%)1.001s (-0.6%)0.013s (+242.5% 🔺)1.030s (+0.7%)0.409s591.00x
🐘 PostgresNext.js (Turbopack)0.640s1.026s0.007s1.041s0.401s581.03x
💻 LocalNitro0.745s (-11.2% 🟢)1.013s (~)0.009s (-2.9%)1.023s (-8.3% 🟢)0.279s591.20x
💻 LocalNext.js (Turbopack)0.768s1.010s0.009s1.226s0.459s491.24x
💻 LocalExpress0.864s (+14.1% 🔺)1.013s (-1.5%)0.010s (+5.2% 🔺)1.118s (+7.5% 🔺)0.254s541.40x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.929s1.112s0.000s1.119s0.190s541.00x
🐘 PostgresExpress0.951s (-1.0%)1.147s (-10.2% 🟢)0.000s (-11.5% 🟢)1.162s (-11.1% 🟢)0.210s521.02x
🐘 PostgresNitro0.973s (~)1.245s (~)0.000s (~)1.257s (~)0.284s481.05x
💻 LocalNext.js (Turbopack)1.161s2.016s0.000s2.019s0.858s301.25x
💻 LocalNitro1.224s (~)2.020s (~)0.000s (+366.7% 🔺)2.022s (~)0.798s301.32x
💻 LocalExpress1.283s (+4.7%)2.022s (~)0.001s (+80.0% 🔺)2.025s (~)0.742s301.38x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.764s (-1.5%)2.139s (~)0.000s (-100.0% 🟢)2.152s (-1.0%)0.388s281.00x
🐘 PostgresNext.js (Turbopack)1.800s2.147s0.000s2.168s0.368s281.02x
🐘 PostgresExpress1.829s (+3.2%)2.176s (~)0.000s (+Infinity% 🔺)2.189s (~)0.360s281.04x
💻 LocalNext.js (Turbopack)3.360s3.968s0.001s3.971s0.611s161.90x
💻 LocalNitro3.518s (+3.9%)4.100s (+1.7%)0.000s (-12.5% 🟢)4.103s (+1.6%)0.585s151.99x
💻 LocalExpress3.568s (+2.9%)4.098s (+1.6%)0.001s (-33.3% 🟢)4.101s (+1.6%)0.533s152.02x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)20/21
🐘 PostgresNext.js (Turbopack)11/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres18/21
Next.js (Turbopack)🐘 Postgres15/21
Nitro🐘 Postgres19/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)

📋 View full workflow run

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@karthikscale3karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix seems straightforward. I will let others take a pass.

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified devalue.stringify() output is always valid JSON — special values (undefined, NaN, ±Infinity, -0, holes, sparse arrays) are encoded as negative integer sentinels (see constants.js: UNDEFINED=-1, HOLE=-2, NAN=-3, POSITIVE_INFINITY=-4, NEGATIVE_INFINITY=-5, NEGATIVE_ZERO=-6, SPARSE=-7), and the top-level short-circuit in stringify.js returns a stringified integer (\${index}`) rather than a raw JS literal. The devalue README's evalguidance applies touneval(), not stringify()devalue.parse()itself is internallyunflatten(JSON.parse(serialized)), so JSON.parseis the canonical way to consumestringify()` output.

Empirically verified JSON.parse and (0, eval)(\(${s})`)produce identical results forundefined, NaN, ±Infinity, -0`, and compound structures containing them.

Non-blocking follow-up: once this lands, the revive() wrapper itself becomes trivial and could be inlined — the 4 call sites could just call JSON.parse(str) directly and the helper deleted. Happy to open a follow-up PR for that.

@pranaygp
pranaygp enabled auto-merge (squash) April 24, 2026 01:46
@pranaygp
pranaygp merged commit 7d07fab into mainApr 28, 2026
155 of 163 checks passed
@pranaygp
pranaygp deleted the pranaygp/great-austin-e06cf4 branch April 28, 2026 22:58
karthikscale3 pushed a commit that referenced this pull request Apr 28, 2026
* Replace eval with JSON.parse in serialization revive helper
devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Drop redundant workflow package from changeset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
karthikscale3 added a commit that referenced this pull request Apr 29, 2026
* Decode typed array stream chunks
* Render decoded stream bytes with raw view
* Render decoded bytes in data inspector
* Use generic byte inspector for streams
* review feedback: narrow stream-display exports, fix tab a11y, add collapseRefs tests
- Remove unused formatStreamChunkForDisplay/sanitizeStreamChunkForDisplay
exports; keep only the formatArrayBufferViewForDisplay path actually used
by DataInspector.
- Replace broken role=tablist/role=tab on the Decoded/Bytes switcher
with aria-pressed toggle-button semantics.
- Export collapseRefs/isBytesDisplay and add regression tests covering
typed-array detection (top-level, nested in object/array/Map/Set,
DataView exclusion).
* Replace eval with JSON.parse in serialization revive helper (#1848)
* Replace eval with JSON.parse in serialization revive helper
devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Drop redundant workflow package from changeset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* Add e2e test for UTF-8 parseable stream chunks
Emits Uint8Array chunks containing multi-byte UTF-8 (Latin Extended,
CJK, emoji, RTL Arabic) plus a UTF-8 encoded JSON document, and
asserts each chunk round-trips through TextDecoder({ fatal: true }).
Exercises the same decode path the web inspector relies on for
typed-array stream values.
Made-with: Cursor
---------
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

5 participants

@pranaygp@TooTallNate@VaguelySerious@karthikscale3
, '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('^' + ".*" + '
Skip to content

Replace eval with JSON.parse in serialization revive helper - #1848

Merged
pranaygp merged 3 commits into
mainfrom
pranaygp/great-austin-e06cf4
Apr 28, 2026
Merged

Replace eval with JSON.parse in serialization revive helper#1848
pranaygp merged 3 commits into
mainfrom
pranaygp/great-austin-e06cf4

Conversation

@pranaygp

@pranaygppranaygp commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Description

The revive() helper in packages/core/src/serialization.ts used (0, eval) to deserialize the output of devalue.stringify() into its flattened-array form (used by v1Compat paths and later consumed by devalue.unflatten). While the input was controlled (always the result of devalue.stringify() called moments earlier), eval is still an unnecessary anti-pattern flagged by the security review.

devalue.stringify() is documented and implemented to always emit valid JSON — special values (undefined, NaN, Infinity, -Infinity, -0) are encoded as negative integer sentinels (-1, -3, -4, -5, -6), and the rest of the structure is ordinary JSON. devalue.parse() itself internally does unflatten(JSON.parse(serialized)). So JSON.parse is a safe drop-in replacement.

Note: devalue 5.6.3 does not export a public flatten() function (only unflatten), so the stringify-then-parse approach is retained — just without eval.

How did you test your changes?

  • Ran pnpm vitest run src/serialization.test.ts in packages/core. 116 tests pass; 7 DOMException failures are pre-existing on main (verified via git stash) and unrelated to this change.
  • No new tests needed: the v1Compat dehydrator paths exercised by existing serialization tests round-trip through revive().

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)
  • 📝 Ping @vercel/workflow in a comment once the PR is ready, and the above checklist is complete

devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings April 24, 2026 00:37
@changeset-bot

changeset-botBot commented Apr 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3c7e59a

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

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

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 Apr 24, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, CommentApr 28, 2026 10:28pm
example-nextjs-workflow-webpackReadyReadyPreview, CommentApr 28, 2026 10:28pm
example-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-astro-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-express-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-fastify-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-hono-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-nitro-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-nuxt-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-sveltekit-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-vite-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workflow-docsReadyReadyPreview, Comment, Open in v0Apr 28, 2026 10:28pm
workflow-swc-playgroundReadyReadyPreview, CommentApr 28, 2026 10:28pm
workflow-webReadyReadyPreview, CommentApr 28, 2026 10:28pm

Comment thread.changeset/no-eval-in-revive.md Outdated
@@ -0,0 +1,6 @@
---
"@workflow/core": patch
"workflow": patch

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't add workflow to changeset. that's implicit from deps like @workflow/core

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in e2da618.

@github-actions

github-actionsBot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production9780671045
✅ 💻 Local Development10540861140
✅ 📦 Local Production10540861140
✅ 🐘 Local Postgres10540861140
✅ 🪟 Windows950095
✅ 📋 Other267018285
Total450203434845

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro8807
✅ example8807
✅ express8807
✅ fastify8807
✅ hono8807
✅ nextjs-turbopack9302
✅ nextjs-webpack9302
✅ nitro8807
✅ nuxt8807
✅ sveltekit8807
✅ vite8807
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack9500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable8906
✅ e2e-local-postgres-nest-stable8906
✅ e2e-local-prod-nest-stable8906

📋 View full workflow run

@github-actions

github-actionsBot commented Apr 24, 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🥇 Next.js (Turbopack)0.039s1.007s0.968s101.00x
💻 LocalNitro0.040s (-6.3% 🟢)1.005s (~)0.964s101.03x
💻 LocalExpress0.041s (-7.2% 🟢)1.005s (~)0.964s101.05x
🐘 PostgresNext.js (Turbopack)0.056s1.009s0.953s101.44x
🐘 PostgresNitro0.060s (-37.4% 🟢)1.010s (-3.2%)0.950s101.52x
🐘 PostgresExpress0.060s (+4.1%)1.009s (~)0.949s101.54x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.089s2.006s0.916s101.00x
💻 LocalExpress1.128s (~)2.006s (~)0.877s101.04x
💻 LocalNitro1.128s (~)2.005s (~)0.877s101.04x
🐘 PostgresNext.js (Turbopack)1.131s2.009s0.879s101.04x
🐘 PostgresExpress1.139s (-0.6%)2.010s (~)0.870s101.05x
🐘 PostgresNitro1.143s (~)2.009s (~)0.867s101.05x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.637s11.023s0.386s31.00x
🐘 PostgresNitro10.847s (~)11.020s (~)0.173s31.02x
🐘 PostgresNext.js (Turbopack)10.863s11.024s0.161s31.02x
🐘 PostgresExpress10.871s (-0.8%)11.023s (~)0.152s31.02x
💻 LocalNitro10.931s (~)11.023s (~)0.093s31.03x
💻 LocalExpress10.934s (~)11.023s (~)0.089s31.03x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)14.138s15.029s0.890s41.00x
🐘 PostgresNitro14.523s (~)15.022s (~)0.499s41.03x
🐘 PostgresExpress14.557s (~)15.026s (~)0.470s41.03x
🐘 PostgresNext.js (Turbopack)14.571s15.026s0.455s41.03x
💻 LocalNitro14.964s (-0.7%)15.028s (-6.3% 🟢)0.064s41.06x
💻 LocalExpress15.002s (~)15.280s (+1.7%)0.277s41.06x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)13.913s14.454s0.541s71.00x
🐘 PostgresNitro13.951s (~)14.164s (-1.0%)0.213s71.00x
🐘 PostgresExpress14.135s (+0.9%)14.737s (+1.0%)0.602s71.02x
💻 LocalNext.js (Turbopack)14.733s15.027s0.294s61.06x
💻 LocalNitro16.728s (~)17.030s (~)0.302s61.20x
💻 LocalExpress16.756s (+0.9%)17.032s (~)0.276s61.20x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.223s2.009s0.786s151.00x
🐘 PostgresExpress1.268s (+0.6%)2.010s (~)0.742s151.04x
🐘 PostgresNitro1.274s (~)2.010s (~)0.737s151.04x
💻 LocalNext.js (Turbopack)1.455s2.005s0.550s151.19x
💻 LocalNitro1.524s (-6.6% 🟢)2.007s (-3.2%)0.483s151.25x
💻 LocalExpress1.536s (+3.2%)2.006s (~)0.470s151.26x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.333s (-0.8%)3.008s (~)0.675s101.00x
🐘 PostgresExpress2.360s (~)3.008s (~)0.648s101.01x
🐘 PostgresNext.js (Turbopack)2.374s3.009s0.635s101.02x
💻 LocalNext.js (Turbopack)2.587s3.007s0.420s101.11x
💻 LocalNitro2.973s (-5.4% 🟢)3.564s (-8.3% 🟢)0.591s91.27x
💻 LocalExpress3.029s (+2.6%)3.676s (+6.4% 🔺)0.647s91.30x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.479s (~)4.012s (~)0.532s81.00x
🐘 PostgresNitro3.483s (~)4.011s (~)0.528s81.00x
🐘 PostgresNext.js (Turbopack)3.639s4.009s0.371s81.05x
💻 LocalNext.js (Turbopack)6.286s6.813s0.527s51.81x
💻 LocalNitro8.477s (+1.5%)9.021s (~)0.544s42.44x
💻 LocalExpress8.756s (+5.0% 🔺)9.270s (+2.7%)0.513s42.52x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.231s2.008s0.777s151.00x
🐘 PostgresNitro1.259s (~)2.009s (~)0.750s151.02x
🐘 PostgresExpress1.289s (+2.5%)2.008s (~)0.719s151.05x
💻 LocalNext.js (Turbopack)1.453s2.006s0.553s151.18x
💻 LocalExpress1.547s (-18.3% 🟢)2.005s (-15.2% 🟢)0.458s151.26x
💻 LocalNitro1.555s (-16.6% 🟢)2.006s (-14.3% 🟢)0.450s151.26x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.326s (-0.6%)3.010s (~)0.684s101.00x
🐘 PostgresNext.js (Turbopack)2.392s3.009s0.617s101.03x
🐘 PostgresExpress2.409s (+2.9%)3.013s (~)0.603s101.04x
💻 LocalNext.js (Turbopack)2.672s3.008s0.336s101.15x
💻 LocalNitro3.038s (-0.9%)3.884s (~)0.846s81.31x
💻 LocalExpress3.102s (-1.0%)4.011s (+6.6% 🔺)0.910s81.33x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.468s (~)4.010s (~)0.542s81.00x
🐘 PostgresExpress3.481s (-0.5%)4.012s (~)0.531s81.00x
🐘 PostgresNext.js (Turbopack)3.646s4.012s0.366s81.05x
💻 LocalNext.js (Turbopack)6.437s7.015s0.578s51.86x
💻 LocalNitro8.681s (-5.1% 🟢)9.022s (-10.0% 🟢)0.341s42.50x
💻 LocalExpress9.027s (+2.6%)9.526s (+2.7%)0.499s42.60x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.671s1.021s0.350s591.00x
🐘 PostgresNext.js (Turbopack)0.794s1.023s0.229s591.18x
🐘 PostgresNitro0.801s (-2.4%)1.006s (~)0.205s601.19x
🐘 PostgresExpress0.841s (~)1.023s (~)0.181s591.25x
💻 LocalNitro0.989s (+0.8%)1.178s (+7.7% 🔺)0.189s521.47x
💻 LocalExpress0.993s (+1.0%)1.281s (+19.1% 🔺)0.288s471.48x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.898s (-1.5%)2.053s (-2.3%)0.155s441.00x
🐘 PostgresNext.js (Turbopack)1.922s2.100s0.179s431.01x
🐘 PostgresExpress1.930s (-2.4%)2.123s (-6.0% 🟢)0.193s431.02x
💻 LocalNext.js (Turbopack)2.129s3.007s0.878s301.12x
💻 LocalNitro3.020s (~)3.729s (-0.8%)0.709s251.59x
💻 LocalExpress3.029s (~)3.586s (~)0.557s261.60x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.863s (-5.9% 🟢)4.148s (-9.9% 🟢)0.285s291.00x
🐘 PostgresNext.js (Turbopack)3.881s4.149s0.267s291.00x
🐘 PostgresExpress3.911s (-2.0%)4.147s (-5.1% 🟢)0.236s291.01x
💻 LocalNext.js (Turbopack)7.000s7.425s0.425s171.81x
💻 LocalNitro9.161s (-1.5%)9.864s (-1.5%)0.703s132.37x
💻 LocalExpress9.338s (+1.4%)9.942s (-0.8%)0.603s132.42x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.250s1.007s0.757s601.00x
🐘 PostgresNitro0.287s (+1.2%)1.007s (~)0.721s601.15x
🐘 PostgresExpress0.288s (+2.1%)1.007s (~)0.718s601.15x
💻 LocalNext.js (Turbopack)0.547s1.004s0.457s602.19x
💻 LocalNitro0.573s (-5.2% 🟢)1.021s (~)0.448s592.29x
💻 LocalExpress0.595s (+6.2% 🔺)1.004s (~)0.409s602.38x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.482s1.018s0.536s891.00x
🐘 PostgresExpress0.496s (-2.7%)1.007s (~)0.510s901.03x
🐘 PostgresNitro0.504s (+1.6%)1.007s (~)0.502s901.05x
💻 LocalNext.js (Turbopack)2.388s3.008s0.620s304.96x
💻 LocalNitro2.507s (-1.2%)3.009s (~)0.502s305.21x
💻 LocalExpress2.587s (+2.9%)3.008s (~)0.422s305.37x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.764s1.007s0.243s1201.00x
🐘 PostgresExpress0.793s (-3.2%)1.016s (~)0.223s1191.04x
🐘 PostgresNitro0.796s (+0.7%)1.008s (~)0.212s1201.04x
💻 LocalNext.js (Turbopack)9.109s9.636s0.527s1311.92x
💻 LocalNitro11.000s (-1.7%)11.663s (~)0.663s1114.40x
💻 LocalExpress11.425s (+2.1%)12.030s (+0.7%)0.605s1014.95x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.138s1.003s0.009s1.015s0.878s101.00x
🐘 PostgresNext.js (Turbopack)0.193s1.001s0.001s1.010s0.817s101.40x
🐘 PostgresNitro0.196s (-4.3%)1.000s (~)0.001s (-13.3% 🟢)1.010s (~)0.814s101.43x
💻 LocalExpress0.205s (+2.8%)1.004s (~)0.012s (-1.7%)1.018s (~)0.814s101.49x
🐘 PostgresExpress0.208s (+1.4%)0.993s (-0.6%)0.002s (+12.5% 🔺)1.010s (~)0.803s101.51x
💻 LocalNitro0.213s (~)1.004s (~)0.012s (-4.0%)1.018s (~)0.805s101.55x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.619s (-0.9%)1.005s (~)0.013s (+225.8% 🔺)1.031s (+0.9%)0.413s591.00x
🐘 PostgresExpress0.621s (-1.4%)1.001s (-0.6%)0.013s (+242.5% 🔺)1.030s (+0.7%)0.409s591.00x
🐘 PostgresNext.js (Turbopack)0.640s1.026s0.007s1.041s0.401s581.03x
💻 LocalNitro0.745s (-11.2% 🟢)1.013s (~)0.009s (-2.9%)1.023s (-8.3% 🟢)0.279s591.20x
💻 LocalNext.js (Turbopack)0.768s1.010s0.009s1.226s0.459s491.24x
💻 LocalExpress0.864s (+14.1% 🔺)1.013s (-1.5%)0.010s (+5.2% 🔺)1.118s (+7.5% 🔺)0.254s541.40x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.929s1.112s0.000s1.119s0.190s541.00x
🐘 PostgresExpress0.951s (-1.0%)1.147s (-10.2% 🟢)0.000s (-11.5% 🟢)1.162s (-11.1% 🟢)0.210s521.02x
🐘 PostgresNitro0.973s (~)1.245s (~)0.000s (~)1.257s (~)0.284s481.05x
💻 LocalNext.js (Turbopack)1.161s2.016s0.000s2.019s0.858s301.25x
💻 LocalNitro1.224s (~)2.020s (~)0.000s (+366.7% 🔺)2.022s (~)0.798s301.32x
💻 LocalExpress1.283s (+4.7%)2.022s (~)0.001s (+80.0% 🔺)2.025s (~)0.742s301.38x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.764s (-1.5%)2.139s (~)0.000s (-100.0% 🟢)2.152s (-1.0%)0.388s281.00x
🐘 PostgresNext.js (Turbopack)1.800s2.147s0.000s2.168s0.368s281.02x
🐘 PostgresExpress1.829s (+3.2%)2.176s (~)0.000s (+Infinity% 🔺)2.189s (~)0.360s281.04x
💻 LocalNext.js (Turbopack)3.360s3.968s0.001s3.971s0.611s161.90x
💻 LocalNitro3.518s (+3.9%)4.100s (+1.7%)0.000s (-12.5% 🟢)4.103s (+1.6%)0.585s151.99x
💻 LocalExpress3.568s (+2.9%)4.098s (+1.6%)0.001s (-33.3% 🟢)4.101s (+1.6%)0.533s152.02x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)20/21
🐘 PostgresNext.js (Turbopack)11/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres18/21
Next.js (Turbopack)🐘 Postgres15/21
Nitro🐘 Postgres19/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)

📋 View full workflow run

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@karthikscale3karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix seems straightforward. I will let others take a pass.

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified devalue.stringify() output is always valid JSON — special values (undefined, NaN, ±Infinity, -0, holes, sparse arrays) are encoded as negative integer sentinels (see constants.js: UNDEFINED=-1, HOLE=-2, NAN=-3, POSITIVE_INFINITY=-4, NEGATIVE_INFINITY=-5, NEGATIVE_ZERO=-6, SPARSE=-7), and the top-level short-circuit in stringify.js returns a stringified integer (\${index}`) rather than a raw JS literal. The devalue README's evalguidance applies touneval(), not stringify()devalue.parse()itself is internallyunflatten(JSON.parse(serialized)), so JSON.parseis the canonical way to consumestringify()` output.

Empirically verified JSON.parse and (0, eval)(\(${s})`)produce identical results forundefined, NaN, ±Infinity, -0`, and compound structures containing them.

Non-blocking follow-up: once this lands, the revive() wrapper itself becomes trivial and could be inlined — the 4 call sites could just call JSON.parse(str) directly and the helper deleted. Happy to open a follow-up PR for that.

@pranaygp
pranaygp enabled auto-merge (squash) April 24, 2026 01:46
@pranaygp
pranaygp merged commit 7d07fab into mainApr 28, 2026
155 of 163 checks passed
@pranaygp
pranaygp deleted the pranaygp/great-austin-e06cf4 branch April 28, 2026 22:58
karthikscale3 pushed a commit that referenced this pull request Apr 28, 2026
* Replace eval with JSON.parse in serialization revive helper
devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Drop redundant workflow package from changeset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
karthikscale3 added a commit that referenced this pull request Apr 29, 2026
* Decode typed array stream chunks
* Render decoded stream bytes with raw view
* Render decoded bytes in data inspector
* Use generic byte inspector for streams
* review feedback: narrow stream-display exports, fix tab a11y, add collapseRefs tests
- Remove unused formatStreamChunkForDisplay/sanitizeStreamChunkForDisplay
exports; keep only the formatArrayBufferViewForDisplay path actually used
by DataInspector.
- Replace broken role=tablist/role=tab on the Decoded/Bytes switcher
with aria-pressed toggle-button semantics.
- Export collapseRefs/isBytesDisplay and add regression tests covering
typed-array detection (top-level, nested in object/array/Map/Set,
DataView exclusion).
* Replace eval with JSON.parse in serialization revive helper (#1848)
* Replace eval with JSON.parse in serialization revive helper
devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Drop redundant workflow package from changeset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* Add e2e test for UTF-8 parseable stream chunks
Emits Uint8Array chunks containing multi-byte UTF-8 (Latin Extended,
CJK, emoji, RTL Arabic) plus a UTF-8 encoded JSON document, and
asserts each chunk round-trips through TextDecoder({ fatal: true }).
Exercises the same decode path the web inspector relies on for
typed-array stream values.
Made-with: Cursor
---------
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

5 participants

@pranaygp@TooTallNate@VaguelySerious@karthikscale3
, '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); } })(); })();
Skip to content

Replace eval with JSON.parse in serialization revive helper - #1848

Merged
pranaygp merged 3 commits into
mainfrom
pranaygp/great-austin-e06cf4
Apr 28, 2026
Merged

Replace eval with JSON.parse in serialization revive helper#1848
pranaygp merged 3 commits into
mainfrom
pranaygp/great-austin-e06cf4

Conversation

@pranaygp

@pranaygppranaygp commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Description

The revive() helper in packages/core/src/serialization.ts used (0, eval) to deserialize the output of devalue.stringify() into its flattened-array form (used by v1Compat paths and later consumed by devalue.unflatten). While the input was controlled (always the result of devalue.stringify() called moments earlier), eval is still an unnecessary anti-pattern flagged by the security review.

devalue.stringify() is documented and implemented to always emit valid JSON — special values (undefined, NaN, Infinity, -Infinity, -0) are encoded as negative integer sentinels (-1, -3, -4, -5, -6), and the rest of the structure is ordinary JSON. devalue.parse() itself internally does unflatten(JSON.parse(serialized)). So JSON.parse is a safe drop-in replacement.

Note: devalue 5.6.3 does not export a public flatten() function (only unflatten), so the stringify-then-parse approach is retained — just without eval.

How did you test your changes?

  • Ran pnpm vitest run src/serialization.test.ts in packages/core. 116 tests pass; 7 DOMException failures are pre-existing on main (verified via git stash) and unrelated to this change.
  • No new tests needed: the v1Compat dehydrator paths exercised by existing serialization tests round-trip through revive().

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)
  • 📝 Ping @vercel/workflow in a comment once the PR is ready, and the above checklist is complete

devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings April 24, 2026 00:37
@changeset-bot

changeset-botBot commented Apr 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3c7e59a

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

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

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 Apr 24, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, CommentApr 28, 2026 10:28pm
example-nextjs-workflow-webpackReadyReadyPreview, CommentApr 28, 2026 10:28pm
example-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-astro-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-express-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-fastify-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-hono-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-nitro-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-nuxt-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-sveltekit-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workbench-vite-workflowReadyReadyPreview, CommentApr 28, 2026 10:28pm
workflow-docsReadyReadyPreview, Comment, Open in v0Apr 28, 2026 10:28pm
workflow-swc-playgroundReadyReadyPreview, CommentApr 28, 2026 10:28pm
workflow-webReadyReadyPreview, CommentApr 28, 2026 10:28pm

Comment thread.changeset/no-eval-in-revive.md Outdated
@@ -0,0 +1,6 @@
---
"@workflow/core": patch
"workflow": patch

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't add workflow to changeset. that's implicit from deps like @workflow/core

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in e2da618.

@github-actions

github-actionsBot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production9780671045
✅ 💻 Local Development10540861140
✅ 📦 Local Production10540861140
✅ 🐘 Local Postgres10540861140
✅ 🪟 Windows950095
✅ 📋 Other267018285
Total450203434845

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro8807
✅ example8807
✅ express8807
✅ fastify8807
✅ hono8807
✅ nextjs-turbopack9302
✅ nextjs-webpack9302
✅ nitro8807
✅ nuxt8807
✅ sveltekit8807
✅ vite8807
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable8906
✅ express-stable8906
✅ fastify-stable8906
✅ hono-stable8906
✅ nextjs-turbopack-canary76019
✅ nextjs-turbopack-stable9500
✅ nextjs-webpack-canary76019
✅ nextjs-webpack-stable9500
✅ nitro-stable8906
✅ nuxt-stable8906
✅ sveltekit-stable8906
✅ vite-stable8906
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack9500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable8906
✅ e2e-local-postgres-nest-stable8906
✅ e2e-local-prod-nest-stable8906

📋 View full workflow run

@github-actions

github-actionsBot commented Apr 24, 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🥇 Next.js (Turbopack)0.039s1.007s0.968s101.00x
💻 LocalNitro0.040s (-6.3% 🟢)1.005s (~)0.964s101.03x
💻 LocalExpress0.041s (-7.2% 🟢)1.005s (~)0.964s101.05x
🐘 PostgresNext.js (Turbopack)0.056s1.009s0.953s101.44x
🐘 PostgresNitro0.060s (-37.4% 🟢)1.010s (-3.2%)0.950s101.52x
🐘 PostgresExpress0.060s (+4.1%)1.009s (~)0.949s101.54x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.089s2.006s0.916s101.00x
💻 LocalExpress1.128s (~)2.006s (~)0.877s101.04x
💻 LocalNitro1.128s (~)2.005s (~)0.877s101.04x
🐘 PostgresNext.js (Turbopack)1.131s2.009s0.879s101.04x
🐘 PostgresExpress1.139s (-0.6%)2.010s (~)0.870s101.05x
🐘 PostgresNitro1.143s (~)2.009s (~)0.867s101.05x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.637s11.023s0.386s31.00x
🐘 PostgresNitro10.847s (~)11.020s (~)0.173s31.02x
🐘 PostgresNext.js (Turbopack)10.863s11.024s0.161s31.02x
🐘 PostgresExpress10.871s (-0.8%)11.023s (~)0.152s31.02x
💻 LocalNitro10.931s (~)11.023s (~)0.093s31.03x
💻 LocalExpress10.934s (~)11.023s (~)0.089s31.03x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)14.138s15.029s0.890s41.00x
🐘 PostgresNitro14.523s (~)15.022s (~)0.499s41.03x
🐘 PostgresExpress14.557s (~)15.026s (~)0.470s41.03x
🐘 PostgresNext.js (Turbopack)14.571s15.026s0.455s41.03x
💻 LocalNitro14.964s (-0.7%)15.028s (-6.3% 🟢)0.064s41.06x
💻 LocalExpress15.002s (~)15.280s (+1.7%)0.277s41.06x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)13.913s14.454s0.541s71.00x
🐘 PostgresNitro13.951s (~)14.164s (-1.0%)0.213s71.00x
🐘 PostgresExpress14.135s (+0.9%)14.737s (+1.0%)0.602s71.02x
💻 LocalNext.js (Turbopack)14.733s15.027s0.294s61.06x
💻 LocalNitro16.728s (~)17.030s (~)0.302s61.20x
💻 LocalExpress16.756s (+0.9%)17.032s (~)0.276s61.20x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.223s2.009s0.786s151.00x
🐘 PostgresExpress1.268s (+0.6%)2.010s (~)0.742s151.04x
🐘 PostgresNitro1.274s (~)2.010s (~)0.737s151.04x
💻 LocalNext.js (Turbopack)1.455s2.005s0.550s151.19x
💻 LocalNitro1.524s (-6.6% 🟢)2.007s (-3.2%)0.483s151.25x
💻 LocalExpress1.536s (+3.2%)2.006s (~)0.470s151.26x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.333s (-0.8%)3.008s (~)0.675s101.00x
🐘 PostgresExpress2.360s (~)3.008s (~)0.648s101.01x
🐘 PostgresNext.js (Turbopack)2.374s3.009s0.635s101.02x
💻 LocalNext.js (Turbopack)2.587s3.007s0.420s101.11x
💻 LocalNitro2.973s (-5.4% 🟢)3.564s (-8.3% 🟢)0.591s91.27x
💻 LocalExpress3.029s (+2.6%)3.676s (+6.4% 🔺)0.647s91.30x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.479s (~)4.012s (~)0.532s81.00x
🐘 PostgresNitro3.483s (~)4.011s (~)0.528s81.00x
🐘 PostgresNext.js (Turbopack)3.639s4.009s0.371s81.05x
💻 LocalNext.js (Turbopack)6.286s6.813s0.527s51.81x
💻 LocalNitro8.477s (+1.5%)9.021s (~)0.544s42.44x
💻 LocalExpress8.756s (+5.0% 🔺)9.270s (+2.7%)0.513s42.52x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.231s2.008s0.777s151.00x
🐘 PostgresNitro1.259s (~)2.009s (~)0.750s151.02x
🐘 PostgresExpress1.289s (+2.5%)2.008s (~)0.719s151.05x
💻 LocalNext.js (Turbopack)1.453s2.006s0.553s151.18x
💻 LocalExpress1.547s (-18.3% 🟢)2.005s (-15.2% 🟢)0.458s151.26x
💻 LocalNitro1.555s (-16.6% 🟢)2.006s (-14.3% 🟢)0.450s151.26x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.326s (-0.6%)3.010s (~)0.684s101.00x
🐘 PostgresNext.js (Turbopack)2.392s3.009s0.617s101.03x
🐘 PostgresExpress2.409s (+2.9%)3.013s (~)0.603s101.04x
💻 LocalNext.js (Turbopack)2.672s3.008s0.336s101.15x
💻 LocalNitro3.038s (-0.9%)3.884s (~)0.846s81.31x
💻 LocalExpress3.102s (-1.0%)4.011s (+6.6% 🔺)0.910s81.33x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.468s (~)4.010s (~)0.542s81.00x
🐘 PostgresExpress3.481s (-0.5%)4.012s (~)0.531s81.00x
🐘 PostgresNext.js (Turbopack)3.646s4.012s0.366s81.05x
💻 LocalNext.js (Turbopack)6.437s7.015s0.578s51.86x
💻 LocalNitro8.681s (-5.1% 🟢)9.022s (-10.0% 🟢)0.341s42.50x
💻 LocalExpress9.027s (+2.6%)9.526s (+2.7%)0.499s42.60x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.671s1.021s0.350s591.00x
🐘 PostgresNext.js (Turbopack)0.794s1.023s0.229s591.18x
🐘 PostgresNitro0.801s (-2.4%)1.006s (~)0.205s601.19x
🐘 PostgresExpress0.841s (~)1.023s (~)0.181s591.25x
💻 LocalNitro0.989s (+0.8%)1.178s (+7.7% 🔺)0.189s521.47x
💻 LocalExpress0.993s (+1.0%)1.281s (+19.1% 🔺)0.288s471.48x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.898s (-1.5%)2.053s (-2.3%)0.155s441.00x
🐘 PostgresNext.js (Turbopack)1.922s2.100s0.179s431.01x
🐘 PostgresExpress1.930s (-2.4%)2.123s (-6.0% 🟢)0.193s431.02x
💻 LocalNext.js (Turbopack)2.129s3.007s0.878s301.12x
💻 LocalNitro3.020s (~)3.729s (-0.8%)0.709s251.59x
💻 LocalExpress3.029s (~)3.586s (~)0.557s261.60x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.863s (-5.9% 🟢)4.148s (-9.9% 🟢)0.285s291.00x
🐘 PostgresNext.js (Turbopack)3.881s4.149s0.267s291.00x
🐘 PostgresExpress3.911s (-2.0%)4.147s (-5.1% 🟢)0.236s291.01x
💻 LocalNext.js (Turbopack)7.000s7.425s0.425s171.81x
💻 LocalNitro9.161s (-1.5%)9.864s (-1.5%)0.703s132.37x
💻 LocalExpress9.338s (+1.4%)9.942s (-0.8%)0.603s132.42x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.250s1.007s0.757s601.00x
🐘 PostgresNitro0.287s (+1.2%)1.007s (~)0.721s601.15x
🐘 PostgresExpress0.288s (+2.1%)1.007s (~)0.718s601.15x
💻 LocalNext.js (Turbopack)0.547s1.004s0.457s602.19x
💻 LocalNitro0.573s (-5.2% 🟢)1.021s (~)0.448s592.29x
💻 LocalExpress0.595s (+6.2% 🔺)1.004s (~)0.409s602.38x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.482s1.018s0.536s891.00x
🐘 PostgresExpress0.496s (-2.7%)1.007s (~)0.510s901.03x
🐘 PostgresNitro0.504s (+1.6%)1.007s (~)0.502s901.05x
💻 LocalNext.js (Turbopack)2.388s3.008s0.620s304.96x
💻 LocalNitro2.507s (-1.2%)3.009s (~)0.502s305.21x
💻 LocalExpress2.587s (+2.9%)3.008s (~)0.422s305.37x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.764s1.007s0.243s1201.00x
🐘 PostgresExpress0.793s (-3.2%)1.016s (~)0.223s1191.04x
🐘 PostgresNitro0.796s (+0.7%)1.008s (~)0.212s1201.04x
💻 LocalNext.js (Turbopack)9.109s9.636s0.527s1311.92x
💻 LocalNitro11.000s (-1.7%)11.663s (~)0.663s1114.40x
💻 LocalExpress11.425s (+2.1%)12.030s (+0.7%)0.605s1014.95x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.138s1.003s0.009s1.015s0.878s101.00x
🐘 PostgresNext.js (Turbopack)0.193s1.001s0.001s1.010s0.817s101.40x
🐘 PostgresNitro0.196s (-4.3%)1.000s (~)0.001s (-13.3% 🟢)1.010s (~)0.814s101.43x
💻 LocalExpress0.205s (+2.8%)1.004s (~)0.012s (-1.7%)1.018s (~)0.814s101.49x
🐘 PostgresExpress0.208s (+1.4%)0.993s (-0.6%)0.002s (+12.5% 🔺)1.010s (~)0.803s101.51x
💻 LocalNitro0.213s (~)1.004s (~)0.012s (-4.0%)1.018s (~)0.805s101.55x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.619s (-0.9%)1.005s (~)0.013s (+225.8% 🔺)1.031s (+0.9%)0.413s591.00x
🐘 PostgresExpress0.621s (-1.4%)1.001s (-0.6%)0.013s (+242.5% 🔺)1.030s (+0.7%)0.409s591.00x
🐘 PostgresNext.js (Turbopack)0.640s1.026s0.007s1.041s0.401s581.03x
💻 LocalNitro0.745s (-11.2% 🟢)1.013s (~)0.009s (-2.9%)1.023s (-8.3% 🟢)0.279s591.20x
💻 LocalNext.js (Turbopack)0.768s1.010s0.009s1.226s0.459s491.24x
💻 LocalExpress0.864s (+14.1% 🔺)1.013s (-1.5%)0.010s (+5.2% 🔺)1.118s (+7.5% 🔺)0.254s541.40x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.929s1.112s0.000s1.119s0.190s541.00x
🐘 PostgresExpress0.951s (-1.0%)1.147s (-10.2% 🟢)0.000s (-11.5% 🟢)1.162s (-11.1% 🟢)0.210s521.02x
🐘 PostgresNitro0.973s (~)1.245s (~)0.000s (~)1.257s (~)0.284s481.05x
💻 LocalNext.js (Turbopack)1.161s2.016s0.000s2.019s0.858s301.25x
💻 LocalNitro1.224s (~)2.020s (~)0.000s (+366.7% 🔺)2.022s (~)0.798s301.32x
💻 LocalExpress1.283s (+4.7%)2.022s (~)0.001s (+80.0% 🔺)2.025s (~)0.742s301.38x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.764s (-1.5%)2.139s (~)0.000s (-100.0% 🟢)2.152s (-1.0%)0.388s281.00x
🐘 PostgresNext.js (Turbopack)1.800s2.147s0.000s2.168s0.368s281.02x
🐘 PostgresExpress1.829s (+3.2%)2.176s (~)0.000s (+Infinity% 🔺)2.189s (~)0.360s281.04x
💻 LocalNext.js (Turbopack)3.360s3.968s0.001s3.971s0.611s161.90x
💻 LocalNitro3.518s (+3.9%)4.100s (+1.7%)0.000s (-12.5% 🟢)4.103s (+1.6%)0.585s151.99x
💻 LocalExpress3.568s (+2.9%)4.098s (+1.6%)0.001s (-33.3% 🟢)4.101s (+1.6%)0.533s152.02x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)20/21
🐘 PostgresNext.js (Turbopack)11/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres18/21
Next.js (Turbopack)🐘 Postgres15/21
Nitro🐘 Postgres19/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)

📋 View full workflow run

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@karthikscale3karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix seems straightforward. I will let others take a pass.

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified devalue.stringify() output is always valid JSON — special values (undefined, NaN, ±Infinity, -0, holes, sparse arrays) are encoded as negative integer sentinels (see constants.js: UNDEFINED=-1, HOLE=-2, NAN=-3, POSITIVE_INFINITY=-4, NEGATIVE_INFINITY=-5, NEGATIVE_ZERO=-6, SPARSE=-7), and the top-level short-circuit in stringify.js returns a stringified integer (\${index}`) rather than a raw JS literal. The devalue README's evalguidance applies touneval(), not stringify()devalue.parse()itself is internallyunflatten(JSON.parse(serialized)), so JSON.parseis the canonical way to consumestringify()` output.

Empirically verified JSON.parse and (0, eval)(\(${s})`)produce identical results forundefined, NaN, ±Infinity, -0`, and compound structures containing them.

Non-blocking follow-up: once this lands, the revive() wrapper itself becomes trivial and could be inlined — the 4 call sites could just call JSON.parse(str) directly and the helper deleted. Happy to open a follow-up PR for that.

@pranaygp
pranaygp enabled auto-merge (squash) April 24, 2026 01:46
@pranaygp
pranaygp merged commit 7d07fab into mainApr 28, 2026
155 of 163 checks passed
@pranaygp
pranaygp deleted the pranaygp/great-austin-e06cf4 branch April 28, 2026 22:58
karthikscale3 pushed a commit that referenced this pull request Apr 28, 2026
* Replace eval with JSON.parse in serialization revive helper
devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Drop redundant workflow package from changeset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
karthikscale3 added a commit that referenced this pull request Apr 29, 2026
* Decode typed array stream chunks
* Render decoded stream bytes with raw view
* Render decoded bytes in data inspector
* Use generic byte inspector for streams
* review feedback: narrow stream-display exports, fix tab a11y, add collapseRefs tests
- Remove unused formatStreamChunkForDisplay/sanitizeStreamChunkForDisplay
exports; keep only the formatArrayBufferViewForDisplay path actually used
by DataInspector.
- Replace broken role=tablist/role=tab on the Decoded/Bytes switcher
with aria-pressed toggle-button semantics.
- Export collapseRefs/isBytesDisplay and add regression tests covering
typed-array detection (top-level, nested in object/array/Map/Set,
DataView exclusion).
* Replace eval with JSON.parse in serialization revive helper (#1848)
* Replace eval with JSON.parse in serialization revive helper
devalue.stringify() always produces valid JSON — special values
(undefined, NaN, Infinity, -0) are encoded as negative integer
sentinels. JSON.parse yields the same flattened array form that
unflatten() expects, without the eval anti-pattern (VULN-918).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Drop redundant workflow package from changeset
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* Add e2e test for UTF-8 parseable stream chunks
Emits Uint8Array chunks containing multi-byte UTF-8 (Latin Extended,
CJK, emoji, RTL Arabic) plus a UTF-8 encoded JSON document, and
asserts each chunk round-trips through TextDecoder({ fatal: true }).
Exercises the same decode path the web inspector relies on for
typed-array stream values.
Made-with: Cursor
---------
Co-authored-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

5 participants

@pranaygp@TooTallNate@VaguelySerious@karthikscale3