cobalt-ui
cobalt-ui copied to clipboard
Watch/dev mode doesn’t queue builds
Versions
- @terrazzo/cli: *
Node.js version
24
OS + version
macOS 15
Description
When running in watch/dev mode (tz build --watch), if updates come in too quickly, the previous build won’t have time to finish. This means plugins will be called out-of-order, or in some scenarios the output could be incorrect.
Reproduction
N/A
Expected result
To solve this, we should have a “lock” where it’s aware of whether or not a build is in progress. And while locked, incoming requests are held onto, to execute when finished. But if multiple requests come in while locked, all are discarded except for the most recent (i.e. debounced).
Extra
- [ ] I’m willing to open a PR (see CONTRIBUTING.md)