refactor: remove ESBuildContextManager from app-event-watcher#7252
Conversation
1c759aa to
514b959
Compare
There was a problem hiding this comment.
Pull request overview
Removes the custom esbuild-context-based build path from the app dev watcher so UI extensions go through the same “standard” build pipeline (and therefore run the same build steps) as other extension types.
Changes:
- Deleted
ESBuildContextManagerand its dedicated tests. - Simplified
AppEventWatcherto always build extensions viaextension.buildForBundle(). - Updated watcher tests to no longer mock/inject the esbuild manager and to simulate errors via the standard build path.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/app/src/cli/services/dev/app-events/app-watcher-esbuild.ts | Removed the custom esbuild context manager implementation. |
| packages/app/src/cli/services/dev/app-events/app-watcher-esbuild.test.ts | Removed tests tied to the esbuild context manager behavior. |
| packages/app/src/cli/services/dev/app-events/app-event-watcher.ts | Dropped the esbuild-manager branch and unified extension builds under buildForBundle(). |
| packages/app/src/cli/services/dev/app-events/app-event-watcher.test.ts | Updated tests to match the unified build path; removed esbuild-manager mocking. |
Comments suppressed due to low confidence (5)
packages/app/src/cli/services/dev/app-events/app-event-watcher.test.ts:404
- There’s trailing whitespace on this blank line, which will likely fail formatting/linting (Prettier/no-trailing-spaces). Please remove the spaces so it’s an empty line.
if (needsAppReload) {
packages/app/src/cli/services/dev/app-events/app-event-watcher.test.ts:441
- There’s trailing whitespace on this blank line, which will likely fail formatting/linting (Prettier/no-trailing-spaces). Please remove the spaces so it’s an empty line.
// Then
packages/app/src/cli/services/dev/app-events/app-event-watcher.test.ts:478
- There’s trailing whitespace on this blank line, which will likely fail formatting/linting (Prettier/no-trailing-spaces). Please remove the spaces so it’s an empty line.
})
packages/app/src/cli/services/dev/app-events/app-event-watcher.test.ts:512
- There’s trailing whitespace on this blank line, which will likely fail formatting/linting (Prettier/no-trailing-spaces). Please remove the spaces so it’s an empty line.
})
packages/app/src/cli/services/dev/app-events/app-event-watcher.test.ts:603
- There’s trailing whitespace on this blank line, which will likely fail formatting/linting (Prettier/no-trailing-spaces). Please remove the spaces so it’s an empty line.
type: 'file_updated',
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d158b9f to
21d8851
Compare
vividviolet
left a comment
There was a problem hiding this comment.
This is working but we lose the stack trace for the error
There's also a slight difference in how the extension gets reloaded. I'm pretty sure this is a regression (not related to this PR). When there's a build error the extension isn't supposed to reloaded at all. With this PR we get a reload of the extension with the old code. On main we get a reload with a 500 because the script is missing. This PR improves this behaviour but we're not supposed update the assets at all if the build has failed.
See videos for comparison.
Before
Screen Recording 2026-04-13 at 9.57.33 PM.mov (uploaded via Graphite)
AfterScreen Recording 2026-04-13 at 9.56.20 PM.mov (uploaded via Graphite)
574cbe7 to
085b422
Compare
Co-authored-by: Claude Code <claude-code@anthropic.com>
085b422 to
178908c
Compare
|
Fixed the missing stacktrace, we should look into the extra updates in a new PR |
Merge activity
|


We originally added
ESBuildContextManageras a faster way to re-build UI extensions -> by keeping in memory esbuild contexts, re-builds are faster.This was at the expense of having a custom build pipeline in the app watcher just for ui extensions. This is now causing issues because ui-extensions are not following the standard build flow and therefore not running all "build steps".
This PR removes
ESBuildContextManagerand brings back ui-extensions to be compiled like the rest of extensions:The benefit of this manager is negligible for small extensions (we might save single digit miliseconds)