Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Enable custom class serialization transformations for "client" mode#860

Merged
TooTallNate merged 2 commits intomainfrom
01-26-enable_custom_class_serialization_transformations_for_client_mode
Jan 27, 2026
Merged

Enable custom class serialization transformations for "client" mode#860
TooTallNate merged 2 commits intomainfrom
01-26-enable_custom_class_serialization_transformations_for_client_mode

Conversation

@TooTallNate
Copy link
Member

@TooTallNate TooTallNate commented Jan 26, 2026

Enable class serialization in client mode to support passing class instances to workflow functions.

What changed?

  • Added support for class serialization transformations in "client" mode
  • The plugin now generates necessary imports and registration calls for classes that need serialization in client mode
  • When classes are detected that need serialization, the plugin:
    • Imports registerSerializationClass from "workflow/internal/class-serialization"
    • Adds registration calls for each class with a unique class ID
  • Updated test outputs to reflect these changes

How to test?

  1. Create a class with serialization methods (using WORKFLOW_SERIALIZE and WORKFLOW_DESERIALIZE symbols)
  2. Use the class in a client-side context where it's passed to a workflow function
  3. Verify that the class is properly serialized and deserialized when passed between client and workflow

Why make this change?

Previously, class serialization was only enabled in workflow mode, which meant that classes couldn't be properly serialized when passed from client code to workflow functions. This change ensures that classes with custom serialization methods work correctly when used as arguments to start(workflow) calls from client code.

@changeset-bot
Copy link

changeset-bot bot commented Jan 26, 2026

🦋 Changeset detected

Latest commit: 1a72c70

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

This PR includes changesets to release 15 packages
Name Type
@workflow/swc-plugin Patch
@workflow/astro Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/nest Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
workflow Patch
@workflow/world-testing Patch
@workflow/example-nest Patch
@workflow/docs-typecheck 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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 26, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 457 0 38 495
❌ 💻 Local Development 416 2 32 450
✅ 📦 Local Production 418 0 32 450
✅ 🐘 Local Postgres 418 0 32 450
✅ 🪟 Windows 45 0 0 45
❌ 🌍 Community Worlds 31 161 0 192
✅ 📋 Other 123 0 12 135
Total 1908 163 146 2217

❌ Failed Tests

💻 Local Development (2 failed)

astro-stable (2 failed):

  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
🌍 Community Worlds (161 failed)

mongodb (40 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

redis (40 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

starter (41 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (CLI) - workflow health command reports healthy endpoints
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

turso (40 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 41 0 4
✅ example 41 0 4
✅ express 41 0 4
✅ fastify 41 0 4
✅ hono 41 0 4
✅ nextjs-turbopack 44 0 1
✅ nextjs-webpack 44 0 1
✅ nitro 41 0 4
✅ nuxt 41 0 4
✅ sveltekit 41 0 4
✅ vite 41 0 4
❌ 💻 Local Development
App Passed Failed Skipped
❌ astro-stable 39 2 4
✅ express-stable 41 0 4
✅ fastify-stable 41 0 4
✅ hono-stable 41 0 4
✅ nextjs-turbopack-stable 45 0 0
✅ nextjs-webpack-stable 45 0 0
✅ nitro-stable 41 0 4
✅ nuxt-stable 41 0 4
✅ sveltekit-stable 41 0 4
✅ vite-stable 41 0 4
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 41 0 4
✅ express-stable 41 0 4
✅ fastify-stable 41 0 4
✅ hono-stable 41 0 4
✅ nextjs-turbopack-stable 45 0 0
✅ nextjs-webpack-stable 45 0 0
✅ nitro-stable 41 0 4
✅ nuxt-stable 41 0 4
✅ sveltekit-stable 41 0 4
✅ vite-stable 41 0 4
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 41 0 4
✅ express-stable 41 0 4
✅ fastify-stable 41 0 4
✅ hono-stable 41 0 4
✅ nextjs-turbopack-stable 45 0 0
✅ nextjs-webpack-stable 45 0 0
✅ nitro-stable 41 0 4
✅ nuxt-stable 41 0 4
✅ sveltekit-stable 41 0 4
✅ vite-stable 41 0 4
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 45 0 0
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 0
❌ mongodb 5 40 0
✅ redis-dev 3 0 0
❌ redis 5 40 0
✅ starter-dev 3 0 0
❌ starter 4 41 0
✅ turso-dev 3 0 0
❌ turso 5 40 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 41 0 4
✅ e2e-local-postgres-nest-stable 41 0 4
✅ e2e-local-prod-nest-stable 41 0 4

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: success
  • Local Dev: failure
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@vercel
Copy link
Contributor

vercel bot commented Jan 26, 2026

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

Project Deployment Review Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment Jan 27, 2026 7:00am
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jan 27, 2026 7:00am
example-workflow Ready Ready Preview, Comment Jan 27, 2026 7:00am
workbench-astro-workflow Ready Ready Preview, Comment Jan 27, 2026 7:00am
workbench-express-workflow Ready Ready Preview, Comment Jan 27, 2026 7:00am
workbench-fastify-workflow Ready Ready Preview, Comment Jan 27, 2026 7:00am
workbench-hono-workflow Ready Ready Preview, Comment Jan 27, 2026 7:00am
workbench-nitro-workflow Ready Ready Preview, Comment Jan 27, 2026 7:00am
workbench-nuxt-workflow Ready Ready Preview, Comment Jan 27, 2026 7:00am
workbench-sveltekit-workflow Ready Ready Preview, Comment Jan 27, 2026 7:00am
workbench-vite-workflow Ready Ready Preview, Comment Jan 27, 2026 7:00am
workflow-docs Ready Ready Preview, Comment Jan 27, 2026 7:00am
workflow-nest Error Error Jan 27, 2026 7:00am

Copy link
Member Author

TooTallNate commented Jan 26, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@TooTallNate TooTallNate force-pushed the 01-26-enable_custom_class_serialization_transformations_for_client_mode branch from 2eb0768 to ebe0f20 Compare January 26, 2026 22:46
@TooTallNate TooTallNate force-pushed the 01-26-enable_custom_class_serialization_transformations_for_client_mode branch from 08e6829 to 4498ca1 Compare January 26, 2026 23:58
@TooTallNate TooTallNate changed the base branch from 01-26-add_discovery_for_custom_classes_with_workflow_serialization to graphite-base/860 January 27, 2026 00:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enables custom class serialization transformations for "client" mode in the SWC plugin. Previously, class serialization was only handled in workflow and step modes. This change ensures that classes with custom serialization methods can be properly serialized when passed from client code to workflow functions via start(workflow) calls.

Changes:

  • Added import generation for registerSerializationClass in client mode when classes need serialization
  • Added registration call generation for classes in client mode (both Module and Script cases)
  • Updated test fixtures to reflect the new client mode behavior with serialization imports and registration calls

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/swc-plugin-workflow/transform/src/lib.rs Added logic to generate serialization imports and registration calls for client mode in both Module and Script cases
packages/swc-plugin-workflow/transform/tests/fixture/static-method-step/output-client.js Added expected import and registration call for MyService class
packages/swc-plugin-workflow/transform/tests/fixture/custom-serialization/output-client.js Added expected import and registration call for Point class
packages/swc-plugin-workflow/transform/tests/fixture/custom-serialization-local-const/output-client.js Added expected import and registration calls for Circle, Rectangle, and Triangle classes
packages/swc-plugin-workflow/transform/tests/fixture/custom-serialization-imported/output-client.js Added expected import and registration calls for Color and Vector classes
packages/swc-plugin-workflow/transform/tests/errors/instance-methods/output-client.js Added expected import and registration call for TestClass
.changeset/modern-clubs-own.md Added changeset documenting this patch change

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@ijjk ijjk left a comment

Choose a reason for hiding this comment

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

Seems good but the deduplication callout from copilot does seem good as well

@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 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.041s (-16.4% 🟢) 1.019s (~) 0.978s 10 1.00x
💻 Local Express 0.043s (-1.6%) 1.008s (-1.3%) 0.965s 10 1.04x
💻 Local Nitro 0.043s (-11.1% 🟢) 1.007s (~) 0.964s 10 1.06x
🐘 Postgres Express 0.127s (-48.6% 🟢) 1.015s (~) 0.888s 10 3.10x
🐘 Postgres Nitro 0.162s (-60.9% 🟢) 1.026s (+1.2%) 0.864s 10 3.96x
🐘 Postgres Next.js (Turbopack) 0.242s (+100.4% 🔺) 1.021s (~) 0.778s 10 5.93x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 0.596s (-11.7% 🟢) 1.698s (+12.3% 🔺) 1.101s 10 1.00x
▲ Vercel Express 0.629s (-18.0% 🟢) 1.601s (-5.4% 🟢) 0.972s 10 1.05x
▲ Vercel Next.js (Turbopack) 0.695s (-17.4% 🟢) 1.553s (-9.9% 🟢) 0.858s 10 1.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 1.103s (~) 2.012s (~) 0.909s 10 1.00x
💻 Local Express 1.116s (~) 2.008s (~) 0.892s 10 1.01x
💻 Local Nitro 1.118s (~) 2.007s (~) 0.889s 10 1.01x
🐘 Postgres Next.js (Turbopack) 2.254s (+17.5% 🔺) 3.019s (+49.8% 🔺) 0.765s 10 2.04x
🐘 Postgres Express 2.472s (+17.8% 🔺) 3.013s (~) 0.541s 10 2.24x
🐘 Postgres Nitro 2.473s (+9.2% 🔺) 3.014s (~) 0.542s 10 2.24x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.730s (-1.8%) 3.744s (+3.0%) 1.013s 10 1.00x
▲ Vercel Nitro 2.874s (~) 3.779s (+4.6%) 0.905s 10 1.05x
▲ Vercel Next.js (Turbopack) 2.952s (+1.5%) 3.663s (-0.7%) 0.711s 10 1.08x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 10.716s (~) 11.018s (~) 0.302s 5 1.00x
💻 Local Nitro 10.841s (~) 11.014s (~) 0.173s 5 1.01x
💻 Local Express 10.852s (~) 11.013s (~) 0.161s 5 1.01x
🐘 Postgres Nitro 20.292s (+0.6%) 21.041s (~) 0.750s 5 1.89x
🐘 Postgres Express 20.310s (+30.5% 🔺) 21.037s (+31.2% 🔺) 0.726s 5 1.90x
🐘 Postgres Next.js (Turbopack) 20.354s (+40.4% 🔺) 21.043s (+39.9% 🔺) 0.689s 5 1.90x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 22.236s (-6.6% 🟢) 23.066s (-5.8% 🟢) 0.830s 5 1.00x
▲ Vercel Express 22.515s (-6.9% 🟢) 23.414s (-6.1% 🟢) 0.898s 5 1.01x
▲ Vercel Next.js (Turbopack) 22.838s (~) 23.452s (-1.4%) 0.614s 5 1.03x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 1.389s (~) 2.012s (~) 0.622s 15 1.00x
💻 Local Nitro 1.413s (~) 2.007s (~) 0.594s 15 1.02x
💻 Local Express 1.414s (-0.8%) 2.007s (~) 0.593s 15 1.02x
🐘 Postgres Next.js (Turbopack) 2.200s (+3.3%) 2.853s (+5.3% 🔺) 0.653s 11 1.58x
🐘 Postgres Nitro 2.305s (-4.9%) 2.678s (-11.0% 🟢) 0.373s 12 1.66x
🐘 Postgres Express 2.515s (+21.3% 🔺) 3.014s (+16.0% 🔺) 0.499s 10 1.81x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 3.000s (-3.5%) 3.773s (-5.5% 🟢) 0.773s 8 1.00x
▲ Vercel Nitro 3.406s (+7.1% 🔺) 4.360s (+11.9% 🔺) 0.954s 7 1.14x
▲ Vercel Express 3.551s (+21.7% 🔺) 4.414s (+16.5% 🔺) 0.863s 7 1.18x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 2.472s (~) 3.066s (-4.3%) 0.594s 10 1.00x
💻 Local Express 2.502s (-2.0%) 3.029s (+0.5%) 0.527s 10 1.01x
💻 Local Nitro 2.510s (-2.1%) 3.026s (~) 0.515s 10 1.02x
🐘 Postgres Express 7.934s (-20.5% 🟢) 8.305s (-20.5% 🟢) 0.371s 4 3.21x
🐘 Postgres Nitro 8.839s (+18.5% 🔺) 9.274s (+14.9% 🔺) 0.435s 4 3.58x
🐘 Postgres Next.js (Turbopack) 11.559s (-0.8%) 12.037s (-0.7%) 0.478s 3 4.68x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 3.235s (-6.5% 🟢) 4.052s (-0.7%) 0.817s 8 1.00x
▲ Vercel Express 3.374s (+2.4%) 4.168s (+2.8%) 0.795s 8 1.04x
▲ Vercel Nitro 3.535s (+15.7% 🔺) 4.228s (+10.6% 🔺) 0.694s 8 1.09x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 1.409s (-2.7%) 2.007s (~) 0.598s 15 1.00x
💻 Local Next.js (Turbopack) 1.427s (+1.0%) 2.013s (~) 0.586s 15 1.01x
💻 Local Express 1.434s (~) 2.006s (~) 0.572s 15 1.02x
🐘 Postgres Nitro 1.967s (-8.0% 🟢) 2.477s (-4.7%) 0.511s 13 1.40x
🐘 Postgres Express 2.061s (+14.5% 🔺) 2.528s (+13.3% 🔺) 0.467s 12 1.46x
🐘 Postgres Next.js (Turbopack) 2.299s (-2.5%) 2.746s (-9.2% 🟢) 0.447s 11 1.63x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.838s (+1.0%) 3.792s (+3.6%) 0.953s 8 1.00x
▲ Vercel Express 2.853s (+0.9%) 3.886s (+5.3% 🔺) 1.033s 8 1.01x
▲ Vercel Next.js (Turbopack) 3.017s (+5.7% 🔺) 4.024s (+9.6% 🔺) 1.007s 8 1.06x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 2.536s (~) 3.102s (+1.6%) 0.566s 10 1.00x
💻 Local Express 2.568s (-2.8%) 3.022s (~) 0.454s 10 1.01x
💻 Local Nitro 2.596s (-0.5%) 3.022s (~) 0.427s 10 1.02x
🐘 Postgres Nitro 11.622s (-3.4%) 12.050s (-2.8%) 0.428s 3 4.58x
🐘 Postgres Express 12.974s (+6.7% 🔺) 13.022s (+2.5%) 0.048s 3 5.12x
🐘 Postgres Next.js (Turbopack) 13.121s (-5.6% 🟢) 13.705s (-4.6%) 0.584s 3 5.17x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 3.089s (-21.8% 🟢) 3.948s (-18.8% 🟢) 0.859s 8 1.00x
▲ Vercel Next.js (Turbopack) 3.263s (+4.6%) 4.032s (+6.9% 🔺) 0.769s 8 1.06x
▲ Vercel Express 3.657s (+2.4%) 4.312s (-0.8%) 0.655s 7 1.18x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

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.144s (+1.6%) 1.004s (~) 0.016s (-12.2% 🟢) 1.027s (~) 0.884s 10 1.00x
💻 Local Express 0.184s (-0.7%) 0.992s (~) 0.018s (+19.9% 🔺) 1.024s (~) 0.841s 10 1.28x
💻 Local Nitro 0.188s (-0.6%) 0.993s (~) 0.015s (-2.6%) 1.022s (~) 0.834s 10 1.31x
🐘 Postgres Next.js (Turbopack) 1.304s (+107.0% 🔺) 2.040s (+109.8% 🔺) 0.000s (NaN%) 2.120s (+108.6% 🔺) 0.816s 10 9.07x
🐘 Postgres Nitro 1.451s (-41.4% 🟢) 2.266s (-11.6% 🟢) 0.000s (-100.0% 🟢) 2.314s (-23.2% 🟢) 0.863s 10 10.10x
🐘 Postgres Express 2.104s (+65.2% 🔺) 2.936s (+66.6% 🔺) 0.000s (NaN%) 3.016s (+49.7% 🔺) 0.911s 10 14.64x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.932s (-4.8%) 3.245s (+2.3%) 0.537s (-33.6% 🟢) 4.267s (-5.6% 🟢) 1.335s 10 1.00x
▲ Vercel Nitro 3.058s (-0.7%) 3.228s (+1.8%) 0.672s (-35.1% 🟢) 4.459s (-7.0% 🟢) 1.401s 10 1.04x
▲ Vercel Express 3.100s (+2.6%) 3.330s (+2.9%) 0.518s (-13.5% 🟢) 4.388s (+1.7%) 1.288s 10 1.06x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Next.js (Turbopack) 7/8
🐘 Postgres Next.js (Turbopack) 3/8
▲ Vercel Nitro 4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 💻 Local 8/8
Next.js (Turbopack) 💻 Local 8/8
Nitro 💻 Local 8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

Address code review feedback from Copilot and ijjk:
- Extract duplicated class serialization registration logic into
  create_class_serialization_registration() helper method
- Reduces code duplication across workflow mode, client mode (Module),
  and client mode (Script) cases
- Add consistent comment explaining why client mode needs registration
- Update spec.md to document custom serialization in client mode
Copy link
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

🔧 Build Fix:

The OpenAI class is not constructable in the imported module. This is a type error where the code is trying to instantiate the OpenAI class, but the module export doesn't provide a constructor signature.

Fix on Vercel

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.

3 participants