Skip to content

[wrangler] serialize custom build watch events to avoid concurrent runs#12704

Open
dhruv7539 wants to merge 2 commits intocloudflare:mainfrom
dhruv7539:codex/serialize-custom-build-watch-events-10944
Open

[wrangler] serialize custom build watch events to avoid concurrent runs#12704
dhruv7539 wants to merge 2 commits intocloudflare:mainfrom
dhruv7539:codex/serialize-custom-build-watch-events-10944

Conversation

@dhruv7539
Copy link

@dhruv7539 dhruv7539 commented Feb 27, 2026

Summary

  • serialize custom build watch-triggered runs in BundlerController
  • keep only the latest pending file-change build request when many events arrive in a burst
  • preserve stale-build suppression by retaining the existing abort-controller checks

Why

Fixes the behavior in #10944 where rapid multi-file changes can start multiple custom builds at once.

Testing

  • pnpm -C packages/wrangler test src/__tests__/api/startDevWorker/BundleController.test.ts
  • pnpm -C packages/wrangler exec eslint src/api/startDevWorker/BundlerController.ts src/__tests__/api/startDevWorker/BundleController.test.ts

Added regression test

  • custom build watcher changes are processed without concurrent custom builds
  • uses a lock file in a test custom-build script to fail if two builds overlap
  • updates multiple watched files in quick succession and verifies no Custom build failed events are emitted

Open with Devin

@dhruv7539 dhruv7539 requested a review from a team as a code owner February 27, 2026 18:45
@changeset-bot
Copy link

changeset-bot bot commented Feb 27, 2026

🦋 Changeset detected

Latest commit: 8ae0df1

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

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

devin-ai-integration[bot]

This comment was marked as resolved.

@dhruv7539
Copy link
Author

Addressed both actionable comments in the latest push (8ae0df1):\n- fixed wiring in custom-build path to use \n- added a Wrangler patch changeset ()

@dhruv7539
Copy link
Author

Addressed both actionable comments in the latest push (8ae0df1ef):

  • fixed jsxFragment wiring in BundlerController custom-build path to use config.build.jsxFragment
  • added a Wrangler patch changeset (.changeset/quick-keys-smell.md)

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