Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .changeset/ebusy-retries.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/olive-onions-yawn.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/perf-ignored-reduceplan.md

This file was deleted.

34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# watchpack

## 2.5.2

### Patch Changes

- fix: retry `fs.lstat` on transient `EBUSY` errors instead of flagging the (by [@alexander-akait](https://github.com/alexander-akait) in [#293](https://github.com/webpack/watchpack/pull/293))
file as removed (fixes #223, #44).

On Windows it is common for anti-virus scanners, indexers or the editor
itself to briefly hold an exclusive handle on a file that has just
changed. Before this change the watcher would receive the `fs.watch`
event, call `lstat`, get back `EBUSY`, and fall through to `setMissing`
— causing a spurious `remove` event and in some cases leaving the
watcher unable to see further changes for that file until the directory
was re-scanned.

`DirectoryWatcher` now retries `lstat` up to three times (100 ms apart)
before giving up, and does not emit a remove when the only reason the
file could not be stat'd was `EBUSY`.

The retry count is controlled by the `WATCHPACK_RETRIES` environment
variable (default: `3`; set to `0` or `"false"` to disable retrying and
restore the previous behaviour).

- Improve perfomance for ignored and improve perfomance for reduce plan. (by [@alexander-akait](https://github.com/alexander-akait) in [#289](https://github.com/webpack/watchpack/pull/289))

- perf: skip the path-separator replacement when the input has no backslash (by [@alexander-akait](https://github.com/alexander-akait) in [#287](https://github.com/webpack/watchpack/pull/287))
(benchmarks measure ~35–45% less time for `ignored` matchers on POSIX paths),
fast-path single-element `ignored` arrays, and make `reducePlan`'s selection
loop walk only structurally valid candidates with an early exit when the
ideal reduction is found (measured ~20–40% faster on medium and large
plans). Adds a tinybench suite under `bench/` and a CodSpeed GitHub Actions
workflow so future regressions are caught automatically.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "watchpack",
"version": "2.5.1",
"version": "2.5.2",
"description": "",
"homepage": "https://github.com/webpack/watchpack",
"bugs": {
Expand Down