Skip to content

feat!: support ignored path filtering - #122

Merged
shulaoda merged 5 commits into
mainfrom
09-21-feat_support_ignored_path_filtering
Sep 29, 2026
Merged

shulaoda merged 5 commits into
mainfrom
09-21-feat_support_ignored_path_filtering

Conversation

@shulaoda

@shulaoda shulaoda commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

This is a reworked version of #114.

Why

A watcher cannot skip paths. Watching a project also watches node_modules and .git, which costs many watch resources and reports events nobody needs. chokidar solves this with ignored.

Changes

Adds Config::with_ignored(|path, kind| ...). An ignored path is treated as if it did not exist:

  • It is never watched, scanned or reported. watch() and unwatch() of it return Ok(()) and do nothing.
  • inotify, kqueue and poll do not descend into ignored directories. FSEvents and Windows watch recursively in the kernel, so they drop the events of ignored paths instead.
  • The filter is asked once per path, never about its parents. To ignore a directory with everything inside it, it must return true for every path below it.
  • kind is Dir, File, or Unknown when the watcher cannot tell (a missing path, every event on Windows).
  • notify-debouncer-full gives the filter to its FileIdCache and does not add an ignored path as a root.
  • FSEvents restarts its stream only when a watch was really added or removed, because a restart drops events.

Breaking change

Config (and debouncer-mini's Config) no longer derive Copy, PartialEq, Eq and Hash, because the filter is an Arc<dyn Fn>.

@shulaoda shulaoda changed the title feat: support ignored path filtering feat!: support ignored path filtering Sep 28, 2026
@shulaoda
shulaoda marked this pull request as ready for review September 28, 2026 04:25
@h-a-n-a

h-a-n-a commented Sep 29, 2026

Copy link
Copy Markdown
Member

I just checked the test cases.

@shulaoda
shulaoda merged commit 8a366d6 into main Sep 29, 2026
12 checks passed
@shulaoda
shulaoda deleted the 09-21-feat_support_ignored_path_filtering branch September 29, 2026 07:33
@rolldown-guard rolldown-guard Bot mentioned this pull request Sep 29, 2026
shulaoda pushed a commit that referenced this pull request Sep 29, 2026
## 🤖 New release

* `rolldown-notify-types`: 2.0.2 -> 2.0.3 (✓ API compatible changes)
* `rolldown-notify`: 10.5.1 -> 11.0.0 (✓ API compatible changes)
* `rolldown-notify-debouncer-mini`: 0.8.10 -> 0.9.0 (✓ API compatible
changes)
* `rolldown-file-id`: 0.2.10 -> 0.2.11 (✓ API compatible changes)
* `rolldown-notify-debouncer-full`: 0.7.11 -> 0.8.0 (✓ API compatible
changes)

<details><summary><i><b>Changelog</b></i></summary><p>

## `rolldown-notify-types`

<blockquote>

##
[2.0.3](rolldown-notify-types-v2.0.2...rolldown-notify-types-v2.0.3)
- 2026-09-29

### Other

- update Cargo.toml dependencies
</blockquote>

## `rolldown-notify`

<blockquote>

##
[11.0.0](rolldown-notify-v10.5.1...rolldown-notify-v11.0.0)
- 2026-09-29

### Added

- [**breaking**] support ignored path filtering
([#122](#122))
</blockquote>

## `rolldown-notify-debouncer-mini`

<blockquote>

##
[0.9.0](rolldown-notify-debouncer-mini-v0.8.10...rolldown-notify-debouncer-mini-v0.9.0)
- 2026-09-29

### Added

- [**breaking**] support ignored path filtering
([#122](#122))
</blockquote>

## `rolldown-file-id`

<blockquote>

##
[0.2.11](rolldown-file-id-v0.2.10...rolldown-file-id-v0.2.11)
- 2026-09-29

### Other

- update Cargo.lock dependencies
</blockquote>

## `rolldown-notify-debouncer-full`

<blockquote>

##
[0.8.0](rolldown-notify-debouncer-full-v0.7.11...rolldown-notify-debouncer-full-v0.8.0)
- 2026-09-29

### Added

- [**breaking**] support ignored path filtering
([#122](#122))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: rolldown-guard[bot] <278280044+rolldown-guard[bot]@users.noreply.github.com>
@sapphi-red

Copy link
Copy Markdown
Member

Can we have the following tests for each backends?

  1. trying to watch ignored directories
    • /foo/bar is ignored
    • /foo/bar/baz is added
    • expect that /foo/bar/baz is not watched
  2. correctly ignore changes in ignored directory in watched directory
    • /foo/bar is added
    • /foo/bar/baz is ignored
    • expect that /foo/bar/baz/foobar is not watched

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.

3 participants