add debounce on file watcher for theme app extensions#7163
add debounce on file watcher for theme app extensions#7163EvilGenius13 wants to merge 1 commit intomainfrom
Conversation
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
There was a problem hiding this comment.
Pull request overview
This PR adds a debounce to the theme app extension file watcher to reduce excessive sync/reload activity when files change in rapid succession (matching the behavior already used for the main theme file watcher).
Changes:
- Debounce
add/change/unlinkchokidar events in the theme extension filesystem watcher (250ms, per file + event type). - Add Vitest coverage verifying debounced behavior (single-fire, independent files, timer reset, event-type routing).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/theme/src/cli/utilities/theme-ext-environment/theme-ext-fs.ts | Adds a per-file/per-event debounce queue before invoking update/delete handlers. |
| packages/theme/src/cli/utilities/theme-ext-environment/theme-ext-fs.test.ts | Adds unit tests to ensure watcher events are debounced as expected. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
WHY are these changes introduced?
Similar to #6791
The theme app extensions file watcher doesn't have the same debounce setup as we did for the regular theme file system.
WHAT is this pull request doing?
Brings the logic to theme app extensions as well.
How to test your changes?
app devwith a theme app extensionPost-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist