-
-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ignored fn needs to know if it is file or directory #51
Comments
@paulmillr ideas ? |
@paulmillr sorry to bother, this would allow Karma to be much more efficient. Should I send you a PR with one of the solutions ? If so, which one do you prefer ? Or do you have any better ideas ? Thanks. |
checking after does not sound like efficient solution. checking before and after sounds alright, but i will rather see the implementation because i don't get much what is this about in terms of code |
When deciding if an item should be ignored, it is helpful to know whether it is a file or a directory. Delaying the check after we have the stats information would mean unnecessary stat calls for those items that can be ignored based on the path. This is a breaking change: The `ignored` function will be called twice for each new item - once without the stats object, then again once we have the stats information. Closes paulmillr#51
@paulmillr here's the proposal |
When deciding if an item should be ignored, it is helpful to know whether it is a file or a directory. Delaying the check after we have the stats information would mean unnecessary stat calls for those items that can be ignored based on the path. If `options.ignored` is a function with two arguments, it will be called twice for each new item - once without the stats object, then again once we have the stats information. If `options.ignored` is a regular expression or a function with a single argument, it will be called once. Closes paulmillr#51
When deciding if an item should be ignored, it is helpful to know whether it is a file or a directory. Delaying the check after we have the stats information would mean unnecessary stat calls for those items that can be ignored based on the path. If `options.ignored` is a function with two arguments, it will be called twice for each new item - once without the stats object, then again once we have the stats information. If `options.ignored` is a regular expression or a function with a single argument, it will be called once. Closes paulmillr#51
Fix var scoping on proxy function (fixes paulmillr#50)
Karma allows watching glob patterns (eg.
src/**/*.js
), which is done through watching directories. Egsrc/**/*.js
will watch entiresrc/
directory.In order to be efficient, we want to ignore every file we can - that is simple,
ignored
function can just check if it matches the pattern and ignore otherwise.However, we need to NOT ignore directories, as there can be a matching file in there.
Quick suggestions:
ignored
AFTER stating the fs (which means stating even ignored files) and pass it the stat objignored
both BEFORE (as it does now) and AFTER stating; assuming the ignored fn is cheap, this could be betterThe text was updated successfully, but these errors were encountered: