Skip to content

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

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

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

Conversation

@pranaygp
Copy link
Copy Markdown
Contributor

@pranaygp pranaygp commented Apr 24, 2026

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>
Copilot AI review requested due to automatic review settings April 24, 2026 00:37
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 24, 2026

🦋 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
Name Type
@workflow/core Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared Patch
@workflow/web Patch
workflow Patch
@workflow/world-testing Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/nuxt Patch
@workflow/ai Patch

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

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

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 24, 2026

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

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment Apr 28, 2026 10:28pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Apr 28, 2026 10:28pm
example-workflow Ready Ready Preview, Comment Apr 28, 2026 10:28pm
workbench-astro-workflow Ready Ready Preview, Comment Apr 28, 2026 10:28pm
workbench-express-workflow Ready Ready Preview, Comment Apr 28, 2026 10:28pm
workbench-fastify-workflow Ready Ready Preview, Comment Apr 28, 2026 10:28pm
workbench-hono-workflow Ready Ready Preview, Comment Apr 28, 2026 10:28pm
workbench-nitro-workflow Ready Ready Preview, Comment Apr 28, 2026 10:28pm
workbench-nuxt-workflow Ready Ready Preview, Comment Apr 28, 2026 10:28pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Apr 28, 2026 10:28pm
workbench-vite-workflow Ready Ready Preview, Comment Apr 28, 2026 10:28pm
workflow-docs Ready Ready Preview, Comment, Open in v0 Apr 28, 2026 10:28pm
workflow-swc-playground Ready Ready Preview, Comment Apr 28, 2026 10:28pm
workflow-web Ready Ready Preview, Comment Apr 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
Contributor Author

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
Contributor Author

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
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

🧪 E2E Test Results

All tests passed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 978 0 67 1045
✅ 💻 Local Development 1054 0 86 1140
✅ 📦 Local Production 1054 0 86 1140
✅ 🐘 Local Postgres 1054 0 86 1140
✅ 🪟 Windows 95 0 0 95
✅ 📋 Other 267 0 18 285
Total 4502 0 343 4845

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 88 0 7
✅ example 88 0 7
✅ express 88 0 7
✅ fastify 88 0 7
✅ hono 88 0 7
✅ nextjs-turbopack 93 0 2
✅ nextjs-webpack 93 0 2
✅ nitro 88 0 7
✅ nuxt 88 0 7
✅ sveltekit 88 0 7
✅ vite 88 0 7
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 89 0 6
✅ express-stable 89 0 6
✅ fastify-stable 89 0 6
✅ hono-stable 89 0 6
✅ nextjs-turbopack-canary 76 0 19
✅ nextjs-turbopack-stable 95 0 0
✅ nextjs-webpack-canary 76 0 19
✅ nextjs-webpack-stable 95 0 0
✅ nitro-stable 89 0 6
✅ nuxt-stable 89 0 6
✅ sveltekit-stable 89 0 6
✅ vite-stable 89 0 6
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 89 0 6
✅ express-stable 89 0 6
✅ fastify-stable 89 0 6
✅ hono-stable 89 0 6
✅ nextjs-turbopack-canary 76 0 19
✅ nextjs-turbopack-stable 95 0 0
✅ nextjs-webpack-canary 76 0 19
✅ nextjs-webpack-stable 95 0 0
✅ nitro-stable 89 0 6
✅ nuxt-stable 89 0 6
✅ sveltekit-stable 89 0 6
✅ vite-stable 89 0 6
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 89 0 6
✅ express-stable 89 0 6
✅ fastify-stable 89 0 6
✅ hono-stable 89 0 6
✅ nextjs-turbopack-canary 76 0 19
✅ nextjs-turbopack-stable 95 0 0
✅ nextjs-webpack-canary 76 0 19
✅ nextjs-webpack-stable 95 0 0
✅ nitro-stable 89 0 6
✅ nuxt-stable 89 0 6
✅ sveltekit-stable 89 0 6
✅ vite-stable 89 0 6
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 95 0 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 89 0 6
✅ e2e-local-postgres-nest-stable 89 0 6
✅ e2e-local-prod-nest-stable 89 0 6

📋 View full workflow run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 0.039s 1.007s 0.968s 10 1.00x
💻 Local Nitro 0.040s (-6.3% 🟢) 1.005s (~) 0.964s 10 1.03x
💻 Local Express 0.041s (-7.2% 🟢) 1.005s (~) 0.964s 10 1.05x
🐘 Postgres Next.js (Turbopack) 0.056s 1.009s 0.953s 10 1.44x
🐘 Postgres Nitro 0.060s (-37.4% 🟢) 1.010s (-3.2%) 0.950s 10 1.52x
🐘 Postgres Express 0.060s (+4.1%) 1.009s (~) 0.949s 10 1.54x
workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 1.089s 2.006s 0.916s 10 1.00x
💻 Local Express 1.128s (~) 2.006s (~) 0.877s 10 1.04x
💻 Local Nitro 1.128s (~) 2.005s (~) 0.877s 10 1.04x
🐘 Postgres Next.js (Turbopack) 1.131s 2.009s 0.879s 10 1.04x
🐘 Postgres Express 1.139s (-0.6%) 2.010s (~) 0.870s 10 1.05x
🐘 Postgres Nitro 1.143s (~) 2.009s (~) 0.867s 10 1.05x
workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 10.637s 11.023s 0.386s 3 1.00x
🐘 Postgres Nitro 10.847s (~) 11.020s (~) 0.173s 3 1.02x
🐘 Postgres Next.js (Turbopack) 10.863s 11.024s 0.161s 3 1.02x
🐘 Postgres Express 10.871s (-0.8%) 11.023s (~) 0.152s 3 1.02x
💻 Local Nitro 10.931s (~) 11.023s (~) 0.093s 3 1.03x
💻 Local Express 10.934s (~) 11.023s (~) 0.089s 3 1.03x
workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 14.138s 15.029s 0.890s 4 1.00x
🐘 Postgres Nitro 14.523s (~) 15.022s (~) 0.499s 4 1.03x
🐘 Postgres Express 14.557s (~) 15.026s (~) 0.470s 4 1.03x
🐘 Postgres Next.js (Turbopack) 14.571s 15.026s 0.455s 4 1.03x
💻 Local Nitro 14.964s (-0.7%) 15.028s (-6.3% 🟢) 0.064s 4 1.06x
💻 Local Express 15.002s (~) 15.280s (+1.7%) 0.277s 4 1.06x
workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 13.913s 14.454s 0.541s 7 1.00x
🐘 Postgres Nitro 13.951s (~) 14.164s (-1.0%) 0.213s 7 1.00x
🐘 Postgres Express 14.135s (+0.9%) 14.737s (+1.0%) 0.602s 7 1.02x
💻 Local Next.js (Turbopack) 14.733s 15.027s 0.294s 6 1.06x
💻 Local Nitro 16.728s (~) 17.030s (~) 0.302s 6 1.20x
💻 Local Express 16.756s (+0.9%) 17.032s (~) 0.276s 6 1.20x
Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 1.223s 2.009s 0.786s 15 1.00x
🐘 Postgres Express 1.268s (+0.6%) 2.010s (~) 0.742s 15 1.04x
🐘 Postgres Nitro 1.274s (~) 2.010s (~) 0.737s 15 1.04x
💻 Local Next.js (Turbopack) 1.455s 2.005s 0.550s 15 1.19x
💻 Local Nitro 1.524s (-6.6% 🟢) 2.007s (-3.2%) 0.483s 15 1.25x
💻 Local Express 1.536s (+3.2%) 2.006s (~) 0.470s 15 1.26x
Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 2.333s (-0.8%) 3.008s (~) 0.675s 10 1.00x
🐘 Postgres Express 2.360s (~) 3.008s (~) 0.648s 10 1.01x
🐘 Postgres Next.js (Turbopack) 2.374s 3.009s 0.635s 10 1.02x
💻 Local Next.js (Turbopack) 2.587s 3.007s 0.420s 10 1.11x
💻 Local Nitro 2.973s (-5.4% 🟢) 3.564s (-8.3% 🟢) 0.591s 9 1.27x
💻 Local Express 3.029s (+2.6%) 3.676s (+6.4% 🔺) 0.647s 9 1.30x
Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 3.479s (~) 4.012s (~) 0.532s 8 1.00x
🐘 Postgres Nitro 3.483s (~) 4.011s (~) 0.528s 8 1.00x
🐘 Postgres Next.js (Turbopack) 3.639s 4.009s 0.371s 8 1.05x
💻 Local Next.js (Turbopack) 6.286s 6.813s 0.527s 5 1.81x
💻 Local Nitro 8.477s (+1.5%) 9.021s (~) 0.544s 4 2.44x
💻 Local Express 8.756s (+5.0% 🔺) 9.270s (+2.7%) 0.513s 4 2.52x
Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 1.231s 2.008s 0.777s 15 1.00x
🐘 Postgres Nitro 1.259s (~) 2.009s (~) 0.750s 15 1.02x
🐘 Postgres Express 1.289s (+2.5%) 2.008s (~) 0.719s 15 1.05x
💻 Local Next.js (Turbopack) 1.453s 2.006s 0.553s 15 1.18x
💻 Local Express 1.547s (-18.3% 🟢) 2.005s (-15.2% 🟢) 0.458s 15 1.26x
💻 Local Nitro 1.555s (-16.6% 🟢) 2.006s (-14.3% 🟢) 0.450s 15 1.26x
Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 2.326s (-0.6%) 3.010s (~) 0.684s 10 1.00x
🐘 Postgres Next.js (Turbopack) 2.392s 3.009s 0.617s 10 1.03x
🐘 Postgres Express 2.409s (+2.9%) 3.013s (~) 0.603s 10 1.04x
💻 Local Next.js (Turbopack) 2.672s 3.008s 0.336s 10 1.15x
💻 Local Nitro 3.038s (-0.9%) 3.884s (~) 0.846s 8 1.31x
💻 Local Express 3.102s (-1.0%) 4.011s (+6.6% 🔺) 0.910s 8 1.33x
Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 3.468s (~) 4.010s (~) 0.542s 8 1.00x
🐘 Postgres Express 3.481s (-0.5%) 4.012s (~) 0.531s 8 1.00x
🐘 Postgres Next.js (Turbopack) 3.646s 4.012s 0.366s 8 1.05x
💻 Local Next.js (Turbopack) 6.437s 7.015s 0.578s 5 1.86x
💻 Local Nitro 8.681s (-5.1% 🟢) 9.022s (-10.0% 🟢) 0.341s 4 2.50x
💻 Local Express 9.027s (+2.6%) 9.526s (+2.7%) 0.499s 4 2.60x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 0.671s 1.021s 0.350s 59 1.00x
🐘 Postgres Next.js (Turbopack) 0.794s 1.023s 0.229s 59 1.18x
🐘 Postgres Nitro 0.801s (-2.4%) 1.006s (~) 0.205s 60 1.19x
🐘 Postgres Express 0.841s (~) 1.023s (~) 0.181s 59 1.25x
💻 Local Nitro 0.989s (+0.8%) 1.178s (+7.7% 🔺) 0.189s 52 1.47x
💻 Local Express 0.993s (+1.0%) 1.281s (+19.1% 🔺) 0.288s 47 1.48x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.898s (-1.5%) 2.053s (-2.3%) 0.155s 44 1.00x
🐘 Postgres Next.js (Turbopack) 1.922s 2.100s 0.179s 43 1.01x
🐘 Postgres Express 1.930s (-2.4%) 2.123s (-6.0% 🟢) 0.193s 43 1.02x
💻 Local Next.js (Turbopack) 2.129s 3.007s 0.878s 30 1.12x
💻 Local Nitro 3.020s (~) 3.729s (-0.8%) 0.709s 25 1.59x
💻 Local Express 3.029s (~) 3.586s (~) 0.557s 26 1.60x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 3.863s (-5.9% 🟢) 4.148s (-9.9% 🟢) 0.285s 29 1.00x
🐘 Postgres Next.js (Turbopack) 3.881s 4.149s 0.267s 29 1.00x
🐘 Postgres Express 3.911s (-2.0%) 4.147s (-5.1% 🟢) 0.236s 29 1.01x
💻 Local Next.js (Turbopack) 7.000s 7.425s 0.425s 17 1.81x
💻 Local Nitro 9.161s (-1.5%) 9.864s (-1.5%) 0.703s 13 2.37x
💻 Local Express 9.338s (+1.4%) 9.942s (-0.8%) 0.603s 13 2.42x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 0.250s 1.007s 0.757s 60 1.00x
🐘 Postgres Nitro 0.287s (+1.2%) 1.007s (~) 0.721s 60 1.15x
🐘 Postgres Express 0.288s (+2.1%) 1.007s (~) 0.718s 60 1.15x
💻 Local Next.js (Turbopack) 0.547s 1.004s 0.457s 60 2.19x
💻 Local Nitro 0.573s (-5.2% 🟢) 1.021s (~) 0.448s 59 2.29x
💻 Local Express 0.595s (+6.2% 🔺) 1.004s (~) 0.409s 60 2.38x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 0.482s 1.018s 0.536s 89 1.00x
🐘 Postgres Express 0.496s (-2.7%) 1.007s (~) 0.510s 90 1.03x
🐘 Postgres Nitro 0.504s (+1.6%) 1.007s (~) 0.502s 90 1.05x
💻 Local Next.js (Turbopack) 2.388s 3.008s 0.620s 30 4.96x
💻 Local Nitro 2.507s (-1.2%) 3.009s (~) 0.502s 30 5.21x
💻 Local Express 2.587s (+2.9%) 3.008s (~) 0.422s 30 5.37x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 0.764s 1.007s 0.243s 120 1.00x
🐘 Postgres Express 0.793s (-3.2%) 1.016s (~) 0.223s 119 1.04x
🐘 Postgres Nitro 0.796s (+0.7%) 1.008s (~) 0.212s 120 1.04x
💻 Local Next.js (Turbopack) 9.109s 9.636s 0.527s 13 11.92x
💻 Local Nitro 11.000s (-1.7%) 11.663s (~) 0.663s 11 14.40x
💻 Local Express 11.425s (+2.1%) 12.030s (+0.7%) 0.605s 10 14.95x
Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 0.138s 1.003s 0.009s 1.015s 0.878s 10 1.00x
🐘 Postgres Next.js (Turbopack) 0.193s 1.001s 0.001s 1.010s 0.817s 10 1.40x
🐘 Postgres Nitro 0.196s (-4.3%) 1.000s (~) 0.001s (-13.3% 🟢) 1.010s (~) 0.814s 10 1.43x
💻 Local Express 0.205s (+2.8%) 1.004s (~) 0.012s (-1.7%) 1.018s (~) 0.814s 10 1.49x
🐘 Postgres Express 0.208s (+1.4%) 0.993s (-0.6%) 0.002s (+12.5% 🔺) 1.010s (~) 0.803s 10 1.51x
💻 Local Nitro 0.213s (~) 1.004s (~) 0.012s (-4.0%) 1.018s (~) 0.805s 10 1.55x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.619s (-0.9%) 1.005s (~) 0.013s (+225.8% 🔺) 1.031s (+0.9%) 0.413s 59 1.00x
🐘 Postgres Express 0.621s (-1.4%) 1.001s (-0.6%) 0.013s (+242.5% 🔺) 1.030s (+0.7%) 0.409s 59 1.00x
🐘 Postgres Next.js (Turbopack) 0.640s 1.026s 0.007s 1.041s 0.401s 58 1.03x
💻 Local Nitro 0.745s (-11.2% 🟢) 1.013s (~) 0.009s (-2.9%) 1.023s (-8.3% 🟢) 0.279s 59 1.20x
💻 Local Next.js (Turbopack) 0.768s 1.010s 0.009s 1.226s 0.459s 49 1.24x
💻 Local Express 0.864s (+14.1% 🔺) 1.013s (-1.5%) 0.010s (+5.2% 🔺) 1.118s (+7.5% 🔺) 0.254s 54 1.40x
10 parallel streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 0.929s 1.112s 0.000s 1.119s 0.190s 54 1.00x
🐘 Postgres Express 0.951s (-1.0%) 1.147s (-10.2% 🟢) 0.000s (-11.5% 🟢) 1.162s (-11.1% 🟢) 0.210s 52 1.02x
🐘 Postgres Nitro 0.973s (~) 1.245s (~) 0.000s (~) 1.257s (~) 0.284s 48 1.05x
💻 Local Next.js (Turbopack) 1.161s 2.016s 0.000s 2.019s 0.858s 30 1.25x
💻 Local Nitro 1.224s (~) 2.020s (~) 0.000s (+366.7% 🔺) 2.022s (~) 0.798s 30 1.32x
💻 Local Express 1.283s (+4.7%) 2.022s (~) 0.001s (+80.0% 🔺) 2.025s (~) 0.742s 30 1.38x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.764s (-1.5%) 2.139s (~) 0.000s (-100.0% 🟢) 2.152s (-1.0%) 0.388s 28 1.00x
🐘 Postgres Next.js (Turbopack) 1.800s 2.147s 0.000s 2.168s 0.368s 28 1.02x
🐘 Postgres Express 1.829s (+3.2%) 2.176s (~) 0.000s (+Infinity% 🔺) 2.189s (~) 0.360s 28 1.04x
💻 Local Next.js (Turbopack) 3.360s 3.968s 0.001s 3.971s 0.611s 16 1.90x
💻 Local Nitro 3.518s (+3.9%) 4.100s (+1.7%) 0.000s (-12.5% 🟢) 4.103s (+1.6%) 0.585s 15 1.99x
💻 Local Express 3.568s (+2.9%) 4.098s (+1.6%) 0.001s (-33.3% 🟢) 4.101s (+1.6%) 0.533s 15 2.02x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Next.js (Turbopack) 20/21
🐘 Postgres Next.js (Turbopack) 11/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 🐘 Postgres 18/21
Next.js (Turbopack) 🐘 Postgres 15/21
Nitro 🐘 Postgres 19/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>
Copy link
Copy Markdown
Contributor

@karthikscale3 karthikscale3 left a comment

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.

Copy link
Copy Markdown
Member

@TooTallNate TooTallNate left a comment

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 main Apr 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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants