Skip to content

[builders] Fix transitive local TS dep externalization in step bundles#1609

Open
VaguelySerious wants to merge 4 commits intomainfrom
peter/issue-1179
Open

[builders] Fix transitive local TS dep externalization in step bundles#1609
VaguelySerious wants to merge 4 commits intomainfrom
peter/issue-1179

Conversation

@VaguelySerious
Copy link
Copy Markdown
Member

Summary

Closes #1179

Fixes transitive local TypeScript dependencies being externalized instead of bundled in step/workflow bundles, which caused native ESM crashes in Nuxt dev (and other frameworks) when extensionless relative imports like ./helpers couldn't be resolved by Node.

Root cause (two issues):

  • The discover-entries plugin's onResolve filter only matched imports with explicit file extensions (jsTsRegex). Extensionless imports like ./helpers were never tracked in importParents, leaving the dependency graph incomplete.
  • The swc plugin only checked if a resolved file was an ancestor of an entry (parentHasChild(resolved, entry)), but never checked if it was a descendant (parentHasChild(entry, resolved)). So even with a correct import graph, transitive local deps got externalized.

Fix:

  • Configure enhanced-resolve in the discover plugin with TS extensions so extensionless imports resolve correctly
  • Broaden the onResolve filter from jsTsRegex to /^[./]/ (relative imports only) to track extensionless local deps
  • Add a reverse parentHasChild(entry, resolved) check in the swc plugin so descendants of entries are bundled

Test plan

  • Added test for extensionless import tracking in discover-entries-esbuild-plugin.test.ts
  • Added test for transitive local dep bundling in swc-esbuild-plugin.test.ts
  • All 20 builder tests pass
  • CI passes

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 3, 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 May 4, 2026 6:19am
example-nextjs-workflow-webpack Ready Ready Preview, Comment May 4, 2026 6:19am
example-workflow Ready Ready Preview, Comment May 4, 2026 6:19am
workbench-astro-workflow Ready Ready Preview, Comment May 4, 2026 6:19am
workbench-express-workflow Ready Ready Preview, Comment May 4, 2026 6:19am
workbench-fastify-workflow Ready Ready Preview, Comment May 4, 2026 6:19am
workbench-hono-workflow Ready Ready Preview, Comment May 4, 2026 6:19am
workbench-nitro-workflow Ready Ready Preview, Comment May 4, 2026 6:19am
workbench-nuxt-workflow Ready Ready Preview, Comment May 4, 2026 6:19am
workbench-sveltekit-workflow Ready Ready Preview, Comment May 4, 2026 6:19am
workbench-tanstack-start-workflow Ready Ready Preview, Comment May 4, 2026 6:19am
workbench-vite-workflow Ready Ready Preview, Comment May 4, 2026 6:19am
workflow-docs Ready Ready Preview, Comment, Open in v0 May 4, 2026 6:19am
workflow-swc-playground Ready Ready Preview, Comment May 4, 2026 6:19am
workflow-tarballs Ready Ready Preview, Comment May 4, 2026 6:19am
workflow-web Ready Ready Preview, Comment May 4, 2026 6:19am

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 3, 2026

🦋 Changeset detected

Latest commit: c089357

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

This PR includes changesets to release 18 packages
Name Type
@workflow/builders Patch
@workflow/astro Patch
@workflow/cli Patch
@workflow/nest Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/vitest Patch
tarballs Patch
workflow Patch
@workflow/world-testing Patch
@workflow/nuxt 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 3, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 1011 0 67 1078
❌ 💻 Local Development 996 2 80 1078
✅ 📦 Local Production 998 0 80 1078
✅ 🐘 Local Postgres 998 0 80 1078
❌ 📋 Other 550 2 36 588
Total 4553 4 343 4900

❌ Failed Tests

💻 Local Development (2 failed)

nitro-stable (2 failed):

  • DurableAgent e2e core basic text response
  • addTenWorkflow | wrun_01KQRT4CJP0E1GA66Y6G6CFJQ0
📋 Other (2 failed)

e2e-local-dev-tanstack-start-stable (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KQRT5F9VTJFSNK482ME3S0KW
  • parallelSleepWorkflow | wrun_01KQRT66ESF1TYXCV4VVK33RJT

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 91 0 7
✅ example 91 0 7
✅ express 91 0 7
✅ fastify 91 0 7
✅ hono 91 0 7
✅ nextjs-turbopack 96 0 2
✅ nextjs-webpack 96 0 2
✅ nitro 91 0 7
✅ nuxt 91 0 7
✅ sveltekit 91 0 7
✅ vite 91 0 7
❌ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 92 0 6
✅ express-stable 92 0 6
✅ fastify-stable 92 0 6
✅ hono-stable 92 0 6
✅ nextjs-turbopack-canary 79 0 19
✅ nextjs-turbopack-stable 98 0 0
✅ nextjs-webpack-canary 79 0 19
✅ nextjs-webpack-stable 98 0 0
❌ nitro-stable 90 2 6
✅ nuxt-stable 92 0 6
✅ vite-stable 92 0 6
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 92 0 6
✅ express-stable 92 0 6
✅ fastify-stable 92 0 6
✅ hono-stable 92 0 6
✅ nextjs-turbopack-canary 79 0 19
✅ nextjs-turbopack-stable 98 0 0
✅ nextjs-webpack-canary 79 0 19
✅ nextjs-webpack-stable 98 0 0
✅ nitro-stable 92 0 6
✅ sveltekit-stable 92 0 6
✅ vite-stable 92 0 6
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 92 0 6
✅ express-stable 92 0 6
✅ fastify-stable 92 0 6
✅ hono-stable 92 0 6
✅ nextjs-turbopack-canary 79 0 19
✅ nextjs-turbopack-stable 98 0 0
✅ nextjs-webpack-canary 79 0 19
✅ nextjs-webpack-stable 98 0 0
✅ nitro-stable 92 0 6
✅ sveltekit-stable 92 0 6
✅ vite-stable 92 0 6
❌ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 92 0 6
❌ e2e-local-dev-tanstack-start-stable 90 2 6
✅ e2e-local-postgres-nest-stable 92 0 6
✅ e2e-local-postgres-tanstack-start-stable 92 0 6
✅ e2e-local-prod-nest-stable 92 0 6
✅ e2e-local-prod-tanstack-start-stable 92 0 6

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 3, 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.043s (-3.6%) 1.005s (~) 0.963s 10 1.00x
💻 Local Nitro 0.043s (-0.9%) 1.006s (~) 0.963s 10 1.00x
💻 Local Next.js (Turbopack) 0.048s 1.005s 0.957s 10 1.11x
🐘 Postgres Express 0.059s (+1.9%) 1.011s (~) 0.952s 10 1.38x
🐘 Postgres Next.js (Turbopack) 0.059s 1.011s 0.952s 10 1.39x
🐘 Postgres Nitro 0.060s (-37.4% 🟢) 1.011s (-3.1%) 0.951s 10 1.40x
workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 1.127s (~) 2.006s (~) 0.879s 10 1.00x
💻 Local Next.js (Turbopack) 1.128s 2.005s 0.877s 10 1.00x
💻 Local Nitro 1.135s (~) 2.007s (~) 0.872s 10 1.01x
🐘 Postgres Nitro 1.142s (~) 2.008s (~) 0.866s 10 1.01x
🐘 Postgres Express 1.146s (~) 2.009s (~) 0.863s 10 1.02x
🐘 Postgres Next.js (Turbopack) 1.153s 2.009s 0.856s 10 1.02x
workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 10.804s 11.024s 0.219s 3 1.00x
🐘 Postgres Express 10.868s (-0.9%) 11.023s (~) 0.155s 3 1.01x
💻 Local Express 10.942s (~) 11.023s (~) 0.081s 3 1.01x
💻 Local Nitro 10.957s (~) 11.023s (~) 0.066s 3 1.01x
🐘 Postgres Next.js (Turbopack) 10.973s 11.351s 0.379s 3 1.02x
🐘 Postgres Nitro 10.996s (+1.1%) 11.362s (+3.0%) 0.366s 3 1.02x
workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 14.567s 15.028s 0.462s 4 1.00x
🐘 Postgres Express 14.588s (~) 15.027s (~) 0.438s 4 1.00x
🐘 Postgres Next.js (Turbopack) 14.591s 15.024s 0.433s 4 1.00x
🐘 Postgres Nitro 14.682s (+0.6%) 15.023s (~) 0.341s 4 1.01x
💻 Local Express 15.007s (~) 15.279s (+1.7%) 0.272s 4 1.03x
💻 Local Nitro 15.034s (~) 15.779s (-1.6%) 0.746s 4 1.03x
workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 13.904s (-0.7%) 14.021s (-3.9%) 0.117s 7 1.00x
🐘 Postgres Next.js (Turbopack) 14.080s 14.740s 0.660s 7 1.01x
🐘 Postgres Nitro 14.115s (+1.1%) 14.883s (+4.0%) 0.767s 7 1.02x
💻 Local Next.js (Turbopack) 15.811s 16.196s 0.385s 6 1.14x
💻 Local Express 16.653s (~) 17.030s (~) 0.377s 6 1.20x
💻 Local Nitro 16.783s (~) 17.029s (~) 0.246s 6 1.21x
Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 1.245s 2.009s 0.765s 15 1.00x
🐘 Postgres Nitro 1.269s (~) 2.010s (~) 0.742s 15 1.02x
🐘 Postgres Express 1.285s (+2.0%) 2.010s (~) 0.725s 15 1.03x
💻 Local Nitro 1.526s (-6.4% 🟢) 2.007s (-3.2%) 0.480s 15 1.23x
💻 Local Express 1.541s (+3.5%) 2.006s (~) 0.465s 15 1.24x
💻 Local Next.js (Turbopack) 1.558s 2.073s 0.515s 15 1.25x
Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 2.365s (+0.6%) 3.009s (~) 0.644s 10 1.00x
🐘 Postgres Express 2.374s (+0.5%) 3.011s (~) 0.637s 10 1.00x
🐘 Postgres Next.js (Turbopack) 2.397s 3.011s 0.615s 10 1.01x
💻 Local Next.js (Turbopack) 2.899s 3.453s 0.554s 9 1.23x
💻 Local Nitro 3.140s (~) 3.884s (~) 0.744s 8 1.33x
💻 Local Express 3.179s (+7.6% 🔺) 4.011s (+16.1% 🔺) 0.832s 8 1.34x
Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 3.474s (~) 4.010s (~) 0.536s 8 1.00x
🐘 Postgres Express 3.482s (~) 4.012s (~) 0.530s 8 1.00x
🐘 Postgres Next.js (Turbopack) 3.637s 4.011s 0.373s 8 1.05x
💻 Local Next.js (Turbopack) 6.935s 7.514s 0.580s 4 2.00x
💻 Local Nitro 8.099s (-3.0%) 8.773s (-2.7%) 0.674s 4 2.33x
💻 Local Express 8.171s (-2.0%) 8.774s (-2.8%) 0.603s 4 2.35x
Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 1.213s 2.008s 0.795s 15 1.00x
🐘 Postgres Nitro 1.266s (+0.7%) 2.010s (~) 0.744s 15 1.04x
🐘 Postgres Express 1.272s (+1.2%) 2.008s (~) 0.736s 15 1.05x
💻 Local Next.js (Turbopack) 1.435s 2.006s 0.571s 15 1.18x
💻 Local Express 1.494s (-21.1% 🟢) 2.006s (-15.1% 🟢) 0.511s 15 1.23x
💻 Local Nitro 1.912s (+2.5%) 2.391s (+2.2%) 0.479s 13 1.58x
Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 2.352s (+0.5%) 3.009s (~) 0.658s 10 1.00x
🐘 Postgres Express 2.357s (+0.7%) 3.009s (~) 0.652s 10 1.00x
🐘 Postgres Next.js (Turbopack) 2.427s 3.009s 0.582s 10 1.03x
💻 Local Next.js (Turbopack) 2.660s 3.008s 0.348s 10 1.13x
💻 Local Express 3.023s (-3.5%) 3.565s (-5.3% 🟢) 0.542s 9 1.29x
💻 Local Nitro 3.028s (-1.2%) 3.760s (-3.3%) 0.732s 8 1.29x
Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 3.483s (~) 4.010s (~) 0.526s 8 1.00x
🐘 Postgres Nitro 3.513s (+0.9%) 4.013s (~) 0.500s 8 1.01x
🐘 Postgres Next.js (Turbopack) 3.659s 4.012s 0.353s 8 1.05x
💻 Local Next.js (Turbopack) 7.690s 8.265s 0.575s 4 2.21x
💻 Local Nitro 8.707s (-4.8%) 9.023s (-10.0% 🟢) 0.315s 4 2.50x
💻 Local Express 8.809s (~) 9.276s (~) 0.467s 4 2.53x
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.773s 1.006s 0.233s 60 1.00x
🐘 Postgres Nitro 0.842s (+2.7%) 1.041s (+3.4%) 0.198s 58 1.09x
🐘 Postgres Express 0.850s (+1.3%) 1.041s (+1.7%) 0.191s 58 1.10x
💻 Local Next.js (Turbopack) 0.868s 1.021s 0.153s 59 1.12x
💻 Local Express 1.005s (+2.1%) 1.331s (+23.7% 🔺) 0.326s 46 1.30x
💻 Local Nitro 1.007s (+2.7%) 1.530s (+39.9% 🔺) 0.523s 40 1.30x
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.943s 2.150s 0.207s 42 1.00x
🐘 Postgres Express 1.956s (-1.0%) 2.282s (+1.1%) 0.326s 40 1.01x
🐘 Postgres Nitro 1.996s (+3.6%) 2.509s (+19.4% 🔺) 0.512s 36 1.03x
💻 Local Next.js (Turbopack) 2.644s 3.008s 0.364s 30 1.36x
💻 Local Express 3.029s (~) 3.649s (+1.8%) 0.620s 25 1.56x
💻 Local Nitro 3.055s (+0.7%) 3.801s (+1.1%) 0.746s 24 1.57x
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.916s 4.110s 0.194s 30 1.00x
🐘 Postgres Express 3.918s (-1.8%) 4.147s (-5.1% 🟢) 0.229s 29 1.00x
🐘 Postgres Nitro 4.114s (~) 4.780s (+3.8%) 0.666s 26 1.05x
💻 Local Next.js (Turbopack) 8.327s 9.017s 0.689s 14 2.13x
💻 Local Express 9.125s (-0.9%) 9.787s (-2.3%) 0.662s 13 2.33x
💻 Local Nitro 9.132s (-1.8%) 9.787s (-2.3%) 0.655s 13 2.33x
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.253s 1.007s 0.754s 60 1.00x
🐘 Postgres Nitro 0.298s (+5.1% 🔺) 1.007s (~) 0.709s 60 1.18x
🐘 Postgres Express 0.300s (+6.3% 🔺) 1.007s (~) 0.706s 60 1.18x
💻 Local Next.js (Turbopack) 0.501s 1.004s 0.503s 60 1.98x
💻 Local Nitro 0.594s (-1.8%) 1.005s (-1.7%) 0.411s 60 2.34x
💻 Local Express 0.599s (+7.0% 🔺) 1.004s (~) 0.405s 60 2.37x
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.478s 1.007s 0.529s 90 1.00x
🐘 Postgres Nitro 0.505s (+1.8%) 1.007s (~) 0.502s 90 1.06x
🐘 Postgres Express 0.509s (~) 1.007s (~) 0.498s 90 1.06x
💻 Local Next.js (Turbopack) 2.348s 3.008s 0.660s 30 4.91x
💻 Local Express 2.473s (-1.6%) 3.009s (~) 0.537s 30 5.17x
💻 Local Nitro 2.502s (-1.4%) 3.009s (~) 0.507s 30 5.23x
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.773s 1.007s 0.234s 120 1.00x
🐘 Postgres Express 0.820s (~) 1.017s (~) 0.197s 118 1.06x
🐘 Postgres Nitro 0.821s (+3.8%) 1.010s (~) 0.189s 119 1.06x
💻 Local Next.js (Turbopack) 10.070s 10.607s 0.537s 12 13.03x
💻 Local Express 10.825s (-3.3%) 11.302s (-5.4% 🟢) 0.476s 11 14.01x
💻 Local Nitro 10.869s (-2.9%) 11.482s (-1.6%) 0.613s 11 14.06x
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.183s 1.003s 0.010s 1.016s 0.833s 10 1.00x
🐘 Postgres Next.js (Turbopack) 0.203s 1.000s 0.001s 1.010s 0.808s 10 1.11x
🐘 Postgres Nitro 0.208s (+1.4%) 1.000s (~) 0.001s (-6.7% 🟢) 1.011s (~) 0.803s 10 1.14x
💻 Local Nitro 0.208s (-2.5%) 1.004s (~) 0.012s (-0.8%) 1.018s (~) 0.810s 10 1.14x
💻 Local Express 0.213s (+6.9% 🔺) 1.004s (~) 0.012s (-2.5%) 1.018s (~) 0.805s 10 1.16x
🐘 Postgres Express 0.230s (+11.9% 🔺) 0.996s (~) 0.002s (-6.3% 🟢) 1.010s (~) 0.780s 10 1.25x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.618s (-1.8%) 1.005s (~) 0.004s (+3.1%) 1.022s (~) 0.403s 59 1.00x
🐘 Postgres Next.js (Turbopack) 0.621s 1.009s 0.006s 1.027s 0.406s 59 1.00x
🐘 Postgres Nitro 0.630s (+0.9%) 1.007s (~) 0.006s (+35.7% 🔺) 1.026s (~) 0.396s 59 1.02x
💻 Local Express 0.752s (-0.7%) 1.012s (-1.6%) 0.010s (+2.8%) 1.024s (-1.5%) 0.272s 59 1.22x
💻 Local Nitro 0.754s (-10.1% 🟢) 1.012s (~) 0.010s (+5.8% 🔺) 1.023s (-8.3% 🟢) 0.269s 59 1.22x
💻 Local Next.js (Turbopack) 0.770s 1.010s 0.009s 1.115s 0.344s 54 1.25x
10 parallel streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 0.917s 1.117s 0.000s 1.134s 0.216s 53 1.00x
🐘 Postgres Express 0.979s (+1.8%) 1.244s (-2.7%) 0.000s (-52.1% 🟢) 1.263s (-3.3%) 0.284s 48 1.07x
🐘 Postgres Nitro 0.994s (+2.6%) 1.292s (+3.5%) 0.000s (+2.1%) 1.307s (+3.9%) 0.313s 47 1.08x
💻 Local Express 1.222s (~) 2.021s (~) 0.000s (-10.0% 🟢) 2.022s (~) 0.801s 30 1.33x
💻 Local Next.js (Turbopack) 1.229s 2.019s 0.000s 2.022s 0.793s 30 1.34x
💻 Local Nitro 1.234s (+0.9%) 2.022s (~) 0.000s (+133.3% 🔺) 2.024s (~) 0.789s 30 1.35x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 1.837s 2.144s 0.000s 2.152s 0.316s 28 1.00x
🐘 Postgres Express 1.857s (+4.8%) 2.106s (-3.3%) 0.000s (NaN%) 2.158s (-1.8%) 0.301s 28 1.01x
🐘 Postgres Nitro 1.867s (+4.2%) 2.177s (+1.7%) 0.000s (~) 2.210s (+1.6%) 0.343s 28 1.02x
💻 Local Next.js (Turbopack) 2.973s 3.242s 0.001s 3.246s 0.273s 19 1.62x
💻 Local Nitro 2.989s (-11.8% 🟢) 3.478s (-13.8% 🟢) 0.001s (+4.2%) 3.480s (-13.8% 🟢) 0.491s 18 1.63x
💻 Local Express 3.187s (-8.1% 🟢) 3.089s (-23.4% 🟢) 0.001s (-23.6% 🟢) 3.370s (-16.5% 🟢) 0.183s 18 1.74x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

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

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 🐘 Postgres 18/21
Next.js (Turbopack) 🐘 Postgres 16/21
Nitro 🐘 Postgres 18/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

Copy link
Copy Markdown
Member

@TooTallNate TooTallNate left a comment

Choose a reason for hiding this comment

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

Two well-targeted fixes for the same underlying problem (transitive local TS deps not getting bundled). Verified each piece:

Discover plugin resolver config. The previous promisify(enhancedResolveOriginal) used the library's defaults, which don't include TS extensions. So await enhancedResolve(args.resolveDir, './helpers') would fail when the file is helpers.ts, the if (resolved) branch never fired, and importParents stayed empty for that edge. The new enhancedResolveOriginal.create({ extensions: [...], ... }) config matches the swc plugin's resolver, with the right comment explaining why ("important for parentHasChild() graph lookups"). The added symlinks: true is also subtly important for monorepo setups where local packages resolve via symlinks.

Swc plugin descendant check. The old parentHasChild(normalizedResolvedPath, normalizedEntry) check only handled "this file is an ancestor of an entry," which catches top-level wrappers but misses "this file is a transitive child of an entry" — exactly the helpers/constants case. The new inverse check fixes that with a clear comment.

Tests are well-targeted. Confirmed by reverting just the two production files on this branch and re-running the new tests — both fail without the fix:

  • discover-entries-esbuild-plugin.test.ts "tracks extensionless relative imports" fails because importParents.get(workflow).has(constants) returns false.
  • swc-esbuild-plugin.test.ts "bundles transitive local dependencies" fails because the output contains import { MSG } from "../shared/constants.ts" instead of the inlined "world".

So the tests are validating the bug, not just exercising the new code path. All 137 builder tests pass on the branch.

Discovery runs first in production. Verified base-builder.ts:244-260 runs createDiscoverEntriesPlugin in its own esbuild pass before any createSwcPlugin pass. So importParents is populated by the time the new descendant check runs.

PR description's note about broadening onResolve filter from jsTsRegex to /.*/ doesn't match the diff — that change is already on main from an earlier commit. Probably worth tightening the description, but no behavior issue.

Two issues caused local transitive dependencies to be externalized
instead of bundled in step/workflow bundles:

1. The discover-entries plugin's onResolve filter only matched imports
   with explicit file extensions (jsTsRegex). Extensionless imports
   like `./helpers` were never tracked in the import graph.

2. The swc plugin only checked if a file was an ancestor of an entry
   (parentHasChild(resolved, entry)) but never checked if it was a
   descendant (parentHasChild(entry, resolved)). So even with a
   correct import graph, transitive local deps got externalized.

Fixes: configure enhanced-resolve with TS extensions, broaden the
onResolve filter to catch all relative imports, and add the reverse
parentHasChild check. Add explicit symlinks: true to the
discover-entries resolver to align with swc-esbuild-plugin's
NODE_ESM_RESOLVE_OPTIONS for monorepos with symlinked packages.

Closes #1179

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-stable Cherry-pick this PR to the stable branch when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Nuxt/Nitro dev] Workflow step bundle still externalizes transitive local TS modules (native ESM crash)

2 participants