-
Notifications
You must be signed in to change notification settings - Fork 637
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Watcher backends: simplify ignore functions, remove anymatch dependen…
…cy (#1407) Summary: We currently use the [`anymatch`](https://www.npmjs.com/package/anymatch) dependency to evaluate ignore patterns in watcher backends. `anymatch` handles various input types including globs and arrays of globs/regexps However, since D67285745, it's become clear that the `ignored` param is only ever a `?RegExp`, so we hardly use any of `anymatch` and can simply `test()` paths, and remove the dependency. One subtlety to note that this change makes explicit, is that `anymatch` converts all input paths to posix separators before testing against the input `RegExp` (see block comment). We do the same in this diff so that the change is behaviour-preserving - however, this isn't a convention in Metro and should be revisited (maybe in a breaking change). Note that we don't need to handle other kinds of path normalisation (like `anymatch` does with [`normalize-path`](https://www.npmjs.com/package/normalize-path)) because watcher backends must already emit normal paths, with no trailing separators. Changelog: Internal Pull Request resolved: #1407 Reviewed By: hoxyq Differential Revision: D67259981 fbshipit-source-id: 02d22add2bd4370fbd35e0712fec05b4ab46e163
- Loading branch information
1 parent
4a52db4
commit 11c062a
Showing
3 changed files
with
39 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters