Skip to content

Restore configurability to filesystem watchers…#1572

Open
savetheclocktower wants to merge 2 commits into
masterfrom
add-new-path-watcher-impl
Open

Restore configurability to filesystem watchers…#1572
savetheclocktower wants to merge 2 commits into
masterfrom
add-new-path-watcher-impl

Conversation

@savetheclocktower
Copy link
Copy Markdown
Contributor

@savetheclocktower savetheclocktower commented May 21, 2026

…and add @parcel/watcher as an option.

This is #1299 with a cleaner commit history and a few minor changes.

The existing nsfw watcher is kept as the default, but is moved into a worker process to match the approach used by @parcel/worker.

Having the file-watcher in a separate process offers some upsides, including:

  • Not having to import a library into the renderer with a native add-on
  • Being able to use hypothetical file-watching libraries that do not explicitly support Electron, including ESM-only libraries
  • Greater control of event reporting — e.g., batching even when the watcher implementation does not support it natively

This file-watcher implementation preserves all the theoretical ability to respect core.ignoredNames, but does not actually flip it on (since that would break backward-compatibility). I could not bear to rip it out. This is the direction in which we should be moving anyway, eventually.

The upside here is that, when a user reports difficulties with file-watching, we've got a built-in second implementation that we can suggest. (”Switch core.fileSystemWatcher to the @parcel/watcher option and see if that helps.“) Eventually we envision that @parcel/watcher will be the new default, just as it is in VS Code.

…and add `@parcel/watcher` as an option.

The existing `nsfw` watcher is kept as the default, but is moved into a worker process to match the approach used by `@parcel/worker`.

Having the file-watcher in a separate process offers some upsides, including:

* Not having to import a library into the renderer with a native add-on
* Being able to use hypothetical file-watching libraries that do not explicitly support Electron, including ESM-only libraries
* Greater control of event reporting — i.e., batching even when the watcher implementation does not support it natively
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