feat(builders,nitro): configurable sourcemap mode - #1843

Closed
TooTallNate wants to merge 1 commit into
mainfrom
feat/configurable-sourcemap
Closed

feat(builders,nitro): configurable sourcemap mode#1843
TooTallNate wants to merge 1 commit into
mainfrom
feat/configurable-sourcemap

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Apr 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a sourcemap builder option (and matching WORKFLOW_SOURCEMAP environment variable) that accepts esbuild's sourcemap values: true | false | 'inline' | 'linked' | 'external' | 'both'.
  • Plumbs the option through @workflow/nitro's ModuleOptions so it can be set via nitro.config.ts.
  • When sourcemaps are disabled, the Vercel Build Output API step function is also emitted with shouldAddSourcemapSupport: false (saves runtime overhead).

Motivation

The SDK currently builds the step bundle with sourcemap: 'inline' unconditionally, which inlines a base64-encoded sourcemap into the bundle and significantly increases the generated function size. For projects deploying to Vercel, that can push functions past the platform's 250MB function size limit. Giving users an option to disable (or choose a non-inline mode for) the sourcemap is an easy lever to bring bundle size down.

Verification

Measured in workbench/nitro-v3 (Vercel preset):

Modestep.func sizeinline sourcemapshouldAddSourcemapSupport
default (unchanged)13 MByestrue
WORKFLOW_SOURCEMAP=false3.1 MBnofalse
workflow.sourcemap = false in nitro config3.1 MBnofalse

~75% bundle reduction with sourcemaps off.

Tests

10 new unit tests in packages/builders/src/resolve-sourcemap.test.ts covering config precedence, env var parsing (true/false/0/1/inline/linked/external/both), empty/unrecognized env values, and the sourcemapsEnabled getter. All 139 builder tests pass.

Add a `sourcemap` builder option (plumbed through @workflow/nitro's
module options) and a matching `WORKFLOW_SOURCEMAP` environment
variable. Accepts the same values as esbuild: true, false, 'inline',
'linked', 'external', 'both'.
Setting this to `false` drops the inline sourcemap from the generated
step/workflow/webhook bundles and sets `shouldAddSourcemapSupport:
false` on the Vercel step.func config. In the nitro-v3 workbench this
reduces the step bundle from ~13MB to ~3.1MB, which unblocks users
hitting Vercel's 250MB function size limit.
CopilotAI review requested due to automatic review settings April 23, 2026 21:22
@vercel

vercelBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d81c01a

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

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

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

github-actionsBot commented Apr 23, 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🥇 Express0.042s (-5.0%)1.005s (~)0.963s101.00x
💻 LocalNitro0.043s (+0.7%)1.005s (~)0.962s101.03x
💻 LocalNext.js (Turbopack)0.047s1.005s0.958s101.11x
🐘 PostgresNext.js (Turbopack)0.057s1.009s0.953s101.34x
🐘 PostgresNitro0.060s (-37.2% 🟢)1.009s (-3.2%)0.949s101.42x
🐘 PostgresExpress0.062s (+6.7% 🔺)1.010s (~)0.948s101.47x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.121s2.006s0.886s101.00x
💻 LocalExpress1.125s (~)2.006s (~)0.881s101.00x
💻 LocalNitro1.128s (~)2.006s (~)0.879s101.01x
🐘 PostgresNext.js (Turbopack)1.140s2.008s0.868s101.02x
🐘 PostgresNitro1.147s (+0.6%)2.011s (~)0.864s101.02x
🐘 PostgresExpress1.153s (+0.6%)2.011s (~)0.857s101.03x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.787s11.022s0.235s31.00x
🐘 PostgresNitro10.891s (~)11.022s (~)0.131s31.01x
🐘 PostgresNext.js (Turbopack)10.920s11.023s0.103s31.01x
🐘 PostgresExpress10.930s (~)11.026s (~)0.095s31.01x
💻 LocalNitro10.938s (~)11.025s (~)0.087s31.01x
💻 LocalExpress10.953s (~)11.024s (~)0.071s31.02x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)14.505s15.024s0.518s41.00x
🐘 PostgresNitro14.527s (~)15.025s (~)0.497s41.00x
💻 LocalNext.js (Turbopack)14.564s15.029s0.465s41.00x
🐘 PostgresExpress14.642s (~)15.024s (~)0.382s41.01x
💻 LocalExpress15.016s (~)15.281s (+1.7%)0.265s41.04x
💻 LocalNitro15.034s (~)15.783s (-1.5%)0.749s41.04x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro13.856s (-0.8%)14.162s (-1.0%)0.305s71.00x
🐘 PostgresExpress14.074s (~)14.596s (~)0.522s71.02x
🐘 PostgresNext.js (Turbopack)14.221s14.739s0.518s71.03x
💻 LocalNext.js (Turbopack)15.986s16.197s0.210s61.15x
💻 LocalExpress16.747s (+0.9%)17.031s (~)0.285s61.21x
💻 LocalNitro16.850s (~)17.031s (~)0.182s61.22x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.246s2.010s0.764s151.00x
🐘 PostgresNitro1.259s (-1.2%)2.010s (~)0.751s151.01x
🐘 PostgresExpress1.271s (+0.9%)2.010s (~)0.739s151.02x
💻 LocalExpress1.538s (+3.3%)2.006s (~)0.469s151.23x
💻 LocalNitro1.560s (-4.4%)2.006s (-3.3%)0.446s151.25x
💻 LocalNext.js (Turbopack)1.582s2.073s0.491s151.27x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.323s (-1.2%)3.009s (~)0.685s101.00x
🐘 PostgresExpress2.336s (-1.0%)3.009s (~)0.673s101.01x
🐘 PostgresNext.js (Turbopack)2.429s3.009s0.580s101.05x
💻 LocalNext.js (Turbopack)2.768s3.342s0.574s91.19x
💻 LocalExpress3.104s (+5.1% 🔺)4.011s (+16.1% 🔺)0.906s81.34x
💻 LocalNitro3.230s (+2.7%)4.011s (+3.2%)0.781s81.39x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.468s (-0.5%)4.011s (~)0.543s81.00x
🐘 PostgresNitro3.481s (~)4.011s (~)0.530s81.00x
🐘 PostgresNext.js (Turbopack)3.667s4.011s0.345s81.06x
💻 LocalNext.js (Turbopack)7.714s8.016s0.302s42.22x
💻 LocalNitro8.511s (+1.9%)9.025s (~)0.514s42.45x
💻 LocalExpress9.053s (+8.6% 🔺)10.021s (+11.0% 🔺)0.968s32.61x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.218s2.010s0.791s151.00x
🐘 PostgresExpress1.256s (~)2.009s (~)0.752s151.03x
🐘 PostgresNitro1.267s (+0.8%)2.008s (~)0.742s151.04x
💻 LocalNitro1.545s (-17.2% 🟢)2.007s (-14.3% 🟢)0.462s151.27x
💻 LocalNext.js (Turbopack)1.576s2.073s0.497s151.29x
💻 LocalExpress1.587s (-16.2% 🟢)2.005s (-15.2% 🟢)0.418s151.30x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.333s (~)3.011s (~)0.678s101.00x
🐘 PostgresExpress2.349s (~)3.010s (~)0.660s101.01x
🐘 PostgresNext.js (Turbopack)2.398s3.007s0.609s101.03x
💻 LocalExpress3.010s (-3.9%)3.885s (+3.3%)0.875s81.29x
💻 LocalNitro3.159s (+3.1%)4.010s (+3.2%)0.851s81.35x
💻 LocalNext.js (Turbopack)3.195s3.885s0.690s81.37x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.467s (~)4.011s (~)0.544s81.00x
🐘 PostgresExpress3.469s (-0.9%)4.009s (~)0.540s81.00x
🐘 PostgresNext.js (Turbopack)3.635s4.011s0.376s81.05x
💻 LocalNext.js (Turbopack)8.371s8.769s0.398s42.41x
💻 LocalExpress9.136s (+3.8%)9.523s (+2.7%)0.387s42.64x
💻 LocalNitro9.455s (+3.4%)10.023s (~)0.569s32.73x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.764s1.023s0.259s591.00x
🐘 PostgresNitro0.812s (-1.1%)1.006s (~)0.194s601.06x
💻 LocalNext.js (Turbopack)0.829s1.004s0.175s601.08x
🐘 PostgresExpress0.846s (+0.9%)1.023s (~)0.177s591.11x
💻 LocalNitro1.000s (+2.0%)1.400s (+28.0% 🔺)0.400s431.31x
💻 LocalExpress1.024s (+4.1%)1.881s (+74.8% 🔺)0.857s321.34x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.888s2.052s0.164s441.00x
🐘 PostgresNitro1.935s (~)2.150s (+2.3%)0.214s421.03x
🐘 PostgresExpress1.992s (+0.8%)2.402s (+6.4% 🔺)0.410s381.06x
💻 LocalNext.js (Turbopack)2.689s3.008s0.319s301.42x
💻 LocalNitro3.033s (~)3.759s (~)0.726s241.61x
💻 LocalExpress3.057s (+1.4%)3.885s (+8.4% 🔺)0.828s241.62x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)3.763s4.009s0.246s301.00x
🐘 PostgresNitro3.904s (-4.9%)4.147s (-9.9% 🟢)0.244s291.04x
🐘 PostgresExpress4.125s (+3.4%)4.931s (+12.9% 🔺)0.806s251.10x
💻 LocalNext.js (Turbopack)8.557s9.017s0.460s142.27x
💻 LocalExpress9.169s (~)9.864s (-1.5%)0.695s132.44x
💻 LocalNitro9.686s (+4.2%)10.353s (+3.3%)0.667s122.57x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.266s1.007s0.741s601.00x
🐘 PostgresExpress0.280s (-0.7%)1.007s (~)0.726s601.06x
🐘 PostgresNitro0.288s (+1.8%)1.007s (~)0.719s601.08x
💻 LocalNext.js (Turbopack)0.533s1.004s0.472s602.00x
💻 LocalExpress0.603s (+7.5% 🔺)1.005s (~)0.402s602.27x
💻 LocalNitro0.606s (~)1.022s (~)0.416s592.28x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.480s1.006s0.526s901.00x
🐘 PostgresExpress0.507s (-0.5%)1.007s (~)0.500s901.06x
🐘 PostgresNitro0.512s (+3.2%)1.006s (~)0.494s901.07x
💻 LocalNext.js (Turbopack)2.505s3.009s0.503s305.22x
💻 LocalNitro2.529s (~)3.009s (~)0.480s305.27x
💻 LocalExpress2.540s (+1.1%)3.009s (~)0.469s305.29x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.769s1.006s0.237s1201.00x
🐘 PostgresNitro0.800s (+1.2%)1.008s (~)0.208s1201.04x
🐘 PostgresExpress0.855s (+4.4%)1.020s (~)0.165s1181.11x
💻 LocalNext.js (Turbopack)10.358s10.933s0.575s1113.47x
💻 LocalExpress11.163s (~)11.850s (-0.8%)0.687s1114.51x
💻 LocalNitro11.200s (~)11.938s (+2.4%)0.738s1114.56x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.177s1.003s0.012s1.018s0.841s101.00x
🐘 PostgresNext.js (Turbopack)0.201s1.001s0.001s1.010s0.809s101.14x
💻 LocalExpress0.205s (+3.0%)1.004s (~)0.012s (-0.8%)1.018s (~)0.813s101.16x
🐘 PostgresNitro0.207s (+0.8%)0.995s (~)0.002s (~)1.010s (~)0.803s101.17x
💻 LocalNitro0.213s (~)1.004s (~)0.013s (+4.0%)1.019s (~)0.806s101.21x
🐘 PostgresExpress0.230s (+12.1% 🔺)0.993s (-0.6%)0.001s (-25.0% 🟢)1.010s (~)0.780s101.30x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.609s (-2.4%)1.005s (~)0.012s (+193.4% 🔺)1.032s (+0.9%)0.422s591.00x
🐘 PostgresNext.js (Turbopack)0.623s1.009s0.007s1.025s0.403s591.02x
💻 LocalNext.js (Turbopack)0.662s1.011s0.010s1.024s0.363s591.09x
🐘 PostgresExpress0.679s (+7.8% 🔺)1.023s (+1.6%)0.011s (+183.1% 🔺)1.047s (+2.3%)0.368s581.11x
💻 LocalNitro0.750s (-10.6% 🟢)1.012s (~)0.010s (+2.6%)1.023s (-8.3% 🟢)0.273s591.23x
💻 LocalExpress0.842s (+11.2% 🔺)1.012s (-1.7%)0.010s (+9.8% 🔺)1.117s (+7.4% 🔺)0.275s541.38x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.973s (~)1.210s (-3.0%)0.000s (+44.0% 🔺)1.235s (-1.8%)0.262s501.00x
🐘 PostgresExpress0.974s (+1.4%)1.272s (~)0.000s (+144.7% 🔺)1.284s (-1.7%)0.310s471.00x
🐘 PostgresNext.js (Turbopack)1.002s1.465s0.000s1.484s0.482s411.03x
💻 LocalNext.js (Turbopack)1.235s2.019s0.000s2.022s0.787s301.27x
💻 LocalNitro1.238s (+1.3%)2.021s (~)0.000s (+333.3% 🔺)2.023s (~)0.785s301.27x
💻 LocalExpress1.259s (+2.7%)2.022s (~)0.000s (+30.0% 🔺)2.024s (~)0.765s301.29x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.763s (-0.5%)2.100s (-3.5%)0.000s (NaN%)2.113s (-3.9%)0.350s291.00x
🐘 PostgresNext.js (Turbopack)1.795s2.106s0.000s2.112s0.317s291.02x
🐘 PostgresNitro1.806s (+0.8%)2.139s (~)0.000s (-100.0% 🟢)2.171s (~)0.365s281.02x
💻 LocalNext.js (Turbopack)3.548s4.032s0.001s4.036s0.488s152.01x
💻 LocalExpress3.574s (+3.1%)4.099s (+1.6%)0.001s (~)4.102s (+1.6%)0.527s152.03x
💻 LocalNitro3.576s (+5.6% 🔺)4.167s (+3.4%)0.001s (+12.5% 🔺)4.170s (+3.3%)0.594s152.03x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

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

Winner determined by most benchmark wins

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


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ 💻 Local Development10522861140
✅ 📦 Local Production10540861140
✅ 🐘 Local Postgres10540861140
✅ 🪟 Windows950095
✅ 📋 Other267018285
Total352222763800

❌ Failed Tests

💻 Local Development (2 failed)

vite-stable (2 failed):

  • 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

Details by Category

❌ 💻 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-stable8726
✅ 📦 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


Some E2E test jobs failed:

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

Check the workflow run for details.

CopilotAI 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.

Pull request overview

Adds a configurable sourcemap mode to Workflow builders (and the Nitro integration) to reduce bundle size—especially for Vercel deployments—while keeping current defaults unless overridden.

Changes:

  • Introduces a sourcemap builder option + WORKFLOW_SOURCEMAP env var parsing/precedence logic.
  • Plumbs sourcemap through @workflow/nitroModuleOptions and Nitro builders.
  • Disables Vercel runtime sourcemap support when sourcemaps are disabled; adds unit tests for resolution behavior.

Reviewed changes

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

Show a summary per file
FileDescription
packages/nitro/src/types.tsAdds workflow.sourcemap option to Nitro module types/docs.
packages/nitro/src/builders.tsPasses Nitro workflow.sourcemap into createBaseBuilderConfig().
packages/builders/src/vercel-build-output-api.tsTies Vercel shouldAddSourcemapSupport to resolved sourcemap enablement.
packages/builders/src/types.tsAdds SourcemapMode type and documents new config option.
packages/builders/src/resolve-sourcemap.test.tsAdds unit tests for config/env precedence and env parsing.
packages/builders/src/config-helpers.tsPlumbs sourcemap through shared builder config creation helper.
packages/builders/src/base-builder.tsImplements env parsing + resolution helper and applies it to esbuild invocations.
.changeset/configurable-sourcemap.mdDeclares minor bumps for @workflow/builders and @workflow/nitro.

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

Comment on lines +73 to +75
* `both`). If neither is set, sourcemaps default to `'inline'` so stack
* traces from step and workflow VM execution include original file names
* and line numbers.

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

The docstring implies a single global default ("sourcemaps default to 'inline'") for all bundles including the webhook, but BaseBuilder uses different per-invocation defaults (e.g. webhook/final wrapper default off unless WORKFLOW_EMIT_SOURCEMAPS_FOR_DEBUGGING or an explicit sourcemap override is set). Please clarify the wording so users don’t assume webhook bundles default to inline sourcemaps.

Suggested change
*`both`).Ifneither is set,sourcemapsdefaultto`'inline'`sostack
*tracesfromstepandworkflowVMexecutionincludeoriginalfilenames
*andlinenumbers.
*`both`).Ifneither is set,theeffectivedefaultdependsonthebundle
*beinggenerated.StepandworkflowVMbundlestypicallydefaultto
*`'inline'`sostacktracesincludeoriginalfilenamesandlinenumbers,
*whilewebhook/final-wrapperbundlesmaydefaultto`false`unless
*debuggingoranexplicitsourcemapoverrideenablesthem.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +35
* If unset, the value of the `WORKFLOW_SOURCEMAP` environment variable is
* consulted. If neither is set, the builder's default (`'inline'`) is used.
*
* Setting this to `false` can dramatically reduce the generated function
* bundle size when deploying to Vercel (useful for staying under the 250MB
* function size limit).

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

This comment says that if neither config nor WORKFLOW_SOURCEMAP is set, the builder default ('inline') is used. In builders, sourcemap defaults are per-bundle (steps/workflows default to inline, but the webhook wrapper defaults off unless WORKFLOW_EMIT_SOURCEMAPS_FOR_DEBUGGING or an override is provided). Please adjust the wording to reflect the per-bundle defaults to avoid confusion for Nitro users.

Copilot uses AI. Check for mistakes.
Comment on lines +113 to +117
protected resolveSourcemap(defaultMode: SourcemapMode): SourcemapMode {
if (this.config.sourcemap !== undefined) {
return this.config.sourcemap;
}
const fromEnv = parseSourcemapEnv(process.env.WORKFLOW_SOURCEMAP);

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

resolveSourcemap() re-parses WORKFLOW_SOURCEMAP on every call. When the env value is unrecognized, parseSourcemapEnv() emits a warning, which can result in repeated identical warnings during a single build (steps + workflows + webhook + vc-config). Consider memoizing the parsed env value (and/or warning once) to keep logs from getting noisy.

Copilot uses AI. Check for mistakes.
@TooTallNate

Copy link
Copy Markdown
MemberAuthor

Closing as duplicate of #1842, which is more comprehensive (covers Next.js, SvelteKit, Astro, and Nest on top of Nitro, and includes docs updates for every framework).

I'll leave a review on #1842 with a few suggestions that came out of this branch:

  • Consider using esbuild's native sourcemap vocabulary (true | false | 'inline' | 'linked' | 'external' | 'both') rather than introducing a bespoke 'disabled' string. This would also let users pick 'external' / 'linked' / 'both' if they want a .map file on disk.
  • A WORKFLOW_SOURCEMAP env var complement is handy for CI overrides without touching framework config.
  • Unit tests for the resolver (see resolve-sourcemap.test.ts on this branch for prior art).

Happy to port any of those over as follow-ups if useful.

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.

2 participants

@TooTallNate
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n 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;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} 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

feat(builders,nitro): configurable sourcemap mode - #1843

Closed
TooTallNate wants to merge 1 commit into
mainfrom
feat/configurable-sourcemap
Closed

feat(builders,nitro): configurable sourcemap mode#1843
TooTallNate wants to merge 1 commit into
mainfrom
feat/configurable-sourcemap

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Apr 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a sourcemap builder option (and matching WORKFLOW_SOURCEMAP environment variable) that accepts esbuild's sourcemap values: true | false | 'inline' | 'linked' | 'external' | 'both'.
  • Plumbs the option through @workflow/nitro's ModuleOptions so it can be set via nitro.config.ts.
  • When sourcemaps are disabled, the Vercel Build Output API step function is also emitted with shouldAddSourcemapSupport: false (saves runtime overhead).

Motivation

The SDK currently builds the step bundle with sourcemap: 'inline' unconditionally, which inlines a base64-encoded sourcemap into the bundle and significantly increases the generated function size. For projects deploying to Vercel, that can push functions past the platform's 250MB function size limit. Giving users an option to disable (or choose a non-inline mode for) the sourcemap is an easy lever to bring bundle size down.

Verification

Measured in workbench/nitro-v3 (Vercel preset):

Modestep.func sizeinline sourcemapshouldAddSourcemapSupport
default (unchanged)13 MByestrue
WORKFLOW_SOURCEMAP=false3.1 MBnofalse
workflow.sourcemap = false in nitro config3.1 MBnofalse

~75% bundle reduction with sourcemaps off.

Tests

10 new unit tests in packages/builders/src/resolve-sourcemap.test.ts covering config precedence, env var parsing (true/false/0/1/inline/linked/external/both), empty/unrecognized env values, and the sourcemapsEnabled getter. All 139 builder tests pass.

Add a `sourcemap` builder option (plumbed through @workflow/nitro's
module options) and a matching `WORKFLOW_SOURCEMAP` environment
variable. Accepts the same values as esbuild: true, false, 'inline',
'linked', 'external', 'both'.
Setting this to `false` drops the inline sourcemap from the generated
step/workflow/webhook bundles and sets `shouldAddSourcemapSupport:
false` on the Vercel step.func config. In the nitro-v3 workbench this
reduces the step bundle from ~13MB to ~3.1MB, which unblocks users
hitting Vercel's 250MB function size limit.
CopilotAI review requested due to automatic review settings April 23, 2026 21:22
@vercel

vercelBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d81c01a

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

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

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

github-actionsBot commented Apr 23, 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🥇 Express0.042s (-5.0%)1.005s (~)0.963s101.00x
💻 LocalNitro0.043s (+0.7%)1.005s (~)0.962s101.03x
💻 LocalNext.js (Turbopack)0.047s1.005s0.958s101.11x
🐘 PostgresNext.js (Turbopack)0.057s1.009s0.953s101.34x
🐘 PostgresNitro0.060s (-37.2% 🟢)1.009s (-3.2%)0.949s101.42x
🐘 PostgresExpress0.062s (+6.7% 🔺)1.010s (~)0.948s101.47x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.121s2.006s0.886s101.00x
💻 LocalExpress1.125s (~)2.006s (~)0.881s101.00x
💻 LocalNitro1.128s (~)2.006s (~)0.879s101.01x
🐘 PostgresNext.js (Turbopack)1.140s2.008s0.868s101.02x
🐘 PostgresNitro1.147s (+0.6%)2.011s (~)0.864s101.02x
🐘 PostgresExpress1.153s (+0.6%)2.011s (~)0.857s101.03x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.787s11.022s0.235s31.00x
🐘 PostgresNitro10.891s (~)11.022s (~)0.131s31.01x
🐘 PostgresNext.js (Turbopack)10.920s11.023s0.103s31.01x
🐘 PostgresExpress10.930s (~)11.026s (~)0.095s31.01x
💻 LocalNitro10.938s (~)11.025s (~)0.087s31.01x
💻 LocalExpress10.953s (~)11.024s (~)0.071s31.02x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)14.505s15.024s0.518s41.00x
🐘 PostgresNitro14.527s (~)15.025s (~)0.497s41.00x
💻 LocalNext.js (Turbopack)14.564s15.029s0.465s41.00x
🐘 PostgresExpress14.642s (~)15.024s (~)0.382s41.01x
💻 LocalExpress15.016s (~)15.281s (+1.7%)0.265s41.04x
💻 LocalNitro15.034s (~)15.783s (-1.5%)0.749s41.04x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro13.856s (-0.8%)14.162s (-1.0%)0.305s71.00x
🐘 PostgresExpress14.074s (~)14.596s (~)0.522s71.02x
🐘 PostgresNext.js (Turbopack)14.221s14.739s0.518s71.03x
💻 LocalNext.js (Turbopack)15.986s16.197s0.210s61.15x
💻 LocalExpress16.747s (+0.9%)17.031s (~)0.285s61.21x
💻 LocalNitro16.850s (~)17.031s (~)0.182s61.22x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.246s2.010s0.764s151.00x
🐘 PostgresNitro1.259s (-1.2%)2.010s (~)0.751s151.01x
🐘 PostgresExpress1.271s (+0.9%)2.010s (~)0.739s151.02x
💻 LocalExpress1.538s (+3.3%)2.006s (~)0.469s151.23x
💻 LocalNitro1.560s (-4.4%)2.006s (-3.3%)0.446s151.25x
💻 LocalNext.js (Turbopack)1.582s2.073s0.491s151.27x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.323s (-1.2%)3.009s (~)0.685s101.00x
🐘 PostgresExpress2.336s (-1.0%)3.009s (~)0.673s101.01x
🐘 PostgresNext.js (Turbopack)2.429s3.009s0.580s101.05x
💻 LocalNext.js (Turbopack)2.768s3.342s0.574s91.19x
💻 LocalExpress3.104s (+5.1% 🔺)4.011s (+16.1% 🔺)0.906s81.34x
💻 LocalNitro3.230s (+2.7%)4.011s (+3.2%)0.781s81.39x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.468s (-0.5%)4.011s (~)0.543s81.00x
🐘 PostgresNitro3.481s (~)4.011s (~)0.530s81.00x
🐘 PostgresNext.js (Turbopack)3.667s4.011s0.345s81.06x
💻 LocalNext.js (Turbopack)7.714s8.016s0.302s42.22x
💻 LocalNitro8.511s (+1.9%)9.025s (~)0.514s42.45x
💻 LocalExpress9.053s (+8.6% 🔺)10.021s (+11.0% 🔺)0.968s32.61x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.218s2.010s0.791s151.00x
🐘 PostgresExpress1.256s (~)2.009s (~)0.752s151.03x
🐘 PostgresNitro1.267s (+0.8%)2.008s (~)0.742s151.04x
💻 LocalNitro1.545s (-17.2% 🟢)2.007s (-14.3% 🟢)0.462s151.27x
💻 LocalNext.js (Turbopack)1.576s2.073s0.497s151.29x
💻 LocalExpress1.587s (-16.2% 🟢)2.005s (-15.2% 🟢)0.418s151.30x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.333s (~)3.011s (~)0.678s101.00x
🐘 PostgresExpress2.349s (~)3.010s (~)0.660s101.01x
🐘 PostgresNext.js (Turbopack)2.398s3.007s0.609s101.03x
💻 LocalExpress3.010s (-3.9%)3.885s (+3.3%)0.875s81.29x
💻 LocalNitro3.159s (+3.1%)4.010s (+3.2%)0.851s81.35x
💻 LocalNext.js (Turbopack)3.195s3.885s0.690s81.37x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.467s (~)4.011s (~)0.544s81.00x
🐘 PostgresExpress3.469s (-0.9%)4.009s (~)0.540s81.00x
🐘 PostgresNext.js (Turbopack)3.635s4.011s0.376s81.05x
💻 LocalNext.js (Turbopack)8.371s8.769s0.398s42.41x
💻 LocalExpress9.136s (+3.8%)9.523s (+2.7%)0.387s42.64x
💻 LocalNitro9.455s (+3.4%)10.023s (~)0.569s32.73x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.764s1.023s0.259s591.00x
🐘 PostgresNitro0.812s (-1.1%)1.006s (~)0.194s601.06x
💻 LocalNext.js (Turbopack)0.829s1.004s0.175s601.08x
🐘 PostgresExpress0.846s (+0.9%)1.023s (~)0.177s591.11x
💻 LocalNitro1.000s (+2.0%)1.400s (+28.0% 🔺)0.400s431.31x
💻 LocalExpress1.024s (+4.1%)1.881s (+74.8% 🔺)0.857s321.34x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.888s2.052s0.164s441.00x
🐘 PostgresNitro1.935s (~)2.150s (+2.3%)0.214s421.03x
🐘 PostgresExpress1.992s (+0.8%)2.402s (+6.4% 🔺)0.410s381.06x
💻 LocalNext.js (Turbopack)2.689s3.008s0.319s301.42x
💻 LocalNitro3.033s (~)3.759s (~)0.726s241.61x
💻 LocalExpress3.057s (+1.4%)3.885s (+8.4% 🔺)0.828s241.62x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)3.763s4.009s0.246s301.00x
🐘 PostgresNitro3.904s (-4.9%)4.147s (-9.9% 🟢)0.244s291.04x
🐘 PostgresExpress4.125s (+3.4%)4.931s (+12.9% 🔺)0.806s251.10x
💻 LocalNext.js (Turbopack)8.557s9.017s0.460s142.27x
💻 LocalExpress9.169s (~)9.864s (-1.5%)0.695s132.44x
💻 LocalNitro9.686s (+4.2%)10.353s (+3.3%)0.667s122.57x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.266s1.007s0.741s601.00x
🐘 PostgresExpress0.280s (-0.7%)1.007s (~)0.726s601.06x
🐘 PostgresNitro0.288s (+1.8%)1.007s (~)0.719s601.08x
💻 LocalNext.js (Turbopack)0.533s1.004s0.472s602.00x
💻 LocalExpress0.603s (+7.5% 🔺)1.005s (~)0.402s602.27x
💻 LocalNitro0.606s (~)1.022s (~)0.416s592.28x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.480s1.006s0.526s901.00x
🐘 PostgresExpress0.507s (-0.5%)1.007s (~)0.500s901.06x
🐘 PostgresNitro0.512s (+3.2%)1.006s (~)0.494s901.07x
💻 LocalNext.js (Turbopack)2.505s3.009s0.503s305.22x
💻 LocalNitro2.529s (~)3.009s (~)0.480s305.27x
💻 LocalExpress2.540s (+1.1%)3.009s (~)0.469s305.29x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.769s1.006s0.237s1201.00x
🐘 PostgresNitro0.800s (+1.2%)1.008s (~)0.208s1201.04x
🐘 PostgresExpress0.855s (+4.4%)1.020s (~)0.165s1181.11x
💻 LocalNext.js (Turbopack)10.358s10.933s0.575s1113.47x
💻 LocalExpress11.163s (~)11.850s (-0.8%)0.687s1114.51x
💻 LocalNitro11.200s (~)11.938s (+2.4%)0.738s1114.56x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.177s1.003s0.012s1.018s0.841s101.00x
🐘 PostgresNext.js (Turbopack)0.201s1.001s0.001s1.010s0.809s101.14x
💻 LocalExpress0.205s (+3.0%)1.004s (~)0.012s (-0.8%)1.018s (~)0.813s101.16x
🐘 PostgresNitro0.207s (+0.8%)0.995s (~)0.002s (~)1.010s (~)0.803s101.17x
💻 LocalNitro0.213s (~)1.004s (~)0.013s (+4.0%)1.019s (~)0.806s101.21x
🐘 PostgresExpress0.230s (+12.1% 🔺)0.993s (-0.6%)0.001s (-25.0% 🟢)1.010s (~)0.780s101.30x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.609s (-2.4%)1.005s (~)0.012s (+193.4% 🔺)1.032s (+0.9%)0.422s591.00x
🐘 PostgresNext.js (Turbopack)0.623s1.009s0.007s1.025s0.403s591.02x
💻 LocalNext.js (Turbopack)0.662s1.011s0.010s1.024s0.363s591.09x
🐘 PostgresExpress0.679s (+7.8% 🔺)1.023s (+1.6%)0.011s (+183.1% 🔺)1.047s (+2.3%)0.368s581.11x
💻 LocalNitro0.750s (-10.6% 🟢)1.012s (~)0.010s (+2.6%)1.023s (-8.3% 🟢)0.273s591.23x
💻 LocalExpress0.842s (+11.2% 🔺)1.012s (-1.7%)0.010s (+9.8% 🔺)1.117s (+7.4% 🔺)0.275s541.38x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.973s (~)1.210s (-3.0%)0.000s (+44.0% 🔺)1.235s (-1.8%)0.262s501.00x
🐘 PostgresExpress0.974s (+1.4%)1.272s (~)0.000s (+144.7% 🔺)1.284s (-1.7%)0.310s471.00x
🐘 PostgresNext.js (Turbopack)1.002s1.465s0.000s1.484s0.482s411.03x
💻 LocalNext.js (Turbopack)1.235s2.019s0.000s2.022s0.787s301.27x
💻 LocalNitro1.238s (+1.3%)2.021s (~)0.000s (+333.3% 🔺)2.023s (~)0.785s301.27x
💻 LocalExpress1.259s (+2.7%)2.022s (~)0.000s (+30.0% 🔺)2.024s (~)0.765s301.29x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.763s (-0.5%)2.100s (-3.5%)0.000s (NaN%)2.113s (-3.9%)0.350s291.00x
🐘 PostgresNext.js (Turbopack)1.795s2.106s0.000s2.112s0.317s291.02x
🐘 PostgresNitro1.806s (+0.8%)2.139s (~)0.000s (-100.0% 🟢)2.171s (~)0.365s281.02x
💻 LocalNext.js (Turbopack)3.548s4.032s0.001s4.036s0.488s152.01x
💻 LocalExpress3.574s (+3.1%)4.099s (+1.6%)0.001s (~)4.102s (+1.6%)0.527s152.03x
💻 LocalNitro3.576s (+5.6% 🔺)4.167s (+3.4%)0.001s (+12.5% 🔺)4.170s (+3.3%)0.594s152.03x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

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

Winner determined by most benchmark wins

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


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ 💻 Local Development10522861140
✅ 📦 Local Production10540861140
✅ 🐘 Local Postgres10540861140
✅ 🪟 Windows950095
✅ 📋 Other267018285
Total352222763800

❌ Failed Tests

💻 Local Development (2 failed)

vite-stable (2 failed):

  • 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

Details by Category

❌ 💻 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-stable8726
✅ 📦 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


Some E2E test jobs failed:

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

Check the workflow run for details.

CopilotAI 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.

Pull request overview

Adds a configurable sourcemap mode to Workflow builders (and the Nitro integration) to reduce bundle size—especially for Vercel deployments—while keeping current defaults unless overridden.

Changes:

  • Introduces a sourcemap builder option + WORKFLOW_SOURCEMAP env var parsing/precedence logic.
  • Plumbs sourcemap through @workflow/nitroModuleOptions and Nitro builders.
  • Disables Vercel runtime sourcemap support when sourcemaps are disabled; adds unit tests for resolution behavior.

Reviewed changes

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

Show a summary per file
FileDescription
packages/nitro/src/types.tsAdds workflow.sourcemap option to Nitro module types/docs.
packages/nitro/src/builders.tsPasses Nitro workflow.sourcemap into createBaseBuilderConfig().
packages/builders/src/vercel-build-output-api.tsTies Vercel shouldAddSourcemapSupport to resolved sourcemap enablement.
packages/builders/src/types.tsAdds SourcemapMode type and documents new config option.
packages/builders/src/resolve-sourcemap.test.tsAdds unit tests for config/env precedence and env parsing.
packages/builders/src/config-helpers.tsPlumbs sourcemap through shared builder config creation helper.
packages/builders/src/base-builder.tsImplements env parsing + resolution helper and applies it to esbuild invocations.
.changeset/configurable-sourcemap.mdDeclares minor bumps for @workflow/builders and @workflow/nitro.

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

Comment on lines +73 to +75
* `both`). If neither is set, sourcemaps default to `'inline'` so stack
* traces from step and workflow VM execution include original file names
* and line numbers.

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

The docstring implies a single global default ("sourcemaps default to 'inline'") for all bundles including the webhook, but BaseBuilder uses different per-invocation defaults (e.g. webhook/final wrapper default off unless WORKFLOW_EMIT_SOURCEMAPS_FOR_DEBUGGING or an explicit sourcemap override is set). Please clarify the wording so users don’t assume webhook bundles default to inline sourcemaps.

Suggested change
*`both`).Ifneither is set,sourcemapsdefaultto`'inline'`sostack
*tracesfromstepandworkflowVMexecutionincludeoriginalfilenames
*andlinenumbers.
*`both`).Ifneither is set,theeffectivedefaultdependsonthebundle
*beinggenerated.StepandworkflowVMbundlestypicallydefaultto
*`'inline'`sostacktracesincludeoriginalfilenamesandlinenumbers,
*whilewebhook/final-wrapperbundlesmaydefaultto`false`unless
*debuggingoranexplicitsourcemapoverrideenablesthem.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +35
* If unset, the value of the `WORKFLOW_SOURCEMAP` environment variable is
* consulted. If neither is set, the builder's default (`'inline'`) is used.
*
* Setting this to `false` can dramatically reduce the generated function
* bundle size when deploying to Vercel (useful for staying under the 250MB
* function size limit).

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

This comment says that if neither config nor WORKFLOW_SOURCEMAP is set, the builder default ('inline') is used. In builders, sourcemap defaults are per-bundle (steps/workflows default to inline, but the webhook wrapper defaults off unless WORKFLOW_EMIT_SOURCEMAPS_FOR_DEBUGGING or an override is provided). Please adjust the wording to reflect the per-bundle defaults to avoid confusion for Nitro users.

Copilot uses AI. Check for mistakes.
Comment on lines +113 to +117
protected resolveSourcemap(defaultMode: SourcemapMode): SourcemapMode {
if (this.config.sourcemap !== undefined) {
return this.config.sourcemap;
}
const fromEnv = parseSourcemapEnv(process.env.WORKFLOW_SOURCEMAP);

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

resolveSourcemap() re-parses WORKFLOW_SOURCEMAP on every call. When the env value is unrecognized, parseSourcemapEnv() emits a warning, which can result in repeated identical warnings during a single build (steps + workflows + webhook + vc-config). Consider memoizing the parsed env value (and/or warning once) to keep logs from getting noisy.

Copilot uses AI. Check for mistakes.
@TooTallNate

Copy link
Copy Markdown
MemberAuthor

Closing as duplicate of #1842, which is more comprehensive (covers Next.js, SvelteKit, Astro, and Nest on top of Nitro, and includes docs updates for every framework).

I'll leave a review on #1842 with a few suggestions that came out of this branch:

  • Consider using esbuild's native sourcemap vocabulary (true | false | 'inline' | 'linked' | 'external' | 'both') rather than introducing a bespoke 'disabled' string. This would also let users pick 'external' / 'linked' / 'both' if they want a .map file on disk.
  • A WORKFLOW_SOURCEMAP env var complement is handy for CI overrides without touching framework config.
  • Unit tests for the resolver (see resolve-sourcemap.test.ts on this branch for prior art).

Happy to port any of those over as follow-ups if useful.

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.

2 participants

@TooTallNate
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(builders,nitro): configurable sourcemap mode - #1843

Closed
TooTallNate wants to merge 1 commit into
mainfrom
feat/configurable-sourcemap
Closed

feat(builders,nitro): configurable sourcemap mode#1843
TooTallNate wants to merge 1 commit into
mainfrom
feat/configurable-sourcemap

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Apr 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a sourcemap builder option (and matching WORKFLOW_SOURCEMAP environment variable) that accepts esbuild's sourcemap values: true | false | 'inline' | 'linked' | 'external' | 'both'.
  • Plumbs the option through @workflow/nitro's ModuleOptions so it can be set via nitro.config.ts.
  • When sourcemaps are disabled, the Vercel Build Output API step function is also emitted with shouldAddSourcemapSupport: false (saves runtime overhead).

Motivation

The SDK currently builds the step bundle with sourcemap: 'inline' unconditionally, which inlines a base64-encoded sourcemap into the bundle and significantly increases the generated function size. For projects deploying to Vercel, that can push functions past the platform's 250MB function size limit. Giving users an option to disable (or choose a non-inline mode for) the sourcemap is an easy lever to bring bundle size down.

Verification

Measured in workbench/nitro-v3 (Vercel preset):

Modestep.func sizeinline sourcemapshouldAddSourcemapSupport
default (unchanged)13 MByestrue
WORKFLOW_SOURCEMAP=false3.1 MBnofalse
workflow.sourcemap = false in nitro config3.1 MBnofalse

~75% bundle reduction with sourcemaps off.

Tests

10 new unit tests in packages/builders/src/resolve-sourcemap.test.ts covering config precedence, env var parsing (true/false/0/1/inline/linked/external/both), empty/unrecognized env values, and the sourcemapsEnabled getter. All 139 builder tests pass.

Add a `sourcemap` builder option (plumbed through @workflow/nitro's
module options) and a matching `WORKFLOW_SOURCEMAP` environment
variable. Accepts the same values as esbuild: true, false, 'inline',
'linked', 'external', 'both'.
Setting this to `false` drops the inline sourcemap from the generated
step/workflow/webhook bundles and sets `shouldAddSourcemapSupport:
false` on the Vercel step.func config. In the nitro-v3 workbench this
reduces the step bundle from ~13MB to ~3.1MB, which unblocks users
hitting Vercel's 250MB function size limit.
CopilotAI review requested due to automatic review settings April 23, 2026 21:22
@vercel

vercelBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d81c01a

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

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

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

github-actionsBot commented Apr 23, 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🥇 Express0.042s (-5.0%)1.005s (~)0.963s101.00x
💻 LocalNitro0.043s (+0.7%)1.005s (~)0.962s101.03x
💻 LocalNext.js (Turbopack)0.047s1.005s0.958s101.11x
🐘 PostgresNext.js (Turbopack)0.057s1.009s0.953s101.34x
🐘 PostgresNitro0.060s (-37.2% 🟢)1.009s (-3.2%)0.949s101.42x
🐘 PostgresExpress0.062s (+6.7% 🔺)1.010s (~)0.948s101.47x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.121s2.006s0.886s101.00x
💻 LocalExpress1.125s (~)2.006s (~)0.881s101.00x
💻 LocalNitro1.128s (~)2.006s (~)0.879s101.01x
🐘 PostgresNext.js (Turbopack)1.140s2.008s0.868s101.02x
🐘 PostgresNitro1.147s (+0.6%)2.011s (~)0.864s101.02x
🐘 PostgresExpress1.153s (+0.6%)2.011s (~)0.857s101.03x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.787s11.022s0.235s31.00x
🐘 PostgresNitro10.891s (~)11.022s (~)0.131s31.01x
🐘 PostgresNext.js (Turbopack)10.920s11.023s0.103s31.01x
🐘 PostgresExpress10.930s (~)11.026s (~)0.095s31.01x
💻 LocalNitro10.938s (~)11.025s (~)0.087s31.01x
💻 LocalExpress10.953s (~)11.024s (~)0.071s31.02x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)14.505s15.024s0.518s41.00x
🐘 PostgresNitro14.527s (~)15.025s (~)0.497s41.00x
💻 LocalNext.js (Turbopack)14.564s15.029s0.465s41.00x
🐘 PostgresExpress14.642s (~)15.024s (~)0.382s41.01x
💻 LocalExpress15.016s (~)15.281s (+1.7%)0.265s41.04x
💻 LocalNitro15.034s (~)15.783s (-1.5%)0.749s41.04x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro13.856s (-0.8%)14.162s (-1.0%)0.305s71.00x
🐘 PostgresExpress14.074s (~)14.596s (~)0.522s71.02x
🐘 PostgresNext.js (Turbopack)14.221s14.739s0.518s71.03x
💻 LocalNext.js (Turbopack)15.986s16.197s0.210s61.15x
💻 LocalExpress16.747s (+0.9%)17.031s (~)0.285s61.21x
💻 LocalNitro16.850s (~)17.031s (~)0.182s61.22x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.246s2.010s0.764s151.00x
🐘 PostgresNitro1.259s (-1.2%)2.010s (~)0.751s151.01x
🐘 PostgresExpress1.271s (+0.9%)2.010s (~)0.739s151.02x
💻 LocalExpress1.538s (+3.3%)2.006s (~)0.469s151.23x
💻 LocalNitro1.560s (-4.4%)2.006s (-3.3%)0.446s151.25x
💻 LocalNext.js (Turbopack)1.582s2.073s0.491s151.27x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.323s (-1.2%)3.009s (~)0.685s101.00x
🐘 PostgresExpress2.336s (-1.0%)3.009s (~)0.673s101.01x
🐘 PostgresNext.js (Turbopack)2.429s3.009s0.580s101.05x
💻 LocalNext.js (Turbopack)2.768s3.342s0.574s91.19x
💻 LocalExpress3.104s (+5.1% 🔺)4.011s (+16.1% 🔺)0.906s81.34x
💻 LocalNitro3.230s (+2.7%)4.011s (+3.2%)0.781s81.39x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.468s (-0.5%)4.011s (~)0.543s81.00x
🐘 PostgresNitro3.481s (~)4.011s (~)0.530s81.00x
🐘 PostgresNext.js (Turbopack)3.667s4.011s0.345s81.06x
💻 LocalNext.js (Turbopack)7.714s8.016s0.302s42.22x
💻 LocalNitro8.511s (+1.9%)9.025s (~)0.514s42.45x
💻 LocalExpress9.053s (+8.6% 🔺)10.021s (+11.0% 🔺)0.968s32.61x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.218s2.010s0.791s151.00x
🐘 PostgresExpress1.256s (~)2.009s (~)0.752s151.03x
🐘 PostgresNitro1.267s (+0.8%)2.008s (~)0.742s151.04x
💻 LocalNitro1.545s (-17.2% 🟢)2.007s (-14.3% 🟢)0.462s151.27x
💻 LocalNext.js (Turbopack)1.576s2.073s0.497s151.29x
💻 LocalExpress1.587s (-16.2% 🟢)2.005s (-15.2% 🟢)0.418s151.30x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.333s (~)3.011s (~)0.678s101.00x
🐘 PostgresExpress2.349s (~)3.010s (~)0.660s101.01x
🐘 PostgresNext.js (Turbopack)2.398s3.007s0.609s101.03x
💻 LocalExpress3.010s (-3.9%)3.885s (+3.3%)0.875s81.29x
💻 LocalNitro3.159s (+3.1%)4.010s (+3.2%)0.851s81.35x
💻 LocalNext.js (Turbopack)3.195s3.885s0.690s81.37x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.467s (~)4.011s (~)0.544s81.00x
🐘 PostgresExpress3.469s (-0.9%)4.009s (~)0.540s81.00x
🐘 PostgresNext.js (Turbopack)3.635s4.011s0.376s81.05x
💻 LocalNext.js (Turbopack)8.371s8.769s0.398s42.41x
💻 LocalExpress9.136s (+3.8%)9.523s (+2.7%)0.387s42.64x
💻 LocalNitro9.455s (+3.4%)10.023s (~)0.569s32.73x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.764s1.023s0.259s591.00x
🐘 PostgresNitro0.812s (-1.1%)1.006s (~)0.194s601.06x
💻 LocalNext.js (Turbopack)0.829s1.004s0.175s601.08x
🐘 PostgresExpress0.846s (+0.9%)1.023s (~)0.177s591.11x
💻 LocalNitro1.000s (+2.0%)1.400s (+28.0% 🔺)0.400s431.31x
💻 LocalExpress1.024s (+4.1%)1.881s (+74.8% 🔺)0.857s321.34x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.888s2.052s0.164s441.00x
🐘 PostgresNitro1.935s (~)2.150s (+2.3%)0.214s421.03x
🐘 PostgresExpress1.992s (+0.8%)2.402s (+6.4% 🔺)0.410s381.06x
💻 LocalNext.js (Turbopack)2.689s3.008s0.319s301.42x
💻 LocalNitro3.033s (~)3.759s (~)0.726s241.61x
💻 LocalExpress3.057s (+1.4%)3.885s (+8.4% 🔺)0.828s241.62x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)3.763s4.009s0.246s301.00x
🐘 PostgresNitro3.904s (-4.9%)4.147s (-9.9% 🟢)0.244s291.04x
🐘 PostgresExpress4.125s (+3.4%)4.931s (+12.9% 🔺)0.806s251.10x
💻 LocalNext.js (Turbopack)8.557s9.017s0.460s142.27x
💻 LocalExpress9.169s (~)9.864s (-1.5%)0.695s132.44x
💻 LocalNitro9.686s (+4.2%)10.353s (+3.3%)0.667s122.57x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.266s1.007s0.741s601.00x
🐘 PostgresExpress0.280s (-0.7%)1.007s (~)0.726s601.06x
🐘 PostgresNitro0.288s (+1.8%)1.007s (~)0.719s601.08x
💻 LocalNext.js (Turbopack)0.533s1.004s0.472s602.00x
💻 LocalExpress0.603s (+7.5% 🔺)1.005s (~)0.402s602.27x
💻 LocalNitro0.606s (~)1.022s (~)0.416s592.28x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.480s1.006s0.526s901.00x
🐘 PostgresExpress0.507s (-0.5%)1.007s (~)0.500s901.06x
🐘 PostgresNitro0.512s (+3.2%)1.006s (~)0.494s901.07x
💻 LocalNext.js (Turbopack)2.505s3.009s0.503s305.22x
💻 LocalNitro2.529s (~)3.009s (~)0.480s305.27x
💻 LocalExpress2.540s (+1.1%)3.009s (~)0.469s305.29x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.769s1.006s0.237s1201.00x
🐘 PostgresNitro0.800s (+1.2%)1.008s (~)0.208s1201.04x
🐘 PostgresExpress0.855s (+4.4%)1.020s (~)0.165s1181.11x
💻 LocalNext.js (Turbopack)10.358s10.933s0.575s1113.47x
💻 LocalExpress11.163s (~)11.850s (-0.8%)0.687s1114.51x
💻 LocalNitro11.200s (~)11.938s (+2.4%)0.738s1114.56x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.177s1.003s0.012s1.018s0.841s101.00x
🐘 PostgresNext.js (Turbopack)0.201s1.001s0.001s1.010s0.809s101.14x
💻 LocalExpress0.205s (+3.0%)1.004s (~)0.012s (-0.8%)1.018s (~)0.813s101.16x
🐘 PostgresNitro0.207s (+0.8%)0.995s (~)0.002s (~)1.010s (~)0.803s101.17x
💻 LocalNitro0.213s (~)1.004s (~)0.013s (+4.0%)1.019s (~)0.806s101.21x
🐘 PostgresExpress0.230s (+12.1% 🔺)0.993s (-0.6%)0.001s (-25.0% 🟢)1.010s (~)0.780s101.30x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.609s (-2.4%)1.005s (~)0.012s (+193.4% 🔺)1.032s (+0.9%)0.422s591.00x
🐘 PostgresNext.js (Turbopack)0.623s1.009s0.007s1.025s0.403s591.02x
💻 LocalNext.js (Turbopack)0.662s1.011s0.010s1.024s0.363s591.09x
🐘 PostgresExpress0.679s (+7.8% 🔺)1.023s (+1.6%)0.011s (+183.1% 🔺)1.047s (+2.3%)0.368s581.11x
💻 LocalNitro0.750s (-10.6% 🟢)1.012s (~)0.010s (+2.6%)1.023s (-8.3% 🟢)0.273s591.23x
💻 LocalExpress0.842s (+11.2% 🔺)1.012s (-1.7%)0.010s (+9.8% 🔺)1.117s (+7.4% 🔺)0.275s541.38x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.973s (~)1.210s (-3.0%)0.000s (+44.0% 🔺)1.235s (-1.8%)0.262s501.00x
🐘 PostgresExpress0.974s (+1.4%)1.272s (~)0.000s (+144.7% 🔺)1.284s (-1.7%)0.310s471.00x
🐘 PostgresNext.js (Turbopack)1.002s1.465s0.000s1.484s0.482s411.03x
💻 LocalNext.js (Turbopack)1.235s2.019s0.000s2.022s0.787s301.27x
💻 LocalNitro1.238s (+1.3%)2.021s (~)0.000s (+333.3% 🔺)2.023s (~)0.785s301.27x
💻 LocalExpress1.259s (+2.7%)2.022s (~)0.000s (+30.0% 🔺)2.024s (~)0.765s301.29x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.763s (-0.5%)2.100s (-3.5%)0.000s (NaN%)2.113s (-3.9%)0.350s291.00x
🐘 PostgresNext.js (Turbopack)1.795s2.106s0.000s2.112s0.317s291.02x
🐘 PostgresNitro1.806s (+0.8%)2.139s (~)0.000s (-100.0% 🟢)2.171s (~)0.365s281.02x
💻 LocalNext.js (Turbopack)3.548s4.032s0.001s4.036s0.488s152.01x
💻 LocalExpress3.574s (+3.1%)4.099s (+1.6%)0.001s (~)4.102s (+1.6%)0.527s152.03x
💻 LocalNitro3.576s (+5.6% 🔺)4.167s (+3.4%)0.001s (+12.5% 🔺)4.170s (+3.3%)0.594s152.03x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

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

Winner determined by most benchmark wins

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


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ 💻 Local Development10522861140
✅ 📦 Local Production10540861140
✅ 🐘 Local Postgres10540861140
✅ 🪟 Windows950095
✅ 📋 Other267018285
Total352222763800

❌ Failed Tests

💻 Local Development (2 failed)

vite-stable (2 failed):

  • 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

Details by Category

❌ 💻 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-stable8726
✅ 📦 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


Some E2E test jobs failed:

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

Check the workflow run for details.

CopilotAI 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.

Pull request overview

Adds a configurable sourcemap mode to Workflow builders (and the Nitro integration) to reduce bundle size—especially for Vercel deployments—while keeping current defaults unless overridden.

Changes:

  • Introduces a sourcemap builder option + WORKFLOW_SOURCEMAP env var parsing/precedence logic.
  • Plumbs sourcemap through @workflow/nitroModuleOptions and Nitro builders.
  • Disables Vercel runtime sourcemap support when sourcemaps are disabled; adds unit tests for resolution behavior.

Reviewed changes

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

Show a summary per file
FileDescription
packages/nitro/src/types.tsAdds workflow.sourcemap option to Nitro module types/docs.
packages/nitro/src/builders.tsPasses Nitro workflow.sourcemap into createBaseBuilderConfig().
packages/builders/src/vercel-build-output-api.tsTies Vercel shouldAddSourcemapSupport to resolved sourcemap enablement.
packages/builders/src/types.tsAdds SourcemapMode type and documents new config option.
packages/builders/src/resolve-sourcemap.test.tsAdds unit tests for config/env precedence and env parsing.
packages/builders/src/config-helpers.tsPlumbs sourcemap through shared builder config creation helper.
packages/builders/src/base-builder.tsImplements env parsing + resolution helper and applies it to esbuild invocations.
.changeset/configurable-sourcemap.mdDeclares minor bumps for @workflow/builders and @workflow/nitro.

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

Comment on lines +73 to +75
* `both`). If neither is set, sourcemaps default to `'inline'` so stack
* traces from step and workflow VM execution include original file names
* and line numbers.

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

The docstring implies a single global default ("sourcemaps default to 'inline'") for all bundles including the webhook, but BaseBuilder uses different per-invocation defaults (e.g. webhook/final wrapper default off unless WORKFLOW_EMIT_SOURCEMAPS_FOR_DEBUGGING or an explicit sourcemap override is set). Please clarify the wording so users don’t assume webhook bundles default to inline sourcemaps.

Suggested change
*`both`).Ifneither is set,sourcemapsdefaultto`'inline'`sostack
*tracesfromstepandworkflowVMexecutionincludeoriginalfilenames
*andlinenumbers.
*`both`).Ifneither is set,theeffectivedefaultdependsonthebundle
*beinggenerated.StepandworkflowVMbundlestypicallydefaultto
*`'inline'`sostacktracesincludeoriginalfilenamesandlinenumbers,
*whilewebhook/final-wrapperbundlesmaydefaultto`false`unless
*debuggingoranexplicitsourcemapoverrideenablesthem.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +35
* If unset, the value of the `WORKFLOW_SOURCEMAP` environment variable is
* consulted. If neither is set, the builder's default (`'inline'`) is used.
*
* Setting this to `false` can dramatically reduce the generated function
* bundle size when deploying to Vercel (useful for staying under the 250MB
* function size limit).

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

This comment says that if neither config nor WORKFLOW_SOURCEMAP is set, the builder default ('inline') is used. In builders, sourcemap defaults are per-bundle (steps/workflows default to inline, but the webhook wrapper defaults off unless WORKFLOW_EMIT_SOURCEMAPS_FOR_DEBUGGING or an override is provided). Please adjust the wording to reflect the per-bundle defaults to avoid confusion for Nitro users.

Copilot uses AI. Check for mistakes.
Comment on lines +113 to +117
protected resolveSourcemap(defaultMode: SourcemapMode): SourcemapMode {
if (this.config.sourcemap !== undefined) {
return this.config.sourcemap;
}
const fromEnv = parseSourcemapEnv(process.env.WORKFLOW_SOURCEMAP);

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

resolveSourcemap() re-parses WORKFLOW_SOURCEMAP on every call. When the env value is unrecognized, parseSourcemapEnv() emits a warning, which can result in repeated identical warnings during a single build (steps + workflows + webhook + vc-config). Consider memoizing the parsed env value (and/or warning once) to keep logs from getting noisy.

Copilot uses AI. Check for mistakes.
@TooTallNate

Copy link
Copy Markdown
MemberAuthor

Closing as duplicate of #1842, which is more comprehensive (covers Next.js, SvelteKit, Astro, and Nest on top of Nitro, and includes docs updates for every framework).

I'll leave a review on #1842 with a few suggestions that came out of this branch:

  • Consider using esbuild's native sourcemap vocabulary (true | false | 'inline' | 'linked' | 'external' | 'both') rather than introducing a bespoke 'disabled' string. This would also let users pick 'external' / 'linked' / 'both' if they want a .map file on disk.
  • A WORKFLOW_SOURCEMAP env var complement is handy for CI overrides without touching framework config.
  • Unit tests for the resolver (see resolve-sourcemap.test.ts on this branch for prior art).

Happy to port any of those over as follow-ups if useful.

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.

2 participants

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

feat(builders,nitro): configurable sourcemap mode - #1843

Closed
TooTallNate wants to merge 1 commit into
mainfrom
feat/configurable-sourcemap
Closed

feat(builders,nitro): configurable sourcemap mode#1843
TooTallNate wants to merge 1 commit into
mainfrom
feat/configurable-sourcemap

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Apr 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a sourcemap builder option (and matching WORKFLOW_SOURCEMAP environment variable) that accepts esbuild's sourcemap values: true | false | 'inline' | 'linked' | 'external' | 'both'.
  • Plumbs the option through @workflow/nitro's ModuleOptions so it can be set via nitro.config.ts.
  • When sourcemaps are disabled, the Vercel Build Output API step function is also emitted with shouldAddSourcemapSupport: false (saves runtime overhead).

Motivation

The SDK currently builds the step bundle with sourcemap: 'inline' unconditionally, which inlines a base64-encoded sourcemap into the bundle and significantly increases the generated function size. For projects deploying to Vercel, that can push functions past the platform's 250MB function size limit. Giving users an option to disable (or choose a non-inline mode for) the sourcemap is an easy lever to bring bundle size down.

Verification

Measured in workbench/nitro-v3 (Vercel preset):

Modestep.func sizeinline sourcemapshouldAddSourcemapSupport
default (unchanged)13 MByestrue
WORKFLOW_SOURCEMAP=false3.1 MBnofalse
workflow.sourcemap = false in nitro config3.1 MBnofalse

~75% bundle reduction with sourcemaps off.

Tests

10 new unit tests in packages/builders/src/resolve-sourcemap.test.ts covering config precedence, env var parsing (true/false/0/1/inline/linked/external/both), empty/unrecognized env values, and the sourcemapsEnabled getter. All 139 builder tests pass.

Add a `sourcemap` builder option (plumbed through @workflow/nitro's
module options) and a matching `WORKFLOW_SOURCEMAP` environment
variable. Accepts the same values as esbuild: true, false, 'inline',
'linked', 'external', 'both'.
Setting this to `false` drops the inline sourcemap from the generated
step/workflow/webhook bundles and sets `shouldAddSourcemapSupport:
false` on the Vercel step.func config. In the nitro-v3 workbench this
reduces the step bundle from ~13MB to ~3.1MB, which unblocks users
hitting Vercel's 250MB function size limit.
CopilotAI review requested due to automatic review settings April 23, 2026 21:22
@vercel

vercelBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d81c01a

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

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

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

github-actionsBot commented Apr 23, 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🥇 Express0.042s (-5.0%)1.005s (~)0.963s101.00x
💻 LocalNitro0.043s (+0.7%)1.005s (~)0.962s101.03x
💻 LocalNext.js (Turbopack)0.047s1.005s0.958s101.11x
🐘 PostgresNext.js (Turbopack)0.057s1.009s0.953s101.34x
🐘 PostgresNitro0.060s (-37.2% 🟢)1.009s (-3.2%)0.949s101.42x
🐘 PostgresExpress0.062s (+6.7% 🔺)1.010s (~)0.948s101.47x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.121s2.006s0.886s101.00x
💻 LocalExpress1.125s (~)2.006s (~)0.881s101.00x
💻 LocalNitro1.128s (~)2.006s (~)0.879s101.01x
🐘 PostgresNext.js (Turbopack)1.140s2.008s0.868s101.02x
🐘 PostgresNitro1.147s (+0.6%)2.011s (~)0.864s101.02x
🐘 PostgresExpress1.153s (+0.6%)2.011s (~)0.857s101.03x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.787s11.022s0.235s31.00x
🐘 PostgresNitro10.891s (~)11.022s (~)0.131s31.01x
🐘 PostgresNext.js (Turbopack)10.920s11.023s0.103s31.01x
🐘 PostgresExpress10.930s (~)11.026s (~)0.095s31.01x
💻 LocalNitro10.938s (~)11.025s (~)0.087s31.01x
💻 LocalExpress10.953s (~)11.024s (~)0.071s31.02x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)14.505s15.024s0.518s41.00x
🐘 PostgresNitro14.527s (~)15.025s (~)0.497s41.00x
💻 LocalNext.js (Turbopack)14.564s15.029s0.465s41.00x
🐘 PostgresExpress14.642s (~)15.024s (~)0.382s41.01x
💻 LocalExpress15.016s (~)15.281s (+1.7%)0.265s41.04x
💻 LocalNitro15.034s (~)15.783s (-1.5%)0.749s41.04x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro13.856s (-0.8%)14.162s (-1.0%)0.305s71.00x
🐘 PostgresExpress14.074s (~)14.596s (~)0.522s71.02x
🐘 PostgresNext.js (Turbopack)14.221s14.739s0.518s71.03x
💻 LocalNext.js (Turbopack)15.986s16.197s0.210s61.15x
💻 LocalExpress16.747s (+0.9%)17.031s (~)0.285s61.21x
💻 LocalNitro16.850s (~)17.031s (~)0.182s61.22x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.246s2.010s0.764s151.00x
🐘 PostgresNitro1.259s (-1.2%)2.010s (~)0.751s151.01x
🐘 PostgresExpress1.271s (+0.9%)2.010s (~)0.739s151.02x
💻 LocalExpress1.538s (+3.3%)2.006s (~)0.469s151.23x
💻 LocalNitro1.560s (-4.4%)2.006s (-3.3%)0.446s151.25x
💻 LocalNext.js (Turbopack)1.582s2.073s0.491s151.27x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.323s (-1.2%)3.009s (~)0.685s101.00x
🐘 PostgresExpress2.336s (-1.0%)3.009s (~)0.673s101.01x
🐘 PostgresNext.js (Turbopack)2.429s3.009s0.580s101.05x
💻 LocalNext.js (Turbopack)2.768s3.342s0.574s91.19x
💻 LocalExpress3.104s (+5.1% 🔺)4.011s (+16.1% 🔺)0.906s81.34x
💻 LocalNitro3.230s (+2.7%)4.011s (+3.2%)0.781s81.39x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.468s (-0.5%)4.011s (~)0.543s81.00x
🐘 PostgresNitro3.481s (~)4.011s (~)0.530s81.00x
🐘 PostgresNext.js (Turbopack)3.667s4.011s0.345s81.06x
💻 LocalNext.js (Turbopack)7.714s8.016s0.302s42.22x
💻 LocalNitro8.511s (+1.9%)9.025s (~)0.514s42.45x
💻 LocalExpress9.053s (+8.6% 🔺)10.021s (+11.0% 🔺)0.968s32.61x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.218s2.010s0.791s151.00x
🐘 PostgresExpress1.256s (~)2.009s (~)0.752s151.03x
🐘 PostgresNitro1.267s (+0.8%)2.008s (~)0.742s151.04x
💻 LocalNitro1.545s (-17.2% 🟢)2.007s (-14.3% 🟢)0.462s151.27x
💻 LocalNext.js (Turbopack)1.576s2.073s0.497s151.29x
💻 LocalExpress1.587s (-16.2% 🟢)2.005s (-15.2% 🟢)0.418s151.30x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.333s (~)3.011s (~)0.678s101.00x
🐘 PostgresExpress2.349s (~)3.010s (~)0.660s101.01x
🐘 PostgresNext.js (Turbopack)2.398s3.007s0.609s101.03x
💻 LocalExpress3.010s (-3.9%)3.885s (+3.3%)0.875s81.29x
💻 LocalNitro3.159s (+3.1%)4.010s (+3.2%)0.851s81.35x
💻 LocalNext.js (Turbopack)3.195s3.885s0.690s81.37x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.467s (~)4.011s (~)0.544s81.00x
🐘 PostgresExpress3.469s (-0.9%)4.009s (~)0.540s81.00x
🐘 PostgresNext.js (Turbopack)3.635s4.011s0.376s81.05x
💻 LocalNext.js (Turbopack)8.371s8.769s0.398s42.41x
💻 LocalExpress9.136s (+3.8%)9.523s (+2.7%)0.387s42.64x
💻 LocalNitro9.455s (+3.4%)10.023s (~)0.569s32.73x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.764s1.023s0.259s591.00x
🐘 PostgresNitro0.812s (-1.1%)1.006s (~)0.194s601.06x
💻 LocalNext.js (Turbopack)0.829s1.004s0.175s601.08x
🐘 PostgresExpress0.846s (+0.9%)1.023s (~)0.177s591.11x
💻 LocalNitro1.000s (+2.0%)1.400s (+28.0% 🔺)0.400s431.31x
💻 LocalExpress1.024s (+4.1%)1.881s (+74.8% 🔺)0.857s321.34x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.888s2.052s0.164s441.00x
🐘 PostgresNitro1.935s (~)2.150s (+2.3%)0.214s421.03x
🐘 PostgresExpress1.992s (+0.8%)2.402s (+6.4% 🔺)0.410s381.06x
💻 LocalNext.js (Turbopack)2.689s3.008s0.319s301.42x
💻 LocalNitro3.033s (~)3.759s (~)0.726s241.61x
💻 LocalExpress3.057s (+1.4%)3.885s (+8.4% 🔺)0.828s241.62x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)3.763s4.009s0.246s301.00x
🐘 PostgresNitro3.904s (-4.9%)4.147s (-9.9% 🟢)0.244s291.04x
🐘 PostgresExpress4.125s (+3.4%)4.931s (+12.9% 🔺)0.806s251.10x
💻 LocalNext.js (Turbopack)8.557s9.017s0.460s142.27x
💻 LocalExpress9.169s (~)9.864s (-1.5%)0.695s132.44x
💻 LocalNitro9.686s (+4.2%)10.353s (+3.3%)0.667s122.57x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.266s1.007s0.741s601.00x
🐘 PostgresExpress0.280s (-0.7%)1.007s (~)0.726s601.06x
🐘 PostgresNitro0.288s (+1.8%)1.007s (~)0.719s601.08x
💻 LocalNext.js (Turbopack)0.533s1.004s0.472s602.00x
💻 LocalExpress0.603s (+7.5% 🔺)1.005s (~)0.402s602.27x
💻 LocalNitro0.606s (~)1.022s (~)0.416s592.28x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.480s1.006s0.526s901.00x
🐘 PostgresExpress0.507s (-0.5%)1.007s (~)0.500s901.06x
🐘 PostgresNitro0.512s (+3.2%)1.006s (~)0.494s901.07x
💻 LocalNext.js (Turbopack)2.505s3.009s0.503s305.22x
💻 LocalNitro2.529s (~)3.009s (~)0.480s305.27x
💻 LocalExpress2.540s (+1.1%)3.009s (~)0.469s305.29x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.769s1.006s0.237s1201.00x
🐘 PostgresNitro0.800s (+1.2%)1.008s (~)0.208s1201.04x
🐘 PostgresExpress0.855s (+4.4%)1.020s (~)0.165s1181.11x
💻 LocalNext.js (Turbopack)10.358s10.933s0.575s1113.47x
💻 LocalExpress11.163s (~)11.850s (-0.8%)0.687s1114.51x
💻 LocalNitro11.200s (~)11.938s (+2.4%)0.738s1114.56x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.177s1.003s0.012s1.018s0.841s101.00x
🐘 PostgresNext.js (Turbopack)0.201s1.001s0.001s1.010s0.809s101.14x
💻 LocalExpress0.205s (+3.0%)1.004s (~)0.012s (-0.8%)1.018s (~)0.813s101.16x
🐘 PostgresNitro0.207s (+0.8%)0.995s (~)0.002s (~)1.010s (~)0.803s101.17x
💻 LocalNitro0.213s (~)1.004s (~)0.013s (+4.0%)1.019s (~)0.806s101.21x
🐘 PostgresExpress0.230s (+12.1% 🔺)0.993s (-0.6%)0.001s (-25.0% 🟢)1.010s (~)0.780s101.30x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.609s (-2.4%)1.005s (~)0.012s (+193.4% 🔺)1.032s (+0.9%)0.422s591.00x
🐘 PostgresNext.js (Turbopack)0.623s1.009s0.007s1.025s0.403s591.02x
💻 LocalNext.js (Turbopack)0.662s1.011s0.010s1.024s0.363s591.09x
🐘 PostgresExpress0.679s (+7.8% 🔺)1.023s (+1.6%)0.011s (+183.1% 🔺)1.047s (+2.3%)0.368s581.11x
💻 LocalNitro0.750s (-10.6% 🟢)1.012s (~)0.010s (+2.6%)1.023s (-8.3% 🟢)0.273s591.23x
💻 LocalExpress0.842s (+11.2% 🔺)1.012s (-1.7%)0.010s (+9.8% 🔺)1.117s (+7.4% 🔺)0.275s541.38x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.973s (~)1.210s (-3.0%)0.000s (+44.0% 🔺)1.235s (-1.8%)0.262s501.00x
🐘 PostgresExpress0.974s (+1.4%)1.272s (~)0.000s (+144.7% 🔺)1.284s (-1.7%)0.310s471.00x
🐘 PostgresNext.js (Turbopack)1.002s1.465s0.000s1.484s0.482s411.03x
💻 LocalNext.js (Turbopack)1.235s2.019s0.000s2.022s0.787s301.27x
💻 LocalNitro1.238s (+1.3%)2.021s (~)0.000s (+333.3% 🔺)2.023s (~)0.785s301.27x
💻 LocalExpress1.259s (+2.7%)2.022s (~)0.000s (+30.0% 🔺)2.024s (~)0.765s301.29x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.763s (-0.5%)2.100s (-3.5%)0.000s (NaN%)2.113s (-3.9%)0.350s291.00x
🐘 PostgresNext.js (Turbopack)1.795s2.106s0.000s2.112s0.317s291.02x
🐘 PostgresNitro1.806s (+0.8%)2.139s (~)0.000s (-100.0% 🟢)2.171s (~)0.365s281.02x
💻 LocalNext.js (Turbopack)3.548s4.032s0.001s4.036s0.488s152.01x
💻 LocalExpress3.574s (+3.1%)4.099s (+1.6%)0.001s (~)4.102s (+1.6%)0.527s152.03x
💻 LocalNitro3.576s (+5.6% 🔺)4.167s (+3.4%)0.001s (+12.5% 🔺)4.170s (+3.3%)0.594s152.03x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

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

Winner determined by most benchmark wins

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


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ 💻 Local Development10522861140
✅ 📦 Local Production10540861140
✅ 🐘 Local Postgres10540861140
✅ 🪟 Windows950095
✅ 📋 Other267018285
Total352222763800

❌ Failed Tests

💻 Local Development (2 failed)

vite-stable (2 failed):

  • 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

Details by Category

❌ 💻 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-stable8726
✅ 📦 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


Some E2E test jobs failed:

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

Check the workflow run for details.

CopilotAI 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.

Pull request overview

Adds a configurable sourcemap mode to Workflow builders (and the Nitro integration) to reduce bundle size—especially for Vercel deployments—while keeping current defaults unless overridden.

Changes:

  • Introduces a sourcemap builder option + WORKFLOW_SOURCEMAP env var parsing/precedence logic.
  • Plumbs sourcemap through @workflow/nitroModuleOptions and Nitro builders.
  • Disables Vercel runtime sourcemap support when sourcemaps are disabled; adds unit tests for resolution behavior.

Reviewed changes

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

Show a summary per file
FileDescription
packages/nitro/src/types.tsAdds workflow.sourcemap option to Nitro module types/docs.
packages/nitro/src/builders.tsPasses Nitro workflow.sourcemap into createBaseBuilderConfig().
packages/builders/src/vercel-build-output-api.tsTies Vercel shouldAddSourcemapSupport to resolved sourcemap enablement.
packages/builders/src/types.tsAdds SourcemapMode type and documents new config option.
packages/builders/src/resolve-sourcemap.test.tsAdds unit tests for config/env precedence and env parsing.
packages/builders/src/config-helpers.tsPlumbs sourcemap through shared builder config creation helper.
packages/builders/src/base-builder.tsImplements env parsing + resolution helper and applies it to esbuild invocations.
.changeset/configurable-sourcemap.mdDeclares minor bumps for @workflow/builders and @workflow/nitro.

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

Comment on lines +73 to +75
* `both`). If neither is set, sourcemaps default to `'inline'` so stack
* traces from step and workflow VM execution include original file names
* and line numbers.

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

The docstring implies a single global default ("sourcemaps default to 'inline'") for all bundles including the webhook, but BaseBuilder uses different per-invocation defaults (e.g. webhook/final wrapper default off unless WORKFLOW_EMIT_SOURCEMAPS_FOR_DEBUGGING or an explicit sourcemap override is set). Please clarify the wording so users don’t assume webhook bundles default to inline sourcemaps.

Suggested change
*`both`).Ifneither is set,sourcemapsdefaultto`'inline'`sostack
*tracesfromstepandworkflowVMexecutionincludeoriginalfilenames
*andlinenumbers.
*`both`).Ifneither is set,theeffectivedefaultdependsonthebundle
*beinggenerated.StepandworkflowVMbundlestypicallydefaultto
*`'inline'`sostacktracesincludeoriginalfilenamesandlinenumbers,
*whilewebhook/final-wrapperbundlesmaydefaultto`false`unless
*debuggingoranexplicitsourcemapoverrideenablesthem.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +35
* If unset, the value of the `WORKFLOW_SOURCEMAP` environment variable is
* consulted. If neither is set, the builder's default (`'inline'`) is used.
*
* Setting this to `false` can dramatically reduce the generated function
* bundle size when deploying to Vercel (useful for staying under the 250MB
* function size limit).

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

This comment says that if neither config nor WORKFLOW_SOURCEMAP is set, the builder default ('inline') is used. In builders, sourcemap defaults are per-bundle (steps/workflows default to inline, but the webhook wrapper defaults off unless WORKFLOW_EMIT_SOURCEMAPS_FOR_DEBUGGING or an override is provided). Please adjust the wording to reflect the per-bundle defaults to avoid confusion for Nitro users.

Copilot uses AI. Check for mistakes.
Comment on lines +113 to +117
protected resolveSourcemap(defaultMode: SourcemapMode): SourcemapMode {
if (this.config.sourcemap !== undefined) {
return this.config.sourcemap;
}
const fromEnv = parseSourcemapEnv(process.env.WORKFLOW_SOURCEMAP);

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

resolveSourcemap() re-parses WORKFLOW_SOURCEMAP on every call. When the env value is unrecognized, parseSourcemapEnv() emits a warning, which can result in repeated identical warnings during a single build (steps + workflows + webhook + vc-config). Consider memoizing the parsed env value (and/or warning once) to keep logs from getting noisy.

Copilot uses AI. Check for mistakes.
@TooTallNate

Copy link
Copy Markdown
MemberAuthor

Closing as duplicate of #1842, which is more comprehensive (covers Next.js, SvelteKit, Astro, and Nest on top of Nitro, and includes docs updates for every framework).

I'll leave a review on #1842 with a few suggestions that came out of this branch:

  • Consider using esbuild's native sourcemap vocabulary (true | false | 'inline' | 'linked' | 'external' | 'both') rather than introducing a bespoke 'disabled' string. This would also let users pick 'external' / 'linked' / 'both' if they want a .map file on disk.
  • A WORKFLOW_SOURCEMAP env var complement is handy for CI overrides without touching framework config.
  • Unit tests for the resolver (see resolve-sourcemap.test.ts on this branch for prior art).

Happy to port any of those over as follow-ups if useful.

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.

2 participants

@TooTallNate
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } 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

feat(builders,nitro): configurable sourcemap mode - #1843

Closed
TooTallNate wants to merge 1 commit into
mainfrom
feat/configurable-sourcemap
Closed

feat(builders,nitro): configurable sourcemap mode#1843
TooTallNate wants to merge 1 commit into
mainfrom
feat/configurable-sourcemap

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Apr 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a sourcemap builder option (and matching WORKFLOW_SOURCEMAP environment variable) that accepts esbuild's sourcemap values: true | false | 'inline' | 'linked' | 'external' | 'both'.
  • Plumbs the option through @workflow/nitro's ModuleOptions so it can be set via nitro.config.ts.
  • When sourcemaps are disabled, the Vercel Build Output API step function is also emitted with shouldAddSourcemapSupport: false (saves runtime overhead).

Motivation

The SDK currently builds the step bundle with sourcemap: 'inline' unconditionally, which inlines a base64-encoded sourcemap into the bundle and significantly increases the generated function size. For projects deploying to Vercel, that can push functions past the platform's 250MB function size limit. Giving users an option to disable (or choose a non-inline mode for) the sourcemap is an easy lever to bring bundle size down.

Verification

Measured in workbench/nitro-v3 (Vercel preset):

Modestep.func sizeinline sourcemapshouldAddSourcemapSupport
default (unchanged)13 MByestrue
WORKFLOW_SOURCEMAP=false3.1 MBnofalse
workflow.sourcemap = false in nitro config3.1 MBnofalse

~75% bundle reduction with sourcemaps off.

Tests

10 new unit tests in packages/builders/src/resolve-sourcemap.test.ts covering config precedence, env var parsing (true/false/0/1/inline/linked/external/both), empty/unrecognized env values, and the sourcemapsEnabled getter. All 139 builder tests pass.

Add a `sourcemap` builder option (plumbed through @workflow/nitro's
module options) and a matching `WORKFLOW_SOURCEMAP` environment
variable. Accepts the same values as esbuild: true, false, 'inline',
'linked', 'external', 'both'.
Setting this to `false` drops the inline sourcemap from the generated
step/workflow/webhook bundles and sets `shouldAddSourcemapSupport:
false` on the Vercel step.func config. In the nitro-v3 workbench this
reduces the step bundle from ~13MB to ~3.1MB, which unblocks users
hitting Vercel's 250MB function size limit.
CopilotAI review requested due to automatic review settings April 23, 2026 21:22
@vercel

vercelBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d81c01a

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

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

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

github-actionsBot commented Apr 23, 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🥇 Express0.042s (-5.0%)1.005s (~)0.963s101.00x
💻 LocalNitro0.043s (+0.7%)1.005s (~)0.962s101.03x
💻 LocalNext.js (Turbopack)0.047s1.005s0.958s101.11x
🐘 PostgresNext.js (Turbopack)0.057s1.009s0.953s101.34x
🐘 PostgresNitro0.060s (-37.2% 🟢)1.009s (-3.2%)0.949s101.42x
🐘 PostgresExpress0.062s (+6.7% 🔺)1.010s (~)0.948s101.47x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.121s2.006s0.886s101.00x
💻 LocalExpress1.125s (~)2.006s (~)0.881s101.00x
💻 LocalNitro1.128s (~)2.006s (~)0.879s101.01x
🐘 PostgresNext.js (Turbopack)1.140s2.008s0.868s101.02x
🐘 PostgresNitro1.147s (+0.6%)2.011s (~)0.864s101.02x
🐘 PostgresExpress1.153s (+0.6%)2.011s (~)0.857s101.03x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.787s11.022s0.235s31.00x
🐘 PostgresNitro10.891s (~)11.022s (~)0.131s31.01x
🐘 PostgresNext.js (Turbopack)10.920s11.023s0.103s31.01x
🐘 PostgresExpress10.930s (~)11.026s (~)0.095s31.01x
💻 LocalNitro10.938s (~)11.025s (~)0.087s31.01x
💻 LocalExpress10.953s (~)11.024s (~)0.071s31.02x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)14.505s15.024s0.518s41.00x
🐘 PostgresNitro14.527s (~)15.025s (~)0.497s41.00x
💻 LocalNext.js (Turbopack)14.564s15.029s0.465s41.00x
🐘 PostgresExpress14.642s (~)15.024s (~)0.382s41.01x
💻 LocalExpress15.016s (~)15.281s (+1.7%)0.265s41.04x
💻 LocalNitro15.034s (~)15.783s (-1.5%)0.749s41.04x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro13.856s (-0.8%)14.162s (-1.0%)0.305s71.00x
🐘 PostgresExpress14.074s (~)14.596s (~)0.522s71.02x
🐘 PostgresNext.js (Turbopack)14.221s14.739s0.518s71.03x
💻 LocalNext.js (Turbopack)15.986s16.197s0.210s61.15x
💻 LocalExpress16.747s (+0.9%)17.031s (~)0.285s61.21x
💻 LocalNitro16.850s (~)17.031s (~)0.182s61.22x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.246s2.010s0.764s151.00x
🐘 PostgresNitro1.259s (-1.2%)2.010s (~)0.751s151.01x
🐘 PostgresExpress1.271s (+0.9%)2.010s (~)0.739s151.02x
💻 LocalExpress1.538s (+3.3%)2.006s (~)0.469s151.23x
💻 LocalNitro1.560s (-4.4%)2.006s (-3.3%)0.446s151.25x
💻 LocalNext.js (Turbopack)1.582s2.073s0.491s151.27x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.323s (-1.2%)3.009s (~)0.685s101.00x
🐘 PostgresExpress2.336s (-1.0%)3.009s (~)0.673s101.01x
🐘 PostgresNext.js (Turbopack)2.429s3.009s0.580s101.05x
💻 LocalNext.js (Turbopack)2.768s3.342s0.574s91.19x
💻 LocalExpress3.104s (+5.1% 🔺)4.011s (+16.1% 🔺)0.906s81.34x
💻 LocalNitro3.230s (+2.7%)4.011s (+3.2%)0.781s81.39x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.468s (-0.5%)4.011s (~)0.543s81.00x
🐘 PostgresNitro3.481s (~)4.011s (~)0.530s81.00x
🐘 PostgresNext.js (Turbopack)3.667s4.011s0.345s81.06x
💻 LocalNext.js (Turbopack)7.714s8.016s0.302s42.22x
💻 LocalNitro8.511s (+1.9%)9.025s (~)0.514s42.45x
💻 LocalExpress9.053s (+8.6% 🔺)10.021s (+11.0% 🔺)0.968s32.61x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.218s2.010s0.791s151.00x
🐘 PostgresExpress1.256s (~)2.009s (~)0.752s151.03x
🐘 PostgresNitro1.267s (+0.8%)2.008s (~)0.742s151.04x
💻 LocalNitro1.545s (-17.2% 🟢)2.007s (-14.3% 🟢)0.462s151.27x
💻 LocalNext.js (Turbopack)1.576s2.073s0.497s151.29x
💻 LocalExpress1.587s (-16.2% 🟢)2.005s (-15.2% 🟢)0.418s151.30x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.333s (~)3.011s (~)0.678s101.00x
🐘 PostgresExpress2.349s (~)3.010s (~)0.660s101.01x
🐘 PostgresNext.js (Turbopack)2.398s3.007s0.609s101.03x
💻 LocalExpress3.010s (-3.9%)3.885s (+3.3%)0.875s81.29x
💻 LocalNitro3.159s (+3.1%)4.010s (+3.2%)0.851s81.35x
💻 LocalNext.js (Turbopack)3.195s3.885s0.690s81.37x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.467s (~)4.011s (~)0.544s81.00x
🐘 PostgresExpress3.469s (-0.9%)4.009s (~)0.540s81.00x
🐘 PostgresNext.js (Turbopack)3.635s4.011s0.376s81.05x
💻 LocalNext.js (Turbopack)8.371s8.769s0.398s42.41x
💻 LocalExpress9.136s (+3.8%)9.523s (+2.7%)0.387s42.64x
💻 LocalNitro9.455s (+3.4%)10.023s (~)0.569s32.73x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.764s1.023s0.259s591.00x
🐘 PostgresNitro0.812s (-1.1%)1.006s (~)0.194s601.06x
💻 LocalNext.js (Turbopack)0.829s1.004s0.175s601.08x
🐘 PostgresExpress0.846s (+0.9%)1.023s (~)0.177s591.11x
💻 LocalNitro1.000s (+2.0%)1.400s (+28.0% 🔺)0.400s431.31x
💻 LocalExpress1.024s (+4.1%)1.881s (+74.8% 🔺)0.857s321.34x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.888s2.052s0.164s441.00x
🐘 PostgresNitro1.935s (~)2.150s (+2.3%)0.214s421.03x
🐘 PostgresExpress1.992s (+0.8%)2.402s (+6.4% 🔺)0.410s381.06x
💻 LocalNext.js (Turbopack)2.689s3.008s0.319s301.42x
💻 LocalNitro3.033s (~)3.759s (~)0.726s241.61x
💻 LocalExpress3.057s (+1.4%)3.885s (+8.4% 🔺)0.828s241.62x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)3.763s4.009s0.246s301.00x
🐘 PostgresNitro3.904s (-4.9%)4.147s (-9.9% 🟢)0.244s291.04x
🐘 PostgresExpress4.125s (+3.4%)4.931s (+12.9% 🔺)0.806s251.10x
💻 LocalNext.js (Turbopack)8.557s9.017s0.460s142.27x
💻 LocalExpress9.169s (~)9.864s (-1.5%)0.695s132.44x
💻 LocalNitro9.686s (+4.2%)10.353s (+3.3%)0.667s122.57x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.266s1.007s0.741s601.00x
🐘 PostgresExpress0.280s (-0.7%)1.007s (~)0.726s601.06x
🐘 PostgresNitro0.288s (+1.8%)1.007s (~)0.719s601.08x
💻 LocalNext.js (Turbopack)0.533s1.004s0.472s602.00x
💻 LocalExpress0.603s (+7.5% 🔺)1.005s (~)0.402s602.27x
💻 LocalNitro0.606s (~)1.022s (~)0.416s592.28x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.480s1.006s0.526s901.00x
🐘 PostgresExpress0.507s (-0.5%)1.007s (~)0.500s901.06x
🐘 PostgresNitro0.512s (+3.2%)1.006s (~)0.494s901.07x
💻 LocalNext.js (Turbopack)2.505s3.009s0.503s305.22x
💻 LocalNitro2.529s (~)3.009s (~)0.480s305.27x
💻 LocalExpress2.540s (+1.1%)3.009s (~)0.469s305.29x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.769s1.006s0.237s1201.00x
🐘 PostgresNitro0.800s (+1.2%)1.008s (~)0.208s1201.04x
🐘 PostgresExpress0.855s (+4.4%)1.020s (~)0.165s1181.11x
💻 LocalNext.js (Turbopack)10.358s10.933s0.575s1113.47x
💻 LocalExpress11.163s (~)11.850s (-0.8%)0.687s1114.51x
💻 LocalNitro11.200s (~)11.938s (+2.4%)0.738s1114.56x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.177s1.003s0.012s1.018s0.841s101.00x
🐘 PostgresNext.js (Turbopack)0.201s1.001s0.001s1.010s0.809s101.14x
💻 LocalExpress0.205s (+3.0%)1.004s (~)0.012s (-0.8%)1.018s (~)0.813s101.16x
🐘 PostgresNitro0.207s (+0.8%)0.995s (~)0.002s (~)1.010s (~)0.803s101.17x
💻 LocalNitro0.213s (~)1.004s (~)0.013s (+4.0%)1.019s (~)0.806s101.21x
🐘 PostgresExpress0.230s (+12.1% 🔺)0.993s (-0.6%)0.001s (-25.0% 🟢)1.010s (~)0.780s101.30x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.609s (-2.4%)1.005s (~)0.012s (+193.4% 🔺)1.032s (+0.9%)0.422s591.00x
🐘 PostgresNext.js (Turbopack)0.623s1.009s0.007s1.025s0.403s591.02x
💻 LocalNext.js (Turbopack)0.662s1.011s0.010s1.024s0.363s591.09x
🐘 PostgresExpress0.679s (+7.8% 🔺)1.023s (+1.6%)0.011s (+183.1% 🔺)1.047s (+2.3%)0.368s581.11x
💻 LocalNitro0.750s (-10.6% 🟢)1.012s (~)0.010s (+2.6%)1.023s (-8.3% 🟢)0.273s591.23x
💻 LocalExpress0.842s (+11.2% 🔺)1.012s (-1.7%)0.010s (+9.8% 🔺)1.117s (+7.4% 🔺)0.275s541.38x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.973s (~)1.210s (-3.0%)0.000s (+44.0% 🔺)1.235s (-1.8%)0.262s501.00x
🐘 PostgresExpress0.974s (+1.4%)1.272s (~)0.000s (+144.7% 🔺)1.284s (-1.7%)0.310s471.00x
🐘 PostgresNext.js (Turbopack)1.002s1.465s0.000s1.484s0.482s411.03x
💻 LocalNext.js (Turbopack)1.235s2.019s0.000s2.022s0.787s301.27x
💻 LocalNitro1.238s (+1.3%)2.021s (~)0.000s (+333.3% 🔺)2.023s (~)0.785s301.27x
💻 LocalExpress1.259s (+2.7%)2.022s (~)0.000s (+30.0% 🔺)2.024s (~)0.765s301.29x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.763s (-0.5%)2.100s (-3.5%)0.000s (NaN%)2.113s (-3.9%)0.350s291.00x
🐘 PostgresNext.js (Turbopack)1.795s2.106s0.000s2.112s0.317s291.02x
🐘 PostgresNitro1.806s (+0.8%)2.139s (~)0.000s (-100.0% 🟢)2.171s (~)0.365s281.02x
💻 LocalNext.js (Turbopack)3.548s4.032s0.001s4.036s0.488s152.01x
💻 LocalExpress3.574s (+3.1%)4.099s (+1.6%)0.001s (~)4.102s (+1.6%)0.527s152.03x
💻 LocalNitro3.576s (+5.6% 🔺)4.167s (+3.4%)0.001s (+12.5% 🔺)4.170s (+3.3%)0.594s152.03x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

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

Winner determined by most benchmark wins

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


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ 💻 Local Development10522861140
✅ 📦 Local Production10540861140
✅ 🐘 Local Postgres10540861140
✅ 🪟 Windows950095
✅ 📋 Other267018285
Total352222763800

❌ Failed Tests

💻 Local Development (2 failed)

vite-stable (2 failed):

  • 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

Details by Category

❌ 💻 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-stable8726
✅ 📦 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


Some E2E test jobs failed:

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

Check the workflow run for details.

CopilotAI 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.

Pull request overview

Adds a configurable sourcemap mode to Workflow builders (and the Nitro integration) to reduce bundle size—especially for Vercel deployments—while keeping current defaults unless overridden.

Changes:

  • Introduces a sourcemap builder option + WORKFLOW_SOURCEMAP env var parsing/precedence logic.
  • Plumbs sourcemap through @workflow/nitroModuleOptions and Nitro builders.
  • Disables Vercel runtime sourcemap support when sourcemaps are disabled; adds unit tests for resolution behavior.

Reviewed changes

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

Show a summary per file
FileDescription
packages/nitro/src/types.tsAdds workflow.sourcemap option to Nitro module types/docs.
packages/nitro/src/builders.tsPasses Nitro workflow.sourcemap into createBaseBuilderConfig().
packages/builders/src/vercel-build-output-api.tsTies Vercel shouldAddSourcemapSupport to resolved sourcemap enablement.
packages/builders/src/types.tsAdds SourcemapMode type and documents new config option.
packages/builders/src/resolve-sourcemap.test.tsAdds unit tests for config/env precedence and env parsing.
packages/builders/src/config-helpers.tsPlumbs sourcemap through shared builder config creation helper.
packages/builders/src/base-builder.tsImplements env parsing + resolution helper and applies it to esbuild invocations.
.changeset/configurable-sourcemap.mdDeclares minor bumps for @workflow/builders and @workflow/nitro.

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

Comment on lines +73 to +75
* `both`). If neither is set, sourcemaps default to `'inline'` so stack
* traces from step and workflow VM execution include original file names
* and line numbers.

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

The docstring implies a single global default ("sourcemaps default to 'inline'") for all bundles including the webhook, but BaseBuilder uses different per-invocation defaults (e.g. webhook/final wrapper default off unless WORKFLOW_EMIT_SOURCEMAPS_FOR_DEBUGGING or an explicit sourcemap override is set). Please clarify the wording so users don’t assume webhook bundles default to inline sourcemaps.

Suggested change
*`both`).Ifneither is set,sourcemapsdefaultto`'inline'`sostack
*tracesfromstepandworkflowVMexecutionincludeoriginalfilenames
*andlinenumbers.
*`both`).Ifneither is set,theeffectivedefaultdependsonthebundle
*beinggenerated.StepandworkflowVMbundlestypicallydefaultto
*`'inline'`sostacktracesincludeoriginalfilenamesandlinenumbers,
*whilewebhook/final-wrapperbundlesmaydefaultto`false`unless
*debuggingoranexplicitsourcemapoverrideenablesthem.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +35
* If unset, the value of the `WORKFLOW_SOURCEMAP` environment variable is
* consulted. If neither is set, the builder's default (`'inline'`) is used.
*
* Setting this to `false` can dramatically reduce the generated function
* bundle size when deploying to Vercel (useful for staying under the 250MB
* function size limit).

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

This comment says that if neither config nor WORKFLOW_SOURCEMAP is set, the builder default ('inline') is used. In builders, sourcemap defaults are per-bundle (steps/workflows default to inline, but the webhook wrapper defaults off unless WORKFLOW_EMIT_SOURCEMAPS_FOR_DEBUGGING or an override is provided). Please adjust the wording to reflect the per-bundle defaults to avoid confusion for Nitro users.

Copilot uses AI. Check for mistakes.
Comment on lines +113 to +117
protected resolveSourcemap(defaultMode: SourcemapMode): SourcemapMode {
if (this.config.sourcemap !== undefined) {
return this.config.sourcemap;
}
const fromEnv = parseSourcemapEnv(process.env.WORKFLOW_SOURCEMAP);

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

resolveSourcemap() re-parses WORKFLOW_SOURCEMAP on every call. When the env value is unrecognized, parseSourcemapEnv() emits a warning, which can result in repeated identical warnings during a single build (steps + workflows + webhook + vc-config). Consider memoizing the parsed env value (and/or warning once) to keep logs from getting noisy.

Copilot uses AI. Check for mistakes.
@TooTallNate

Copy link
Copy Markdown
MemberAuthor

Closing as duplicate of #1842, which is more comprehensive (covers Next.js, SvelteKit, Astro, and Nest on top of Nitro, and includes docs updates for every framework).

I'll leave a review on #1842 with a few suggestions that came out of this branch:

  • Consider using esbuild's native sourcemap vocabulary (true | false | 'inline' | 'linked' | 'external' | 'both') rather than introducing a bespoke 'disabled' string. This would also let users pick 'external' / 'linked' / 'both' if they want a .map file on disk.
  • A WORKFLOW_SOURCEMAP env var complement is handy for CI overrides without touching framework config.
  • Unit tests for the resolver (see resolve-sourcemap.test.ts on this branch for prior art).

Happy to port any of those over as follow-ups if useful.

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.

2 participants

@TooTallNate
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(builders,nitro): configurable sourcemap mode - #1843

Closed
TooTallNate wants to merge 1 commit into
mainfrom
feat/configurable-sourcemap
Closed

feat(builders,nitro): configurable sourcemap mode#1843
TooTallNate wants to merge 1 commit into
mainfrom
feat/configurable-sourcemap

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Apr 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a sourcemap builder option (and matching WORKFLOW_SOURCEMAP environment variable) that accepts esbuild's sourcemap values: true | false | 'inline' | 'linked' | 'external' | 'both'.
  • Plumbs the option through @workflow/nitro's ModuleOptions so it can be set via nitro.config.ts.
  • When sourcemaps are disabled, the Vercel Build Output API step function is also emitted with shouldAddSourcemapSupport: false (saves runtime overhead).

Motivation

The SDK currently builds the step bundle with sourcemap: 'inline' unconditionally, which inlines a base64-encoded sourcemap into the bundle and significantly increases the generated function size. For projects deploying to Vercel, that can push functions past the platform's 250MB function size limit. Giving users an option to disable (or choose a non-inline mode for) the sourcemap is an easy lever to bring bundle size down.

Verification

Measured in workbench/nitro-v3 (Vercel preset):

Modestep.func sizeinline sourcemapshouldAddSourcemapSupport
default (unchanged)13 MByestrue
WORKFLOW_SOURCEMAP=false3.1 MBnofalse
workflow.sourcemap = false in nitro config3.1 MBnofalse

~75% bundle reduction with sourcemaps off.

Tests

10 new unit tests in packages/builders/src/resolve-sourcemap.test.ts covering config precedence, env var parsing (true/false/0/1/inline/linked/external/both), empty/unrecognized env values, and the sourcemapsEnabled getter. All 139 builder tests pass.

Add a `sourcemap` builder option (plumbed through @workflow/nitro's
module options) and a matching `WORKFLOW_SOURCEMAP` environment
variable. Accepts the same values as esbuild: true, false, 'inline',
'linked', 'external', 'both'.
Setting this to `false` drops the inline sourcemap from the generated
step/workflow/webhook bundles and sets `shouldAddSourcemapSupport:
false` on the Vercel step.func config. In the nitro-v3 workbench this
reduces the step bundle from ~13MB to ~3.1MB, which unblocks users
hitting Vercel's 250MB function size limit.
CopilotAI review requested due to automatic review settings April 23, 2026 21:22
@vercel

vercelBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d81c01a

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

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

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

github-actionsBot commented Apr 23, 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🥇 Express0.042s (-5.0%)1.005s (~)0.963s101.00x
💻 LocalNitro0.043s (+0.7%)1.005s (~)0.962s101.03x
💻 LocalNext.js (Turbopack)0.047s1.005s0.958s101.11x
🐘 PostgresNext.js (Turbopack)0.057s1.009s0.953s101.34x
🐘 PostgresNitro0.060s (-37.2% 🟢)1.009s (-3.2%)0.949s101.42x
🐘 PostgresExpress0.062s (+6.7% 🔺)1.010s (~)0.948s101.47x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.121s2.006s0.886s101.00x
💻 LocalExpress1.125s (~)2.006s (~)0.881s101.00x
💻 LocalNitro1.128s (~)2.006s (~)0.879s101.01x
🐘 PostgresNext.js (Turbopack)1.140s2.008s0.868s101.02x
🐘 PostgresNitro1.147s (+0.6%)2.011s (~)0.864s101.02x
🐘 PostgresExpress1.153s (+0.6%)2.011s (~)0.857s101.03x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.787s11.022s0.235s31.00x
🐘 PostgresNitro10.891s (~)11.022s (~)0.131s31.01x
🐘 PostgresNext.js (Turbopack)10.920s11.023s0.103s31.01x
🐘 PostgresExpress10.930s (~)11.026s (~)0.095s31.01x
💻 LocalNitro10.938s (~)11.025s (~)0.087s31.01x
💻 LocalExpress10.953s (~)11.024s (~)0.071s31.02x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)14.505s15.024s0.518s41.00x
🐘 PostgresNitro14.527s (~)15.025s (~)0.497s41.00x
💻 LocalNext.js (Turbopack)14.564s15.029s0.465s41.00x
🐘 PostgresExpress14.642s (~)15.024s (~)0.382s41.01x
💻 LocalExpress15.016s (~)15.281s (+1.7%)0.265s41.04x
💻 LocalNitro15.034s (~)15.783s (-1.5%)0.749s41.04x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro13.856s (-0.8%)14.162s (-1.0%)0.305s71.00x
🐘 PostgresExpress14.074s (~)14.596s (~)0.522s71.02x
🐘 PostgresNext.js (Turbopack)14.221s14.739s0.518s71.03x
💻 LocalNext.js (Turbopack)15.986s16.197s0.210s61.15x
💻 LocalExpress16.747s (+0.9%)17.031s (~)0.285s61.21x
💻 LocalNitro16.850s (~)17.031s (~)0.182s61.22x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.246s2.010s0.764s151.00x
🐘 PostgresNitro1.259s (-1.2%)2.010s (~)0.751s151.01x
🐘 PostgresExpress1.271s (+0.9%)2.010s (~)0.739s151.02x
💻 LocalExpress1.538s (+3.3%)2.006s (~)0.469s151.23x
💻 LocalNitro1.560s (-4.4%)2.006s (-3.3%)0.446s151.25x
💻 LocalNext.js (Turbopack)1.582s2.073s0.491s151.27x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.323s (-1.2%)3.009s (~)0.685s101.00x
🐘 PostgresExpress2.336s (-1.0%)3.009s (~)0.673s101.01x
🐘 PostgresNext.js (Turbopack)2.429s3.009s0.580s101.05x
💻 LocalNext.js (Turbopack)2.768s3.342s0.574s91.19x
💻 LocalExpress3.104s (+5.1% 🔺)4.011s (+16.1% 🔺)0.906s81.34x
💻 LocalNitro3.230s (+2.7%)4.011s (+3.2%)0.781s81.39x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.468s (-0.5%)4.011s (~)0.543s81.00x
🐘 PostgresNitro3.481s (~)4.011s (~)0.530s81.00x
🐘 PostgresNext.js (Turbopack)3.667s4.011s0.345s81.06x
💻 LocalNext.js (Turbopack)7.714s8.016s0.302s42.22x
💻 LocalNitro8.511s (+1.9%)9.025s (~)0.514s42.45x
💻 LocalExpress9.053s (+8.6% 🔺)10.021s (+11.0% 🔺)0.968s32.61x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.218s2.010s0.791s151.00x
🐘 PostgresExpress1.256s (~)2.009s (~)0.752s151.03x
🐘 PostgresNitro1.267s (+0.8%)2.008s (~)0.742s151.04x
💻 LocalNitro1.545s (-17.2% 🟢)2.007s (-14.3% 🟢)0.462s151.27x
💻 LocalNext.js (Turbopack)1.576s2.073s0.497s151.29x
💻 LocalExpress1.587s (-16.2% 🟢)2.005s (-15.2% 🟢)0.418s151.30x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.333s (~)3.011s (~)0.678s101.00x
🐘 PostgresExpress2.349s (~)3.010s (~)0.660s101.01x
🐘 PostgresNext.js (Turbopack)2.398s3.007s0.609s101.03x
💻 LocalExpress3.010s (-3.9%)3.885s (+3.3%)0.875s81.29x
💻 LocalNitro3.159s (+3.1%)4.010s (+3.2%)0.851s81.35x
💻 LocalNext.js (Turbopack)3.195s3.885s0.690s81.37x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.467s (~)4.011s (~)0.544s81.00x
🐘 PostgresExpress3.469s (-0.9%)4.009s (~)0.540s81.00x
🐘 PostgresNext.js (Turbopack)3.635s4.011s0.376s81.05x
💻 LocalNext.js (Turbopack)8.371s8.769s0.398s42.41x
💻 LocalExpress9.136s (+3.8%)9.523s (+2.7%)0.387s42.64x
💻 LocalNitro9.455s (+3.4%)10.023s (~)0.569s32.73x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.764s1.023s0.259s591.00x
🐘 PostgresNitro0.812s (-1.1%)1.006s (~)0.194s601.06x
💻 LocalNext.js (Turbopack)0.829s1.004s0.175s601.08x
🐘 PostgresExpress0.846s (+0.9%)1.023s (~)0.177s591.11x
💻 LocalNitro1.000s (+2.0%)1.400s (+28.0% 🔺)0.400s431.31x
💻 LocalExpress1.024s (+4.1%)1.881s (+74.8% 🔺)0.857s321.34x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.888s2.052s0.164s441.00x
🐘 PostgresNitro1.935s (~)2.150s (+2.3%)0.214s421.03x
🐘 PostgresExpress1.992s (+0.8%)2.402s (+6.4% 🔺)0.410s381.06x
💻 LocalNext.js (Turbopack)2.689s3.008s0.319s301.42x
💻 LocalNitro3.033s (~)3.759s (~)0.726s241.61x
💻 LocalExpress3.057s (+1.4%)3.885s (+8.4% 🔺)0.828s241.62x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)3.763s4.009s0.246s301.00x
🐘 PostgresNitro3.904s (-4.9%)4.147s (-9.9% 🟢)0.244s291.04x
🐘 PostgresExpress4.125s (+3.4%)4.931s (+12.9% 🔺)0.806s251.10x
💻 LocalNext.js (Turbopack)8.557s9.017s0.460s142.27x
💻 LocalExpress9.169s (~)9.864s (-1.5%)0.695s132.44x
💻 LocalNitro9.686s (+4.2%)10.353s (+3.3%)0.667s122.57x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.266s1.007s0.741s601.00x
🐘 PostgresExpress0.280s (-0.7%)1.007s (~)0.726s601.06x
🐘 PostgresNitro0.288s (+1.8%)1.007s (~)0.719s601.08x
💻 LocalNext.js (Turbopack)0.533s1.004s0.472s602.00x
💻 LocalExpress0.603s (+7.5% 🔺)1.005s (~)0.402s602.27x
💻 LocalNitro0.606s (~)1.022s (~)0.416s592.28x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.480s1.006s0.526s901.00x
🐘 PostgresExpress0.507s (-0.5%)1.007s (~)0.500s901.06x
🐘 PostgresNitro0.512s (+3.2%)1.006s (~)0.494s901.07x
💻 LocalNext.js (Turbopack)2.505s3.009s0.503s305.22x
💻 LocalNitro2.529s (~)3.009s (~)0.480s305.27x
💻 LocalExpress2.540s (+1.1%)3.009s (~)0.469s305.29x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.769s1.006s0.237s1201.00x
🐘 PostgresNitro0.800s (+1.2%)1.008s (~)0.208s1201.04x
🐘 PostgresExpress0.855s (+4.4%)1.020s (~)0.165s1181.11x
💻 LocalNext.js (Turbopack)10.358s10.933s0.575s1113.47x
💻 LocalExpress11.163s (~)11.850s (-0.8%)0.687s1114.51x
💻 LocalNitro11.200s (~)11.938s (+2.4%)0.738s1114.56x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.177s1.003s0.012s1.018s0.841s101.00x
🐘 PostgresNext.js (Turbopack)0.201s1.001s0.001s1.010s0.809s101.14x
💻 LocalExpress0.205s (+3.0%)1.004s (~)0.012s (-0.8%)1.018s (~)0.813s101.16x
🐘 PostgresNitro0.207s (+0.8%)0.995s (~)0.002s (~)1.010s (~)0.803s101.17x
💻 LocalNitro0.213s (~)1.004s (~)0.013s (+4.0%)1.019s (~)0.806s101.21x
🐘 PostgresExpress0.230s (+12.1% 🔺)0.993s (-0.6%)0.001s (-25.0% 🟢)1.010s (~)0.780s101.30x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.609s (-2.4%)1.005s (~)0.012s (+193.4% 🔺)1.032s (+0.9%)0.422s591.00x
🐘 PostgresNext.js (Turbopack)0.623s1.009s0.007s1.025s0.403s591.02x
💻 LocalNext.js (Turbopack)0.662s1.011s0.010s1.024s0.363s591.09x
🐘 PostgresExpress0.679s (+7.8% 🔺)1.023s (+1.6%)0.011s (+183.1% 🔺)1.047s (+2.3%)0.368s581.11x
💻 LocalNitro0.750s (-10.6% 🟢)1.012s (~)0.010s (+2.6%)1.023s (-8.3% 🟢)0.273s591.23x
💻 LocalExpress0.842s (+11.2% 🔺)1.012s (-1.7%)0.010s (+9.8% 🔺)1.117s (+7.4% 🔺)0.275s541.38x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.973s (~)1.210s (-3.0%)0.000s (+44.0% 🔺)1.235s (-1.8%)0.262s501.00x
🐘 PostgresExpress0.974s (+1.4%)1.272s (~)0.000s (+144.7% 🔺)1.284s (-1.7%)0.310s471.00x
🐘 PostgresNext.js (Turbopack)1.002s1.465s0.000s1.484s0.482s411.03x
💻 LocalNext.js (Turbopack)1.235s2.019s0.000s2.022s0.787s301.27x
💻 LocalNitro1.238s (+1.3%)2.021s (~)0.000s (+333.3% 🔺)2.023s (~)0.785s301.27x
💻 LocalExpress1.259s (+2.7%)2.022s (~)0.000s (+30.0% 🔺)2.024s (~)0.765s301.29x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.763s (-0.5%)2.100s (-3.5%)0.000s (NaN%)2.113s (-3.9%)0.350s291.00x
🐘 PostgresNext.js (Turbopack)1.795s2.106s0.000s2.112s0.317s291.02x
🐘 PostgresNitro1.806s (+0.8%)2.139s (~)0.000s (-100.0% 🟢)2.171s (~)0.365s281.02x
💻 LocalNext.js (Turbopack)3.548s4.032s0.001s4.036s0.488s152.01x
💻 LocalExpress3.574s (+3.1%)4.099s (+1.6%)0.001s (~)4.102s (+1.6%)0.527s152.03x
💻 LocalNitro3.576s (+5.6% 🔺)4.167s (+3.4%)0.001s (+12.5% 🔺)4.170s (+3.3%)0.594s152.03x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

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

Winner determined by most benchmark wins

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


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ 💻 Local Development10522861140
✅ 📦 Local Production10540861140
✅ 🐘 Local Postgres10540861140
✅ 🪟 Windows950095
✅ 📋 Other267018285
Total352222763800

❌ Failed Tests

💻 Local Development (2 failed)

vite-stable (2 failed):

  • 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

Details by Category

❌ 💻 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-stable8726
✅ 📦 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


Some E2E test jobs failed:

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

Check the workflow run for details.

CopilotAI 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.

Pull request overview

Adds a configurable sourcemap mode to Workflow builders (and the Nitro integration) to reduce bundle size—especially for Vercel deployments—while keeping current defaults unless overridden.

Changes:

  • Introduces a sourcemap builder option + WORKFLOW_SOURCEMAP env var parsing/precedence logic.
  • Plumbs sourcemap through @workflow/nitroModuleOptions and Nitro builders.
  • Disables Vercel runtime sourcemap support when sourcemaps are disabled; adds unit tests for resolution behavior.

Reviewed changes

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

Show a summary per file
FileDescription
packages/nitro/src/types.tsAdds workflow.sourcemap option to Nitro module types/docs.
packages/nitro/src/builders.tsPasses Nitro workflow.sourcemap into createBaseBuilderConfig().
packages/builders/src/vercel-build-output-api.tsTies Vercel shouldAddSourcemapSupport to resolved sourcemap enablement.
packages/builders/src/types.tsAdds SourcemapMode type and documents new config option.
packages/builders/src/resolve-sourcemap.test.tsAdds unit tests for config/env precedence and env parsing.
packages/builders/src/config-helpers.tsPlumbs sourcemap through shared builder config creation helper.
packages/builders/src/base-builder.tsImplements env parsing + resolution helper and applies it to esbuild invocations.
.changeset/configurable-sourcemap.mdDeclares minor bumps for @workflow/builders and @workflow/nitro.

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

Comment on lines +73 to +75
* `both`). If neither is set, sourcemaps default to `'inline'` so stack
* traces from step and workflow VM execution include original file names
* and line numbers.

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

The docstring implies a single global default ("sourcemaps default to 'inline'") for all bundles including the webhook, but BaseBuilder uses different per-invocation defaults (e.g. webhook/final wrapper default off unless WORKFLOW_EMIT_SOURCEMAPS_FOR_DEBUGGING or an explicit sourcemap override is set). Please clarify the wording so users don’t assume webhook bundles default to inline sourcemaps.

Suggested change
*`both`).Ifneither is set,sourcemapsdefaultto`'inline'`sostack
*tracesfromstepandworkflowVMexecutionincludeoriginalfilenames
*andlinenumbers.
*`both`).Ifneither is set,theeffectivedefaultdependsonthebundle
*beinggenerated.StepandworkflowVMbundlestypicallydefaultto
*`'inline'`sostacktracesincludeoriginalfilenamesandlinenumbers,
*whilewebhook/final-wrapperbundlesmaydefaultto`false`unless
*debuggingoranexplicitsourcemapoverrideenablesthem.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +35
* If unset, the value of the `WORKFLOW_SOURCEMAP` environment variable is
* consulted. If neither is set, the builder's default (`'inline'`) is used.
*
* Setting this to `false` can dramatically reduce the generated function
* bundle size when deploying to Vercel (useful for staying under the 250MB
* function size limit).

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

This comment says that if neither config nor WORKFLOW_SOURCEMAP is set, the builder default ('inline') is used. In builders, sourcemap defaults are per-bundle (steps/workflows default to inline, but the webhook wrapper defaults off unless WORKFLOW_EMIT_SOURCEMAPS_FOR_DEBUGGING or an override is provided). Please adjust the wording to reflect the per-bundle defaults to avoid confusion for Nitro users.

