Skip to content

fix(bundler): capture delayed compiled service spawn - #3700

Closed
kwakayama wants to merge 1 commit into
mainfrom
fix/compiled-esbuild-service-capture
Closed

fix(bundler): capture delayed compiled service spawn#3700
kwakayama wants to merge 1 commit into
mainfrom
fix/compiled-esbuild-service-capture

Conversation

@kwakayama

@kwakayama kwakayama commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • retain esbuild service interception through the first asynchronous operation in compiled Deno runtimes
  • serialize concurrent initial transforms so the global spawn hook cannot nest
  • cover concurrent initial transforms in the bundler suite

Validation

  • deno fmt --check extensions/ext-bundler-esbuild/src/esbuild-bundler.ts extensions/ext-bundler-esbuild/src/esbuild-bundler.test.ts
  • DENO_TESTING=1 VF_DISABLE_LRU_INTERVAL=1 NODE_ENV=production LOG_FORMAT=text deno test --no-check --allow-all extensions/ext-bundler-esbuild/src/esbuild-bundler.test.ts

Notes

The local compiled-binary test is blocked by the workstation Deno runtime missing complete node:util/types brand checks; CI runs the compiled-binary gate.

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability when multiple bundling operations run concurrently.
    • Prevented esbuild service initialization conflicts and ensured failures are handled cleanly.
  • Tests
    • Added coverage for concurrent bundling requests during service startup.

@github-actions

Copy link
Copy Markdown

📦 Client bundle boundary

Entrypoint Modules Source size Server leaks
src/index.client.ts 454 3062 KiB ⚠️ 39 known

A server module in a client graph aborts hydration in the browser. New leaks fail CI; known leaks are tracked in scripts/lint/client-bundle-baseline.json to burn down.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e0c32ae-b999-46b7-aa06-a0976319daca

📥 Commits

Reviewing files that changed from the base of the PR and between 5b688e8 and f25c08a.

📒 Files selected for processing (2)
  • extensions/ext-bundler-esbuild/src/esbuild-bundler.test.ts
  • extensions/ext-bundler-esbuild/src/esbuild-bundler.ts

📝 Walkthrough

Walkthrough

The bundler now coordinates concurrent esbuild service initialization through shared capture state. It restores process interception across success and failure paths. A smoke test verifies that parallel transforms complete successfully.

Changes

Concurrent esbuild initialization

Layer / File(s) Summary
Service capture coordination
extensions/ext-bundler-esbuild/src/esbuild-bundler.ts
invokeEsbuild reuses live services, waits for active capture, tracks capture completion, restores spawn, and propagates operation errors.
Concurrent transform validation
extensions/ext-bundler-esbuild/src/esbuild-bundler.test.ts
The test runs two TypeScript transforms concurrently, verifies both outputs, and stops the bundler during cleanup.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to f25c0

This PR localizes compiled-runtime service capture and concurrent transform handling in the bundler, with corresponding test coverage; no actionable merge-blocking risk remains at the current head.

Sequence Diagram(s)

sequenceDiagram
  participant TransformCall
  participant invokeEsbuild
  participant spawn
  participant EsbuildService
  TransformCall->>invokeEsbuild: request transform
  invokeEsbuild->>spawn: capture service creation
  spawn->>EsbuildService: start service
  EsbuildService-->>invokeEsbuild: provide live service
  invokeEsbuild->>EsbuildService: execute transform
  EsbuildService-->>TransformCall: return transformed output
Loading

Possibly related PRs

Suggested reviewers: kojiwakayama

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: fixing capture of delayed esbuild service spawning in the bundler.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/compiled-esbuild-service-capture

Comment @coderabbitai help to get the list of available commands.

@kwakayama

Copy link
Copy Markdown
Contributor Author

Superseded by #3698, which identified and fixed the actual compiled-runtime root cause: ESBUILD_BINARY_PATH was first read inside the project environment scope. #3700’s delayed-spawn concurrency hypothesis was refuted by #3698’s compiled-binary coverage.

@kwakayama kwakayama closed this Aug 14, 2026
@kojiwakayama
kojiwakayama deleted the fix/compiled-esbuild-service-capture branch August 30, 2026 10:27
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.

1 participant