Skip to content

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

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

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

Conversation

@TooTallNate
Copy link
Copy Markdown
Member

@TooTallNate TooTallNate commented Apr 23, 2026

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):

Mode step.func size inline sourcemap shouldAddSourcemapSupport
default (unchanged) 13 MB yes true
WORKFLOW_SOURCEMAP=false 3.1 MB no false
workflow.sourcemap = false in nitro config 3.1 MB no false

~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.
Copilot AI review requested due to automatic review settings April 23, 2026 21:22
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 23, 2026

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

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment Apr 23, 2026 9:27pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Apr 23, 2026 9:27pm
example-workflow Ready Ready Preview, Comment Apr 23, 2026 9:27pm
workbench-astro-workflow Ready Ready Preview, Comment Apr 23, 2026 9:27pm
workbench-express-workflow Ready Ready Preview, Comment Apr 23, 2026 9:27pm
workbench-fastify-workflow Ready Ready Preview, Comment Apr 23, 2026 9:27pm
workbench-hono-workflow Ready Ready Preview, Comment Apr 23, 2026 9:27pm
workbench-nitro-workflow Ready Ready Preview, Comment Apr 23, 2026 9:27pm
workbench-nuxt-workflow Ready Ready Preview, Comment Apr 23, 2026 9:27pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Apr 23, 2026 9:27pm
workbench-vite-workflow Ready Ready Preview, Comment Apr 23, 2026 9:27pm
workflow-docs Ready Ready Preview, Comment, Open in v0 Apr 23, 2026 9:27pm
workflow-swc-playground Ready Ready Preview, Comment Apr 23, 2026 9:27pm
workflow-web Ready Ready Preview, Comment Apr 23, 2026 9:27pm

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 23, 2026

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

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

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 23, 2026

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 0.042s (-5.0%) 1.005s (~) 0.963s 10 1.00x
💻 Local Nitro 0.043s (+0.7%) 1.005s (~) 0.962s 10 1.03x
💻 Local Next.js (Turbopack) 0.047s 1.005s 0.958s 10 1.11x
🐘 Postgres Next.js (Turbopack) 0.057s 1.009s 0.953s 10 1.34x
🐘 Postgres Nitro 0.060s (-37.2% 🟢) 1.009s (-3.2%) 0.949s 10 1.42x
🐘 Postgres Express 0.062s (+6.7% 🔺) 1.010s (~) 0.948s 10 1.47x
workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 1.121s 2.006s 0.886s 10 1.00x
💻 Local Express 1.125s (~) 2.006s (~) 0.881s 10 1.00x
💻 Local Nitro 1.128s (~) 2.006s (~) 0.879s 10 1.01x
🐘 Postgres Next.js (Turbopack) 1.140s 2.008s 0.868s 10 1.02x
🐘 Postgres Nitro 1.147s (+0.6%) 2.011s (~) 0.864s 10 1.02x
🐘 Postgres Express 1.153s (+0.6%) 2.011s (~) 0.857s 10 1.03x
workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 10.787s 11.022s 0.235s 3 1.00x
🐘 Postgres Nitro 10.891s (~) 11.022s (~) 0.131s 3 1.01x
🐘 Postgres Next.js (Turbopack) 10.920s 11.023s 0.103s 3 1.01x
🐘 Postgres Express 10.930s (~) 11.026s (~) 0.095s 3 1.01x
💻 Local Nitro 10.938s (~) 11.025s (~) 0.087s 3 1.01x
💻 Local Express 10.953s (~) 11.024s (~) 0.071s 3 1.02x
workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 14.505s 15.024s 0.518s 4 1.00x
🐘 Postgres Nitro 14.527s (~) 15.025s (~) 0.497s 4 1.00x
💻 Local Next.js (Turbopack) 14.564s 15.029s 0.465s 4 1.00x
🐘 Postgres Express 14.642s (~) 15.024s (~) 0.382s 4 1.01x
💻 Local Express 15.016s (~) 15.281s (+1.7%) 0.265s 4 1.04x
💻 Local Nitro 15.034s (~) 15.783s (-1.5%) 0.749s 4 1.04x
workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 13.856s (-0.8%) 14.162s (-1.0%) 0.305s 7 1.00x
🐘 Postgres Express 14.074s (~) 14.596s (~) 0.522s 7 1.02x
🐘 Postgres Next.js (Turbopack) 14.221s 14.739s 0.518s 7 1.03x
💻 Local Next.js (Turbopack) 15.986s 16.197s 0.210s 6 1.15x
💻 Local Express 16.747s (+0.9%) 17.031s (~) 0.285s 6 1.21x
💻 Local Nitro 16.850s (~) 17.031s (~) 0.182s 6 1.22x
Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 1.246s 2.010s 0.764s 15 1.00x
🐘 Postgres Nitro 1.259s (-1.2%) 2.010s (~) 0.751s 15 1.01x
🐘 Postgres Express 1.271s (+0.9%) 2.010s (~) 0.739s 15 1.02x
💻 Local Express 1.538s (+3.3%) 2.006s (~) 0.469s 15 1.23x
💻 Local Nitro 1.560s (-4.4%) 2.006s (-3.3%) 0.446s 15 1.25x
💻 Local Next.js (Turbopack) 1.582s 2.073s 0.491s 15 1.27x
Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 2.323s (-1.2%) 3.009s (~) 0.685s 10 1.00x
🐘 Postgres Express 2.336s (-1.0%) 3.009s (~) 0.673s 10 1.01x
🐘 Postgres Next.js (Turbopack) 2.429s 3.009s 0.580s 10 1.05x
💻 Local Next.js (Turbopack) 2.768s 3.342s 0.574s 9 1.19x
💻 Local Express 3.104s (+5.1% 🔺) 4.011s (+16.1% 🔺) 0.906s 8 1.34x
💻 Local Nitro 3.230s (+2.7%) 4.011s (+3.2%) 0.781s 8 1.39x
Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 3.468s (-0.5%) 4.011s (~) 0.543s 8 1.00x
🐘 Postgres Nitro 3.481s (~) 4.011s (~) 0.530s 8 1.00x
🐘 Postgres Next.js (Turbopack) 3.667s 4.011s 0.345s 8 1.06x
💻 Local Next.js (Turbopack) 7.714s 8.016s 0.302s 4 2.22x
💻 Local Nitro 8.511s (+1.9%) 9.025s (~) 0.514s 4 2.45x
💻 Local Express 9.053s (+8.6% 🔺) 10.021s (+11.0% 🔺) 0.968s 3 2.61x
Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 1.218s 2.010s 0.791s 15 1.00x
🐘 Postgres Express 1.256s (~) 2.009s (~) 0.752s 15 1.03x
🐘 Postgres Nitro 1.267s (+0.8%) 2.008s (~) 0.742s 15 1.04x
💻 Local Nitro 1.545s (-17.2% 🟢) 2.007s (-14.3% 🟢) 0.462s 15 1.27x
💻 Local Next.js (Turbopack) 1.576s 2.073s 0.497s 15 1.29x
💻 Local Express 1.587s (-16.2% 🟢) 2.005s (-15.2% 🟢) 0.418s 15 1.30x
Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 2.333s (~) 3.011s (~) 0.678s 10 1.00x
🐘 Postgres Express 2.349s (~) 3.010s (~) 0.660s 10 1.01x
🐘 Postgres Next.js (Turbopack) 2.398s 3.007s 0.609s 10 1.03x
💻 Local Express 3.010s (-3.9%) 3.885s (+3.3%) 0.875s 8 1.29x
💻 Local Nitro 3.159s (+3.1%) 4.010s (+3.2%) 0.851s 8 1.35x
💻 Local Next.js (Turbopack) 3.195s 3.885s 0.690s 8 1.37x
Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 3.467s (~) 4.011s (~) 0.544s 8 1.00x
🐘 Postgres Express 3.469s (-0.9%) 4.009s (~) 0.540s 8 1.00x
🐘 Postgres Next.js (Turbopack) 3.635s 4.011s 0.376s 8 1.05x
💻 Local Next.js (Turbopack) 8.371s 8.769s 0.398s 4 2.41x
💻 Local Express 9.136s (+3.8%) 9.523s (+2.7%) 0.387s 4 2.64x
💻 Local Nitro 9.455s (+3.4%) 10.023s (~) 0.569s 3 2.73x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 0.764s 1.023s 0.259s 59 1.00x
🐘 Postgres Nitro 0.812s (-1.1%) 1.006s (~) 0.194s 60 1.06x
💻 Local Next.js (Turbopack) 0.829s 1.004s 0.175s 60 1.08x
🐘 Postgres Express 0.846s (+0.9%) 1.023s (~) 0.177s 59 1.11x
💻 Local Nitro 1.000s (+2.0%) 1.400s (+28.0% 🔺) 0.400s 43 1.31x
💻 Local Express 1.024s (+4.1%) 1.881s (+74.8% 🔺) 0.857s 32 1.34x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 1.888s 2.052s 0.164s 44 1.00x
🐘 Postgres Nitro 1.935s (~) 2.150s (+2.3%) 0.214s 42 1.03x
🐘 Postgres Express 1.992s (+0.8%) 2.402s (+6.4% 🔺) 0.410s 38 1.06x
💻 Local Next.js (Turbopack) 2.689s 3.008s 0.319s 30 1.42x
💻 Local Nitro 3.033s (~) 3.759s (~) 0.726s 24 1.61x
💻 Local Express 3.057s (+1.4%) 3.885s (+8.4% 🔺) 0.828s 24 1.62x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 3.763s 4.009s 0.246s 30 1.00x
🐘 Postgres Nitro 3.904s (-4.9%) 4.147s (-9.9% 🟢) 0.244s 29 1.04x
🐘 Postgres Express 4.125s (+3.4%) 4.931s (+12.9% 🔺) 0.806s 25 1.10x
💻 Local Next.js (Turbopack) 8.557s 9.017s 0.460s 14 2.27x
💻 Local Express 9.169s (~) 9.864s (-1.5%) 0.695s 13 2.44x
💻 Local Nitro 9.686s (+4.2%) 10.353s (+3.3%) 0.667s 12 2.57x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 0.266s 1.007s 0.741s 60 1.00x
🐘 Postgres Express 0.280s (-0.7%) 1.007s (~) 0.726s 60 1.06x
🐘 Postgres Nitro 0.288s (+1.8%) 1.007s (~) 0.719s 60 1.08x
💻 Local Next.js (Turbopack) 0.533s 1.004s 0.472s 60 2.00x
💻 Local Express 0.603s (+7.5% 🔺) 1.005s (~) 0.402s 60 2.27x
💻 Local Nitro 0.606s (~) 1.022s (~) 0.416s 59 2.28x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 0.480s 1.006s 0.526s 90 1.00x
🐘 Postgres Express 0.507s (-0.5%) 1.007s (~) 0.500s 90 1.06x
🐘 Postgres Nitro 0.512s (+3.2%) 1.006s (~) 0.494s 90 1.07x
💻 Local Next.js (Turbopack) 2.505s 3.009s 0.503s 30 5.22x
💻 Local Nitro 2.529s (~) 3.009s (~) 0.480s 30 5.27x
💻 Local Express 2.540s (+1.1%) 3.009s (~) 0.469s 30 5.29x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 0.769s 1.006s 0.237s 120 1.00x
🐘 Postgres Nitro 0.800s (+1.2%) 1.008s (~) 0.208s 120 1.04x
🐘 Postgres Express 0.855s (+4.4%) 1.020s (~) 0.165s 118 1.11x
💻 Local Next.js (Turbopack) 10.358s 10.933s 0.575s 11 13.47x
💻 Local Express 11.163s (~) 11.850s (-0.8%) 0.687s 11 14.51x
💻 Local Nitro 11.200s (~) 11.938s (+2.4%) 0.738s 11 14.56x
Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 0.177s 1.003s 0.012s 1.018s 0.841s 10 1.00x
🐘 Postgres Next.js (Turbopack) 0.201s 1.001s 0.001s 1.010s 0.809s 10 1.14x
💻 Local Express 0.205s (+3.0%) 1.004s (~) 0.012s (-0.8%) 1.018s (~) 0.813s 10 1.16x
🐘 Postgres Nitro 0.207s (+0.8%) 0.995s (~) 0.002s (~) 1.010s (~) 0.803s 10 1.17x
💻 Local Nitro 0.213s (~) 1.004s (~) 0.013s (+4.0%) 1.019s (~) 0.806s 10 1.21x
🐘 Postgres Express 0.230s (+12.1% 🔺) 0.993s (-0.6%) 0.001s (-25.0% 🟢) 1.010s (~) 0.780s 10 1.30x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.609s (-2.4%) 1.005s (~) 0.012s (+193.4% 🔺) 1.032s (+0.9%) 0.422s 59 1.00x
🐘 Postgres Next.js (Turbopack) 0.623s 1.009s 0.007s 1.025s 0.403s 59 1.02x
💻 Local Next.js (Turbopack) 0.662s 1.011s 0.010s 1.024s 0.363s 59 1.09x
🐘 Postgres Express 0.679s (+7.8% 🔺) 1.023s (+1.6%) 0.011s (+183.1% 🔺) 1.047s (+2.3%) 0.368s 58 1.11x
💻 Local Nitro 0.750s (-10.6% 🟢) 1.012s (~) 0.010s (+2.6%) 1.023s (-8.3% 🟢) 0.273s 59 1.23x
💻 Local Express 0.842s (+11.2% 🔺) 1.012s (-1.7%) 0.010s (+9.8% 🔺) 1.117s (+7.4% 🔺) 0.275s 54 1.38x
10 parallel streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.973s (~) 1.210s (-3.0%) 0.000s (+44.0% 🔺) 1.235s (-1.8%) 0.262s 50 1.00x
🐘 Postgres Express 0.974s (+1.4%) 1.272s (~) 0.000s (+144.7% 🔺) 1.284s (-1.7%) 0.310s 47 1.00x
🐘 Postgres Next.js (Turbopack) 1.002s 1.465s 0.000s 1.484s 0.482s 41 1.03x
💻 Local Next.js (Turbopack) 1.235s 2.019s 0.000s 2.022s 0.787s 30 1.27x
💻 Local Nitro 1.238s (+1.3%) 2.021s (~) 0.000s (+333.3% 🔺) 2.023s (~) 0.785s 30 1.27x
💻 Local Express 1.259s (+2.7%) 2.022s (~) 0.000s (+30.0% 🔺) 2.024s (~) 0.765s 30 1.29x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.763s (-0.5%) 2.100s (-3.5%) 0.000s (NaN%) 2.113s (-3.9%) 0.350s 29 1.00x
🐘 Postgres Next.js (Turbopack) 1.795s 2.106s 0.000s 2.112s 0.317s 29 1.02x
🐘 Postgres Nitro 1.806s (+0.8%) 2.139s (~) 0.000s (-100.0% 🟢) 2.171s (~) 0.365s 28 1.02x
💻 Local Next.js (Turbopack) 3.548s 4.032s 0.001s 4.036s 0.488s 15 2.01x
💻 Local Express 3.574s (+3.1%) 4.099s (+1.6%) 0.001s (~) 4.102s (+1.6%) 0.527s 15 2.03x
💻 Local Nitro 3.576s (+5.6% 🔺) 4.167s (+3.4%) 0.001s (+12.5% 🔺) 4.170s (+3.3%) 0.594s 15 2.03x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

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

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 🐘 Postgres 18/21
Next.js (Turbopack) 🐘 Postgres 17/21
Nitro 🐘 Postgres 19/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 23, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
❌ 💻 Local Development 1052 2 86 1140
✅ 📦 Local Production 1054 0 86 1140
✅ 🐘 Local Postgres 1054 0 86 1140
✅ 🪟 Windows 95 0 0 95
✅ 📋 Other 267 0 18 285
Total 3522 2 276 3800

❌ 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
App Passed Failed Skipped
✅ astro-stable 89 0 6
✅ express-stable 89 0 6
✅ fastify-stable 89 0 6
✅ hono-stable 89 0 6
✅ nextjs-turbopack-canary 76 0 19
✅ nextjs-turbopack-stable 95 0 0
✅ nextjs-webpack-canary 76 0 19
✅ nextjs-webpack-stable 95 0 0
✅ nitro-stable 89 0 6
✅ nuxt-stable 89 0 6
✅ sveltekit-stable 89 0 6
❌ vite-stable 87 2 6
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 89 0 6
✅ express-stable 89 0 6
✅ fastify-stable 89 0 6
✅ hono-stable 89 0 6
✅ nextjs-turbopack-canary 76 0 19
✅ nextjs-turbopack-stable 95 0 0
✅ nextjs-webpack-canary 76 0 19
✅ nextjs-webpack-stable 95 0 0
✅ nitro-stable 89 0 6
✅ nuxt-stable 89 0 6
✅ sveltekit-stable 89 0 6
✅ vite-stable 89 0 6
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 89 0 6
✅ express-stable 89 0 6
✅ fastify-stable 89 0 6
✅ hono-stable 89 0 6
✅ nextjs-turbopack-canary 76 0 19
✅ nextjs-turbopack-stable 95 0 0
✅ nextjs-webpack-canary 76 0 19
✅ nextjs-webpack-stable 95 0 0
✅ nitro-stable 89 0 6
✅ nuxt-stable 89 0 6
✅ sveltekit-stable 89 0 6
✅ vite-stable 89 0 6
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 95 0 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 89 0 6
✅ e2e-local-postgres-nest-stable 89 0 6
✅ e2e-local-prod-nest-stable 89 0 6

📋 View full workflow run


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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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/nitro ModuleOptions 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
File Description
packages/nitro/src/types.ts Adds workflow.sourcemap option to Nitro module types/docs.
packages/nitro/src/builders.ts Passes Nitro workflow.sourcemap into createBaseBuilderConfig().
packages/builders/src/vercel-build-output-api.ts Ties Vercel shouldAddSourcemapSupport to resolved sourcemap enablement.
packages/builders/src/types.ts Adds SourcemapMode type and documents new config option.
packages/builders/src/resolve-sourcemap.test.ts Adds unit tests for config/env precedence and env parsing.
packages/builders/src/config-helpers.ts Plumbs sourcemap through shared builder config creation helper.
packages/builders/src/base-builder.ts Implements env parsing + resolution helper and applies it to esbuild invocations.
.changeset/configurable-sourcemap.md Declares 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.
Copy link

Copilot AI Apr 23, 2026

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`). If neither is set, sourcemaps default to `'inline'` so stack
* traces from step and workflow VM execution include original file names
* and line numbers.
* `both`). If neither is set, the effective default depends on the bundle
* being generated. Step and workflow VM bundles typically default to
* `'inline'` so stack traces include original file names and line numbers,
* while webhook/final-wrapper bundles may default to `false` unless
* debugging or an explicit sourcemap override enables them.

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).
Copy link

Copilot AI Apr 23, 2026

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);
Copy link

Copilot AI Apr 23, 2026

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants