[builders] Fix transitive local TS dep externalization in step bundles#1609
[builders] Fix transitive local TS dep externalization in step bundles#1609VaguelySerious wants to merge 4 commits intomainfrom
Conversation
…ndles 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. Closes #1179 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 9da7dd8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
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 |
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests💻 Local Development (48 failed)express-stable (3 failed):
fastify-stable (42 failed):
hono-stable (2 failed):
nuxt-stable (1 failed):
🌍 Community Worlds (65 failed)mongodb (4 failed):
redis (3 failed):
turso (58 failed):
Details by Category✅ ▲ Vercel Production
❌ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
❌ Some E2E test jobs failed:
Check the workflow run for details. |
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express workflow with 25 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) workflow with 50 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) Promise.all with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) Promise.race with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) workflow with 10 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) workflow with 25 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) workflow with 50 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) workflow with 10 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) workflow with 25 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) workflow with 50 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) stream pipeline with 5 transform steps (1MB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) 10 parallel streams (1MB each)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express fan-out fan-in 10 streams (1MB each)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
❌ Some benchmark jobs failed:
Check the workflow run for details. |
Aligns with swc-esbuild-plugin's NODE_ESM_RESOLVE_OPTIONS to ensure both plugins resolve the same paths for parentHasChild() graph lookups, particularly in monorepo setups with symlinked packages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Made-with: Cursor
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
./helperscouldn't be resolved by Node.Root cause (two issues):
onResolvefilter only matched imports with explicit file extensions (jsTsRegex). Extensionless imports like./helperswere never tracked inimportParents, leaving the dependency graph incomplete.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:
enhanced-resolvein the discover plugin with TS extensions so extensionless imports resolve correctlyonResolvefilter fromjsTsRegexto/^[./]/(relative imports only) to track extensionless local depsparentHasChild(entry, resolved)check in the swc plugin so descendants of entries are bundledTest plan
discover-entries-esbuild-plugin.test.tsswc-esbuild-plugin.test.ts🤖 Generated with Claude Code