Copilot uses AI. Check for mistakes.
Comment on lines +113 to +117
protected resolveSourcemap(defaultMode: SourcemapMode): SourcemapMode {
if (this.config.sourcemap !== undefined) {
return this.config.sourcemap;
}
const fromEnv = parseSourcemapEnv(process.env.WORKFLOW_SOURCEMAP);

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

resolveSourcemap() re-parses WORKFLOW_SOURCEMAP on every call. When the env value is unrecognized, parseSourcemapEnv() emits a warning, which can result in repeated identical warnings during a single build (steps + workflows + webhook + vc-config). Consider memoizing the parsed env value (and/or warning once) to keep logs from getting noisy.

Copilot uses AI. Check for mistakes.
@TooTallNate

Copy link
Copy Markdown
MemberAuthor

Closing as duplicate of #1842, which is more comprehensive (covers Next.js, SvelteKit, Astro, and Nest on top of Nitro, and includes docs updates for every framework).

I'll leave a review on #1842 with a few suggestions that came out of this branch:

  • Consider using esbuild's native sourcemap vocabulary (true | false | 'inline' | 'linked' | 'external' | 'both') rather than introducing a bespoke 'disabled' string. This would also let users pick 'external' / 'linked' / 'both' if they want a .map file on disk.
  • A WORKFLOW_SOURCEMAP env var complement is handy for CI overrides without touching framework config.
  • Unit tests for the resolver (see resolve-sourcemap.test.ts on this branch for prior art).

Happy to port any of those over as follow-ups if useful.

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.

2 participants

@TooTallNate
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(builders,nitro): configurable sourcemap mode - #1843

Closed
TooTallNate wants to merge 1 commit into
mainfrom
feat/configurable-sourcemap
Closed

feat(builders,nitro): configurable sourcemap mode#1843
TooTallNate wants to merge 1 commit into
mainfrom
feat/configurable-sourcemap

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Apr 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a sourcemap builder option (and matching WORKFLOW_SOURCEMAP environment variable) that accepts esbuild's sourcemap values: true | false | 'inline' | 'linked' | 'external' | 'both'.
  • Plumbs the option through @workflow/nitro's ModuleOptions so it can be set via nitro.config.ts.
  • When sourcemaps are disabled, the Vercel Build Output API step function is also emitted with shouldAddSourcemapSupport: false (saves runtime overhead).

Motivation

The SDK currently builds the step bundle with sourcemap: 'inline' unconditionally, which inlines a base64-encoded sourcemap into the bundle and significantly increases the generated function size. For projects deploying to Vercel, that can push functions past the platform's 250MB function size limit. Giving users an option to disable (or choose a non-inline mode for) the sourcemap is an easy lever to bring bundle size down.

Verification

Measured in workbench/nitro-v3 (Vercel preset):

Modestep.func sizeinline sourcemapshouldAddSourcemapSupport
default (unchanged)13 MByestrue
WORKFLOW_SOURCEMAP=false3.1 MBnofalse
workflow.sourcemap = false in nitro config3.1 MBnofalse

~75% bundle reduction with sourcemaps off.

Tests

10 new unit tests in packages/builders/src/resolve-sourcemap.test.ts covering config precedence, env var parsing (true/false/0/1/inline/linked/external/both), empty/unrecognized env values, and the sourcemapsEnabled getter. All 139 builder tests pass.

Add a `sourcemap` builder option (plumbed through @workflow/nitro's
module options) and a matching `WORKFLOW_SOURCEMAP` environment
variable. Accepts the same values as esbuild: true, false, 'inline',
'linked', 'external', 'both'.
Setting this to `false` drops the inline sourcemap from the generated
step/workflow/webhook bundles and sets `shouldAddSourcemapSupport:
false` on the Vercel step.func config. In the nitro-v3 workbench this
reduces the step bundle from ~13MB to ~3.1MB, which unblocks users
hitting Vercel's 250MB function size limit.
CopilotAI review requested due to automatic review settings April 23, 2026 21:22
@vercel

vercelBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d81c01a

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

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

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

github-actionsBot commented Apr 23, 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🥇 Express0.042s (-5.0%)1.005s (~)0.963s101.00x
💻 LocalNitro0.043s (+0.7%)1.005s (~)0.962s101.03x
💻 LocalNext.js (Turbopack)0.047s1.005s0.958s101.11x
🐘 PostgresNext.js (Turbopack)0.057s1.009s0.953s101.34x
🐘 PostgresNitro0.060s (-37.2% 🟢)1.009s (-3.2%)0.949s101.42x
🐘 PostgresExpress0.062s (+6.7% 🔺)1.010s (~)0.948s101.47x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.121s2.006s0.886s101.00x
💻 LocalExpress1.125s (~)2.006s (~)0.881s101.00x
💻 LocalNitro1.128s (~)2.006s (~)0.879s101.01x
🐘 PostgresNext.js (Turbopack)1.140s2.008s0.868s101.02x
🐘 PostgresNitro1.147s (+0.6%)2.011s (~)0.864s101.02x
🐘 PostgresExpress1.153s (+0.6%)2.011s (~)0.857s101.03x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.787s11.022s0.235s31.00x
🐘 PostgresNitro10.891s (~)11.022s (~)0.131s31.01x
🐘 PostgresNext.js (Turbopack)10.920s11.023s0.103s31.01x
🐘 PostgresExpress10.930s (~)11.026s (~)0.095s31.01x
💻 LocalNitro10.938s (~)11.025s (~)0.087s31.01x
💻 LocalExpress10.953s (~)11.024s (~)0.071s31.02x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)14.505s15.024s0.518s41.00x
🐘 PostgresNitro14.527s (~)15.025s (~)0.497s41.00x
💻 LocalNext.js (Turbopack)14.564s15.029s0.465s41.00x
🐘 PostgresExpress14.642s (~)15.024s (~)0.382s41.01x
💻 LocalExpress15.016s (~)15.281s (+1.7%)0.265s41.04x
💻 LocalNitro15.034s (~)15.783s (-1.5%)0.749s41.04x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro13.856s (-0.8%)14.162s (-1.0%)0.305s71.00x
🐘 PostgresExpress14.074s (~)14.596s (~)0.522s71.02x
🐘 PostgresNext.js (Turbopack)14.221s14.739s0.518s71.03x
💻 LocalNext.js (Turbopack)15.986s16.197s0.210s61.15x
💻 LocalExpress16.747s (+0.9%)17.031s (~)0.285s61.21x
💻 LocalNitro16.850s (~)17.031s (~)0.182s61.22x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.246s2.010s0.764s151.00x
🐘 PostgresNitro1.259s (-1.2%)2.010s (~)0.751s151.01x
🐘 PostgresExpress1.271s (+0.9%)2.010s (~)0.739s151.02x
💻 LocalExpress1.538s (+3.3%)2.006s (~)0.469s151.23x
💻 LocalNitro1.560s (-4.4%)2.006s (-3.3%)0.446s151.25x
💻 LocalNext.js (Turbopack)1.582s2.073s0.491s151.27x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.323s (-1.2%)3.009s (~)0.685s101.00x
🐘 PostgresExpress2.336s (-1.0%)3.009s (~)0.673s101.01x
🐘 PostgresNext.js (Turbopack)2.429s3.009s0.580s101.05x
💻 LocalNext.js (Turbopack)2.768s3.342s0.574s91.19x
💻 LocalExpress3.104s (+5.1% 🔺)4.011s (+16.1% 🔺)0.906s81.34x
💻 LocalNitro3.230s (+2.7%)4.011s (+3.2%)0.781s81.39x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.468s (-0.5%)4.011s (~)0.543s81.00x
🐘 PostgresNitro3.481s (~)4.011s (~)0.530s81.00x
🐘 PostgresNext.js (Turbopack)3.667s4.011s0.345s81.06x
💻 LocalNext.js (Turbopack)7.714s8.016s0.302s42.22x
💻 LocalNitro8.511s (+1.9%)9.025s (~)0.514s42.45x
💻 LocalExpress9.053s (+8.6% 🔺)10.021s (+11.0% 🔺)0.968s32.61x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.218s2.010s0.791s151.00x
🐘 PostgresExpress1.256s (~)2.009s (~)0.752s151.03x
🐘 PostgresNitro1.267s (+0.8%)2.008s (~)0.742s151.04x
💻 LocalNitro1.545s (-17.2% 🟢)2.007s (-14.3% 🟢)0.462s151.27x
💻 LocalNext.js (Turbopack)1.576s2.073s0.497s151.29x
💻 LocalExpress1.587s (-16.2% 🟢)2.005s (-15.2% 🟢)0.418s151.30x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.333s (~)3.011s (~)0.678s101.00x
🐘 PostgresExpress2.349s (~)3.010s (~)0.660s101.01x
🐘 PostgresNext.js (Turbopack)2.398s3.007s0.609s101.03x
💻 LocalExpress3.010s (-3.9%)3.885s (+3.3%)0.875s81.29x
💻 LocalNitro3.159s (+3.1%)4.010s (+3.2%)0.851s81.35x
💻 LocalNext.js (Turbopack)3.195s3.885s0.690s81.37x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.467s (~)4.011s (~)0.544s81.00x
🐘 PostgresExpress3.469s (-0.9%)4.009s (~)0.540s81.00x
🐘 PostgresNext.js (Turbopack)3.635s4.011s0.376s81.05x
💻 LocalNext.js (Turbopack)8.371s8.769s0.398s42.41x
💻 LocalExpress9.136s (+3.8%)9.523s (+2.7%)0.387s42.64x
💻 LocalNitro9.455s (+3.4%)10.023s (~)0.569s32.73x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.764s1.023s0.259s591.00x
🐘 PostgresNitro0.812s (-1.1%)1.006s (~)0.194s601.06x
💻 LocalNext.js (Turbopack)0.829s1.004s0.175s601.08x
🐘 PostgresExpress0.846s (+0.9%)1.023s (~)0.177s591.11x
💻 LocalNitro1.000s (+2.0%)1.400s (+28.0% 🔺)0.400s431.31x
💻 LocalExpress1.024s (+4.1%)1.881s (+74.8% 🔺)0.857s321.34x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.888s2.052s0.164s441.00x
🐘 PostgresNitro1.935s (~)2.150s (+2.3%)0.214s421.03x
🐘 PostgresExpress1.992s (+0.8%)2.402s (+6.4% 🔺)0.410s381.06x
💻 LocalNext.js (Turbopack)2.689s3.008s0.319s301.42x
💻 LocalNitro3.033s (~)3.759s (~)0.726s241.61x
💻 LocalExpress3.057s (+1.4%)3.885s (+8.4% 🔺)0.828s241.62x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)3.763s4.009s0.246s301.00x
🐘 PostgresNitro3.904s (-4.9%)4.147s (-9.9% 🟢)0.244s291.04x
🐘 PostgresExpress4.125s (+3.4%)4.931s (+12.9% 🔺)0.806s251.10x
💻 LocalNext.js (Turbopack)8.557s9.017s0.460s142.27x
💻 LocalExpress9.169s (~)9.864s (-1.5%)0.695s132.44x
💻 LocalNitro9.686s (+4.2%)10.353s (+3.3%)0.667s122.57x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.266s1.007s0.741s601.00x
🐘 PostgresExpress0.280s (-0.7%)1.007s (~)0.726s601.06x
🐘 PostgresNitro0.288s (+1.8%)1.007s (~)0.719s601.08x
💻 LocalNext.js (Turbopack)0.533s1.004s0.472s602.00x
💻 LocalExpress0.603s (+7.5% 🔺)1.005s (~)0.402s602.27x
💻 LocalNitro0.606s (~)1.022s (~)0.416s592.28x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.480s1.006s0.526s901.00x
🐘 PostgresExpress0.507s (-0.5%)1.007s (~)0.500s901.06x
🐘 PostgresNitro0.512s (+3.2%)1.006s (~)0.494s901.07x
💻 LocalNext.js (Turbopack)2.505s3.009s0.503s305.22x
💻 LocalNitro2.529s (~)3.009s (~)0.480s305.27x
💻 LocalExpress2.540s (+1.1%)3.009s (~)0.469s305.29x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.769s1.006s0.237s1201.00x
🐘 PostgresNitro0.800s (+1.2%)1.008s (~)0.208s1201.04x
🐘 PostgresExpress0.855s (+4.4%)1.020s (~)0.165s1181.11x
💻 LocalNext.js (Turbopack)10.358s10.933s0.575s1113.47x
💻 LocalExpress11.163s (~)11.850s (-0.8%)0.687s1114.51x
💻 LocalNitro11.200s (~)11.938s (+2.4%)0.738s1114.56x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.177s1.003s0.012s1.018s0.841s101.00x
🐘 PostgresNext.js (Turbopack)0.201s1.001s0.001s1.010s0.809s101.14x
💻 LocalExpress0.205s (+3.0%)1.004s (~)0.012s (-0.8%)1.018s (~)0.813s101.16x
🐘 PostgresNitro0.207s (+0.8%)0.995s (~)0.002s (~)1.010s (~)0.803s101.17x
💻 LocalNitro0.213s (~)1.004s (~)0.013s (+4.0%)1.019s (~)0.806s101.21x
🐘 PostgresExpress0.230s (+12.1% 🔺)0.993s (-0.6%)0.001s (-25.0% 🟢)1.010s (~)0.780s101.30x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.609s (-2.4%)1.005s (~)0.012s (+193.4% 🔺)1.032s (+0.9%)0.422s591.00x
🐘 PostgresNext.js (Turbopack)0.623s1.009s0.007s1.025s0.403s591.02x
💻 LocalNext.js (Turbopack)0.662s1.011s0.010s1.024s0.363s591.09x
🐘 PostgresExpress0.679s (+7.8% 🔺)1.023s (+1.6%)0.011s (+183.1% 🔺)1.047s (+2.3%)0.368s581.11x
💻 LocalNitro0.750s (-10.6% 🟢)1.012s (~)0.010s (+2.6%)1.023s (-8.3% 🟢)0.273s591.23x
💻 LocalExpress0.842s (+11.2% 🔺)1.012s (-1.7%)0.010s (+9.8% 🔺)1.117s (+7.4% 🔺)0.275s541.38x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.973s (~)1.210s (-3.0%)0.000s (+44.0% 🔺)1.235s (-1.8%)0.262s501.00x
🐘 PostgresExpress0.974s (+1.4%)1.272s (~)0.000s (+144.7% 🔺)1.284s (-1.7%)0.310s471.00x
🐘 PostgresNext.js (Turbopack)1.002s1.465s0.000s1.484s0.482s411.03x
💻 LocalNext.js (Turbopack)1.235s2.019s0.000s2.022s0.787s301.27x
💻 LocalNitro1.238s (+1.3%)2.021s (~)0.000s (+333.3% 🔺)2.023s (~)0.785s301.27x
💻 LocalExpress1.259s (+2.7%)2.022s (~)0.000s (+30.0% 🔺)2.024s (~)0.765s301.29x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.763s (-0.5%)2.100s (-3.5%)0.000s (NaN%)2.113s (-3.9%)0.350s291.00x
🐘 PostgresNext.js (Turbopack)1.795s2.106s0.000s2.112s0.317s291.02x
🐘 PostgresNitro1.806s (+0.8%)2.139s (~)0.000s (-100.0% 🟢)2.171s (~)0.365s281.02x
💻 LocalNext.js (Turbopack)3.548s4.032s0.001s4.036s0.488s152.01x
💻 LocalExpress3.574s (+3.1%)4.099s (+1.6%)0.001s (~)4.102s (+1.6%)0.527s152.03x
💻 LocalNitro3.576s (+5.6% 🔺)4.167s (+3.4%)0.001s (+12.5% 🔺)4.170s (+3.3%)0.594s152.03x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

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

Winner determined by most benchmark wins

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


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ 💻 Local Development10522861140
✅ 📦 Local Production10540861140
✅ 🐘 Local Postgres10540861140
✅ 🪟 Windows950095
✅ 📋 Other267018285
Total352222763800

❌ Failed Tests

💻 Local Development (2 failed)

vite-stable (2 failed):

  • 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

Details by Category

❌ 💻 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-stable8726
✅ 📦 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


Some E2E test jobs failed:

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

Check the workflow run for details.

CopilotAI 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.

Pull request overview

Adds a configurable sourcemap mode to Workflow builders (and the Nitro integration) to reduce bundle size—especially for Vercel deployments—while keeping current defaults unless overridden.

Changes:

  • Introduces a sourcemap builder option + WORKFLOW_SOURCEMAP env var parsing/precedence logic.
  • Plumbs sourcemap through @workflow/nitroModuleOptions and Nitro builders.
  • Disables Vercel runtime sourcemap support when sourcemaps are disabled; adds unit tests for resolution behavior.

Reviewed changes

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

Show a summary per file
FileDescription
packages/nitro/src/types.tsAdds workflow.sourcemap option to Nitro module types/docs.
packages/nitro/src/builders.tsPasses Nitro workflow.sourcemap into createBaseBuilderConfig().
packages/builders/src/vercel-build-output-api.tsTies Vercel shouldAddSourcemapSupport to resolved sourcemap enablement.
packages/builders/src/types.tsAdds SourcemapMode type and documents new config option.
packages/builders/src/resolve-sourcemap.test.tsAdds unit tests for config/env precedence and env parsing.
packages/builders/src/config-helpers.tsPlumbs sourcemap through shared builder config creation helper.
packages/builders/src/base-builder.tsImplements env parsing + resolution helper and applies it to esbuild invocations.
.changeset/configurable-sourcemap.mdDeclares minor bumps for @workflow/builders and @workflow/nitro.

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

Comment on lines +73 to +75
* `both`). If neither is set, sourcemaps default to `'inline'` so stack
* traces from step and workflow VM execution include original file names
* and line numbers.

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

The docstring implies a single global default ("sourcemaps default to 'inline'") for all bundles including the webhook, but BaseBuilder uses different per-invocation defaults (e.g. webhook/final wrapper default off unless WORKFLOW_EMIT_SOURCEMAPS_FOR_DEBUGGING or an explicit sourcemap override is set). Please clarify the wording so users don’t assume webhook bundles default to inline sourcemaps.

Suggested change
*`both`).Ifneither is set,sourcemapsdefaultto`'inline'`sostack
*tracesfromstepandworkflowVMexecutionincludeoriginalfilenames
*andlinenumbers.
*`both`).Ifneither is set,theeffectivedefaultdependsonthebundle
*beinggenerated.StepandworkflowVMbundlestypicallydefaultto
*`'inline'`sostacktracesincludeoriginalfilenamesandlinenumbers,
*whilewebhook/final-wrapperbundlesmaydefaultto`false`unless
*debuggingoranexplicitsourcemapoverrideenablesthem.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +35
* If unset, the value of the `WORKFLOW_SOURCEMAP` environment variable is
* consulted. If neither is set, the builder's default (`'inline'`) is used.
*
* Setting this to `false` can dramatically reduce the generated function
* bundle size when deploying to Vercel (useful for staying under the 250MB
* function size limit).

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

This comment says that if neither config nor WORKFLOW_SOURCEMAP is set, the builder default ('inline') is used. In builders, sourcemap defaults are per-bundle (steps/workflows default to inline, but the webhook wrapper defaults off unless WORKFLOW_EMIT_SOURCEMAPS_FOR_DEBUGGING or an override is provided). Please adjust the wording to reflect the per-bundle defaults to avoid confusion for Nitro users.

Copilot uses AI. Check for mistakes.
Comment on lines +113 to +117
protected resolveSourcemap(defaultMode: SourcemapMode): SourcemapMode {
if (this.config.sourcemap !== undefined) {
return this.config.sourcemap;
}
const fromEnv = parseSourcemapEnv(process.env.WORKFLOW_SOURCEMAP);

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

resolveSourcemap() re-parses WORKFLOW_SOURCEMAP on every call. When the env value is unrecognized, parseSourcemapEnv() emits a warning, which can result in repeated identical warnings during a single build (steps + workflows + webhook + vc-config). Consider memoizing the parsed env value (and/or warning once) to keep logs from getting noisy.

Copilot uses AI. Check for mistakes.
@TooTallNate

Copy link
Copy Markdown
MemberAuthor

Closing as duplicate of #1842, which is more comprehensive (covers Next.js, SvelteKit, Astro, and Nest on top of Nitro, and includes docs updates for every framework).

I'll leave a review on #1842 with a few suggestions that came out of this branch:

  • Consider using esbuild's native sourcemap vocabulary (true | false | 'inline' | 'linked' | 'external' | 'both') rather than introducing a bespoke 'disabled' string. This would also let users pick 'external' / 'linked' / 'both' if they want a .map file on disk.
  • A WORKFLOW_SOURCEMAP env var complement is handy for CI overrides without touching framework config.
  • Unit tests for the resolver (see resolve-sourcemap.test.ts on this branch for prior art).

Happy to port any of those over as follow-ups if useful.

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.

2 participants

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

feat(builders,nitro): configurable sourcemap mode - #1843

Closed
TooTallNate wants to merge 1 commit into
mainfrom
feat/configurable-sourcemap
Closed

feat(builders,nitro): configurable sourcemap mode#1843
TooTallNate wants to merge 1 commit into
mainfrom
feat/configurable-sourcemap

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Apr 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a sourcemap builder option (and matching WORKFLOW_SOURCEMAP environment variable) that accepts esbuild's sourcemap values: true | false | 'inline' | 'linked' | 'external' | 'both'.
  • Plumbs the option through @workflow/nitro's ModuleOptions so it can be set via nitro.config.ts.
  • When sourcemaps are disabled, the Vercel Build Output API step function is also emitted with shouldAddSourcemapSupport: false (saves runtime overhead).

Motivation

The SDK currently builds the step bundle with sourcemap: 'inline' unconditionally, which inlines a base64-encoded sourcemap into the bundle and significantly increases the generated function size. For projects deploying to Vercel, that can push functions past the platform's 250MB function size limit. Giving users an option to disable (or choose a non-inline mode for) the sourcemap is an easy lever to bring bundle size down.

Verification

Measured in workbench/nitro-v3 (Vercel preset):

Modestep.func sizeinline sourcemapshouldAddSourcemapSupport
default (unchanged)13 MByestrue
WORKFLOW_SOURCEMAP=false3.1 MBnofalse
workflow.sourcemap = false in nitro config3.1 MBnofalse

~75% bundle reduction with sourcemaps off.

Tests

10 new unit tests in packages/builders/src/resolve-sourcemap.test.ts covering config precedence, env var parsing (true/false/0/1/inline/linked/external/both), empty/unrecognized env values, and the sourcemapsEnabled getter. All 139 builder tests pass.

Add a `sourcemap` builder option (plumbed through @workflow/nitro's
module options) and a matching `WORKFLOW_SOURCEMAP` environment
variable. Accepts the same values as esbuild: true, false, 'inline',
'linked', 'external', 'both'.
Setting this to `false` drops the inline sourcemap from the generated
step/workflow/webhook bundles and sets `shouldAddSourcemapSupport:
false` on the Vercel step.func config. In the nitro-v3 workbench this
reduces the step bundle from ~13MB to ~3.1MB, which unblocks users
hitting Vercel's 250MB function size limit.
CopilotAI review requested due to automatic review settings April 23, 2026 21:22
@vercel

vercelBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d81c01a

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

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

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

github-actionsBot commented Apr 23, 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🥇 Express0.042s (-5.0%)1.005s (~)0.963s101.00x
💻 LocalNitro0.043s (+0.7%)1.005s (~)0.962s101.03x
💻 LocalNext.js (Turbopack)0.047s1.005s0.958s101.11x
🐘 PostgresNext.js (Turbopack)0.057s1.009s0.953s101.34x
🐘 PostgresNitro0.060s (-37.2% 🟢)1.009s (-3.2%)0.949s101.42x
🐘 PostgresExpress0.062s (+6.7% 🔺)1.010s (~)0.948s101.47x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.121s2.006s0.886s101.00x
💻 LocalExpress1.125s (~)2.006s (~)0.881s101.00x
💻 LocalNitro1.128s (~)2.006s (~)0.879s101.01x
🐘 PostgresNext.js (Turbopack)1.140s2.008s0.868s101.02x
🐘 PostgresNitro1.147s (+0.6%)2.011s (~)0.864s101.02x
🐘 PostgresExpress1.153s (+0.6%)2.011s (~)0.857s101.03x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.787s11.022s0.235s31.00x
🐘 PostgresNitro10.891s (~)11.022s (~)0.131s31.01x
🐘 PostgresNext.js (Turbopack)10.920s11.023s0.103s31.01x
🐘 PostgresExpress10.930s (~)11.026s (~)0.095s31.01x
💻 LocalNitro10.938s (~)11.025s (~)0.087s31.01x
💻 LocalExpress10.953s (~)11.024s (~)0.071s31.02x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)14.505s15.024s0.518s41.00x
🐘 PostgresNitro14.527s (~)15.025s (~)0.497s41.00x
💻 LocalNext.js (Turbopack)14.564s15.029s0.465s41.00x
🐘 PostgresExpress14.642s (~)15.024s (~)0.382s41.01x
💻 LocalExpress15.016s (~)15.281s (+1.7%)0.265s41.04x
💻 LocalNitro15.034s (~)15.783s (-1.5%)0.749s41.04x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro13.856s (-0.8%)14.162s (-1.0%)0.305s71.00x
🐘 PostgresExpress14.074s (~)14.596s (~)0.522s71.02x
🐘 PostgresNext.js (Turbopack)14.221s14.739s0.518s71.03x
💻 LocalNext.js (Turbopack)15.986s16.197s0.210s61.15x
💻 LocalExpress16.747s (+0.9%)17.031s (~)0.285s61.21x
💻 LocalNitro16.850s (~)17.031s (~)0.182s61.22x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.246s2.010s0.764s151.00x
🐘 PostgresNitro1.259s (-1.2%)2.010s (~)0.751s151.01x
🐘 PostgresExpress1.271s (+0.9%)2.010s (~)0.739s151.02x
💻 LocalExpress1.538s (+3.3%)2.006s (~)0.469s151.23x
💻 LocalNitro1.560s (-4.4%)2.006s (-3.3%)0.446s151.25x
💻 LocalNext.js (Turbopack)1.582s2.073s0.491s151.27x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.323s (-1.2%)3.009s (~)0.685s101.00x
🐘 PostgresExpress2.336s (-1.0%)3.009s (~)0.673s101.01x
🐘 PostgresNext.js (Turbopack)2.429s3.009s0.580s101.05x
💻 LocalNext.js (Turbopack)2.768s3.342s0.574s91.19x
💻 LocalExpress3.104s (+5.1% 🔺)4.011s (+16.1% 🔺)0.906s81.34x
💻 LocalNitro3.230s (+2.7%)4.011s (+3.2%)0.781s81.39x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.468s (-0.5%)4.011s (~)0.543s81.00x
🐘 PostgresNitro3.481s (~)4.011s (~)0.530s81.00x
🐘 PostgresNext.js (Turbopack)3.667s4.011s0.345s81.06x
💻 LocalNext.js (Turbopack)7.714s8.016s0.302s42.22x
💻 LocalNitro8.511s (+1.9%)9.025s (~)0.514s42.45x
💻 LocalExpress9.053s (+8.6% 🔺)10.021s (+11.0% 🔺)0.968s32.61x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.218s2.010s0.791s151.00x
🐘 PostgresExpress1.256s (~)2.009s (~)0.752s151.03x
🐘 PostgresNitro1.267s (+0.8%)2.008s (~)0.742s151.04x
💻 LocalNitro1.545s (-17.2% 🟢)2.007s (-14.3% 🟢)0.462s151.27x
💻 LocalNext.js (Turbopack)1.576s2.073s0.497s151.29x
💻 LocalExpress1.587s (-16.2% 🟢)2.005s (-15.2% 🟢)0.418s151.30x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.333s (~)3.011s (~)0.678s101.00x
🐘 PostgresExpress2.349s (~)3.010s (~)0.660s101.01x
🐘 PostgresNext.js (Turbopack)2.398s3.007s0.609s101.03x
💻 LocalExpress3.010s (-3.9%)3.885s (+3.3%)0.875s81.29x
💻 LocalNitro3.159s (+3.1%)4.010s (+3.2%)0.851s81.35x
💻 LocalNext.js (Turbopack)3.195s3.885s0.690s81.37x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.467s (~)4.011s (~)0.544s81.00x
🐘 PostgresExpress3.469s (-0.9%)4.009s (~)0.540s81.00x
🐘 PostgresNext.js (Turbopack)3.635s4.011s0.376s81.05x
💻 LocalNext.js (Turbopack)8.371s8.769s0.398s42.41x
💻 LocalExpress9.136s (+3.8%)9.523s (+2.7%)0.387s42.64x
💻 LocalNitro9.455s (+3.4%)10.023s (~)0.569s32.73x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.764s1.023s0.259s591.00x
🐘 PostgresNitro0.812s (-1.1%)1.006s (~)0.194s601.06x
💻 LocalNext.js (Turbopack)0.829s1.004s0.175s601.08x
🐘 PostgresExpress0.846s (+0.9%)1.023s (~)0.177s591.11x
💻 LocalNitro1.000s (+2.0%)1.400s (+28.0% 🔺)0.400s431.31x
💻 LocalExpress1.024s (+4.1%)1.881s (+74.8% 🔺)0.857s321.34x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.888s2.052s0.164s441.00x
🐘 PostgresNitro1.935s (~)2.150s (+2.3%)0.214s421.03x
🐘 PostgresExpress1.992s (+0.8%)2.402s (+6.4% 🔺)0.410s381.06x
💻 LocalNext.js (Turbopack)2.689s3.008s0.319s301.42x
💻 LocalNitro3.033s (~)3.759s (~)0.726s241.61x
💻 LocalExpress3.057s (+1.4%)3.885s (+8.4% 🔺)0.828s241.62x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)3.763s4.009s0.246s301.00x
🐘 PostgresNitro3.904s (-4.9%)4.147s (-9.9% 🟢)0.244s291.04x
🐘 PostgresExpress4.125s (+3.4%)4.931s (+12.9% 🔺)0.806s251.10x
💻 LocalNext.js (Turbopack)8.557s9.017s0.460s142.27x
💻 LocalExpress9.169s (~)9.864s (-1.5%)0.695s132.44x
💻 LocalNitro9.686s (+4.2%)10.353s (+3.3%)0.667s122.57x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.266s1.007s0.741s601.00x
🐘 PostgresExpress0.280s (-0.7%)1.007s (~)0.726s601.06x
🐘 PostgresNitro0.288s (+1.8%)1.007s (~)0.719s601.08x
💻 LocalNext.js (Turbopack)0.533s1.004s0.472s602.00x
💻 LocalExpress0.603s (+7.5% 🔺)1.005s (~)0.402s602.27x
💻 LocalNitro0.606s (~)1.022s (~)0.416s592.28x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.480s1.006s0.526s901.00x
🐘 PostgresExpress0.507s (-0.5%)1.007s (~)0.500s901.06x
🐘 PostgresNitro0.512s (+3.2%)1.006s (~)0.494s901.07x
💻 LocalNext.js (Turbopack)2.505s3.009s0.503s305.22x
💻 LocalNitro2.529s (~)3.009s (~)0.480s305.27x
💻 LocalExpress2.540s (+1.1%)3.009s (~)0.469s305.29x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.769s1.006s0.237s1201.00x
🐘 PostgresNitro0.800s (+1.2%)1.008s (~)0.208s1201.04x
🐘 PostgresExpress0.855s (+4.4%)1.020s (~)0.165s1181.11x
💻 LocalNext.js (Turbopack)10.358s10.933s0.575s1113.47x
💻 LocalExpress11.163s (~)11.850s (-0.8%)0.687s1114.51x
💻 LocalNitro11.200s (~)11.938s (+2.4%)0.738s1114.56x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.177s1.003s0.012s1.018s0.841s101.00x
🐘 PostgresNext.js (Turbopack)0.201s1.001s0.001s1.010s0.809s101.14x
💻 LocalExpress0.205s (+3.0%)1.004s (~)0.012s (-0.8%)1.018s (~)0.813s101.16x
🐘 PostgresNitro0.207s (+0.8%)0.995s (~)0.002s (~)1.010s (~)0.803s101.17x
💻 LocalNitro0.213s (~)1.004s (~)0.013s (+4.0%)1.019s (~)0.806s101.21x
🐘 PostgresExpress0.230s (+12.1% 🔺)0.993s (-0.6%)0.001s (-25.0% 🟢)1.010s (~)0.780s101.30x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.609s (-2.4%)1.005s (~)0.012s (+193.4% 🔺)1.032s (+0.9%)0.422s591.00x
🐘 PostgresNext.js (Turbopack)0.623s1.009s0.007s1.025s0.403s591.02x
💻 LocalNext.js (Turbopack)0.662s1.011s0.010s1.024s0.363s591.09x
🐘 PostgresExpress0.679s (+7.8% 🔺)1.023s (+1.6%)0.011s (+183.1% 🔺)1.047s (+2.3%)0.368s581.11x
💻 LocalNitro0.750s (-10.6% 🟢)1.012s (~)0.010s (+2.6%)1.023s (-8.3% 🟢)0.273s591.23x
💻 LocalExpress0.842s (+11.2% 🔺)1.012s (-1.7%)0.010s (+9.8% 🔺)1.117s (+7.4% 🔺)0.275s541.38x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.973s (~)1.210s (-3.0%)0.000s (+44.0% 🔺)1.235s (-1.8%)0.262s501.00x
🐘 PostgresExpress0.974s (+1.4%)1.272s (~)0.000s (+144.7% 🔺)1.284s (-1.7%)0.310s471.00x
🐘 PostgresNext.js (Turbopack)1.002s1.465s0.000s1.484s0.482s411.03x
💻 LocalNext.js (Turbopack)1.235s2.019s0.000s2.022s0.787s301.27x
💻 LocalNitro1.238s (+1.3%)2.021s (~)0.000s (+333.3% 🔺)2.023s (~)0.785s301.27x
💻 LocalExpress1.259s (+2.7%)2.022s (~)0.000s (+30.0% 🔺)2.024s (~)0.765s301.29x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.763s (-0.5%)2.100s (-3.5%)0.000s (NaN%)2.113s (-3.9%)0.350s291.00x
🐘 PostgresNext.js (Turbopack)1.795s2.106s0.000s2.112s0.317s291.02x
🐘 PostgresNitro1.806s (+0.8%)2.139s (~)0.000s (-100.0% 🟢)2.171s (~)0.365s281.02x
💻 LocalNext.js (Turbopack)3.548s4.032s0.001s4.036s0.488s152.01x
💻 LocalExpress3.574s (+3.1%)4.099s (+1.6%)0.001s (~)4.102s (+1.6%)0.527s152.03x
💻 LocalNitro3.576s (+5.6% 🔺)4.167s (+3.4%)0.001s (+12.5% 🔺)4.170s (+3.3%)0.594s152.03x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

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

Winner determined by most benchmark wins

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


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ 💻 Local Development10522861140
✅ 📦 Local Production10540861140
✅ 🐘 Local Postgres10540861140
✅ 🪟 Windows950095
✅ 📋 Other267018285
Total352222763800

❌ Failed Tests

💻 Local Development (2 failed)

vite-stable (2 failed):

  • 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

Details by Category

❌ 💻 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-stable8726
✅ 📦 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


Some E2E test jobs failed:

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

Check the workflow run for details.

CopilotAI 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.

Pull request overview

Adds a configurable sourcemap mode to Workflow builders (and the Nitro integration) to reduce bundle size—especially for Vercel deployments—while keeping current defaults unless overridden.

Changes:

  • Introduces a sourcemap builder option + WORKFLOW_SOURCEMAP env var parsing/precedence logic.
  • Plumbs sourcemap through @workflow/nitroModuleOptions and Nitro builders.
  • Disables Vercel runtime sourcemap support when sourcemaps are disabled; adds unit tests for resolution behavior.

Reviewed changes

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

Show a summary per file
FileDescription
packages/nitro/src/types.tsAdds workflow.sourcemap option to Nitro module types/docs.
packages/nitro/src/builders.tsPasses Nitro workflow.sourcemap into createBaseBuilderConfig().
packages/builders/src/vercel-build-output-api.tsTies Vercel shouldAddSourcemapSupport to resolved sourcemap enablement.
packages/builders/src/types.tsAdds SourcemapMode type and documents new config option.
packages/builders/src/resolve-sourcemap.test.tsAdds unit tests for config/env precedence and env parsing.
packages/builders/src/config-helpers.tsPlumbs sourcemap through shared builder config creation helper.
packages/builders/src/base-builder.tsImplements env parsing + resolution helper and applies it to esbuild invocations.
.changeset/configurable-sourcemap.mdDeclares minor bumps for @workflow/builders and @workflow/nitro.

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

Comment on lines +73 to +75
* `both`). If neither is set, sourcemaps default to `'inline'` so stack
* traces from step and workflow VM execution include original file names
* and line numbers.

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

The docstring implies a single global default ("sourcemaps default to 'inline'") for all bundles including the webhook, but BaseBuilder uses different per-invocation defaults (e.g. webhook/final wrapper default off unless WORKFLOW_EMIT_SOURCEMAPS_FOR_DEBUGGING or an explicit sourcemap override is set). Please clarify the wording so users don’t assume webhook bundles default to inline sourcemaps.

Suggested change
*`both`).Ifneither is set,sourcemapsdefaultto`'inline'`sostack
*tracesfromstepandworkflowVMexecutionincludeoriginalfilenames
*andlinenumbers.
*`both`).Ifneither is set,theeffectivedefaultdependsonthebundle
*beinggenerated.StepandworkflowVMbundlestypicallydefaultto
*`'inline'`sostacktracesincludeoriginalfilenamesandlinenumbers,
*whilewebhook/final-wrapperbundlesmaydefaultto`false`unless
*debuggingoranexplicitsourcemapoverrideenablesthem.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +35
* If unset, the value of the `WORKFLOW_SOURCEMAP` environment variable is
* consulted. If neither is set, the builder's default (`'inline'`) is used.
*
* Setting this to `false` can dramatically reduce the generated function
* bundle size when deploying to Vercel (useful for staying under the 250MB
* function size limit).

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

This comment says that if neither config nor WORKFLOW_SOURCEMAP is set, the builder default ('inline') is used. In builders, sourcemap defaults are per-bundle (steps/workflows default to inline, but the webhook wrapper defaults off unless WORKFLOW_EMIT_SOURCEMAPS_FOR_DEBUGGING or an override is provided). Please adjust the wording to reflect the per-bundle defaults to avoid confusion for Nitro users.

Copilot uses AI. Check for mistakes.
Comment on lines +113 to +117
protected resolveSourcemap(defaultMode: SourcemapMode): SourcemapMode {
if (this.config.sourcemap !== undefined) {
return this.config.sourcemap;
}
const fromEnv = parseSourcemapEnv(process.env.WORKFLOW_SOURCEMAP);

CopilotAIApr 23, 2026

Copy link

Choose a reason for hiding this comment

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

resolveSourcemap() re-parses WORKFLOW_SOURCEMAP on every call. When the env value is unrecognized, parseSourcemapEnv() emits a warning, which can result in repeated identical warnings during a single build (steps + workflows + webhook + vc-config). Consider memoizing the parsed env value (and/or warning once) to keep logs from getting noisy.

Copilot uses AI. Check for mistakes.
@TooTallNate

Copy link
Copy Markdown
MemberAuthor

Closing as duplicate of #1842, which is more comprehensive (covers Next.js, SvelteKit, Astro, and Nest on top of Nitro, and includes docs updates for every framework).

I'll leave a review on #1842 with a few suggestions that came out of this branch:

  • Consider using esbuild's native sourcemap vocabulary (true | false | 'inline' | 'linked' | 'external' | 'both') rather than introducing a bespoke 'disabled' string. This would also let users pick 'external' / 'linked' / 'both' if they want a .map file on disk.
  • A WORKFLOW_SOURCEMAP env var complement is handy for CI overrides without touching framework config.
  • Unit tests for the resolver (see resolve-sourcemap.test.ts on this branch for prior art).

Happy to port any of those over as follow-ups if useful.

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.

2 participants

@TooTallNate