feat(watch): support mixed ignored patterns#13795
Open
Perfecto23 wants to merge 1 commit intoweb-infra-dev:mainfrom
Open
feat(watch): support mixed ignored patterns#13795Perfecto23 wants to merge 1 commit intoweb-infra-dev:mainfrom
Perfecto23 wants to merge 1 commit intoweb-infra-dev:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2dca99a612
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Merging this PR will degrade performance by 4.09%
Performance Changes
Comparing |
99befcb to
b4fd17f
Compare
f2044b4 to
f8ade0c
Compare
f8ade0c to
4603b93
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extend
watchOptions.ignoredto acceptstring | RegExp | (string | RegExp)[], so framework authors can merge user-supplied RegExp ignores with framework-appended glob ignores in a single array.This is a Rspack extension for framework composition use cases (see #10596), not webpack
watchOptions.ignoredparity.What changed
FsWatcherIgnored::Mixed(Vec<FsWatcherIgnoredItem>)variant that matches both glob paths andRspackRegexpatterns in a single pass.glob_match_pathnow walks parent directories so that patterns like**/.cachecorrectly ignore child paths (e.g./project/.cache/file.js). This applies to all glob-basedignoredvariants, not only mixed arrays.Trigger::on_eventnow checks ignored at the event entry point (viato_string_lossyfor non-UTF-8 safety), preventing ignored sub-paths from triggering rebuilds through parent directory association.NativeWatcherOptions.ignoredextended tostring | (string | RegExp)[] | RegExpwithEither4dispatch.glob-to-regexp(prebundled) and merged into oneRegExp; userRegExpinstances are tested individually withlastIndexreset to handle stateful/g/yflags.() => trueto/.*/to stay compatible with native watcher's function rejection.glob-to-regexpinrslib.browser.config.ts, consistent with the existingwatchpackalias pattern.compilerCases/watch-options-ignored.jscovering both node and native watcher paths: verifies ignored glob/regex files do not triggerinvalid/rebuild, and normal watched files still trigger rebuild.watchOptions.ignoreddocs with mixed array examples; softened glob description to "glob semantics" without referencing the internal implementation.Related links
Closes #10596
Checklist