-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: improve schema for watch options #4424
base: master
Are you sure you want to change the base?
Conversation
] | ||
} | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, so chokidar doesn't validate own options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexander-akait No, it doesn't.
Screen.Recording.2022-05-03.at.7.29.08.AM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I think we allow some extra options for watching, but chokidar
will only understand its API options.
webpack-dev-server/lib/Server.js
Lines 766 to 772 in c2fee3b
if (typeof watchOptions.poll !== "undefined") { | |
return Boolean(watchOptions.poll); | |
} | |
if (typeof compilerWatchOptions.poll !== "undefined") { | |
return Boolean(compilerWatchOptions.poll); | |
} |
webpack-dev-server/lib/Server.js
Line 805 in c2fee3b
// TODO: we respect these options for all watch options and allow developers to pass them to chokidar, but chokidar doesn't have these options maybe we need revisit that in future |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird, there are problem when new options will be added, in this case we will need to add them too, it is not good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, ideally chokidar should have its own validation. Maybe we can add an option in scema-utils additionalProperties: "warn"
which will warn if you use another property instead of throwing an error and exiting the process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds better, we will still needed update them when new options were added, but it happens rarely
b36b0c7
to
ae2312b
Compare
Codecov Report
@@ Coverage Diff @@
## master #4424 +/- ##
=======================================
Coverage 92.42% 92.42%
=======================================
Files 16 16
Lines 1597 1597
Branches 598 598
=======================================
Hits 1476 1476
Misses 112 112
Partials 9 9 Continue to review full report at Codecov.
|
For Bugs and Features; did you add new tests?
Yes.
Motivation / Use-Case
Resolve #4362
Screen.Recording.2022-05-03.at.7.29.34.AM.mov
Breaking Changes
No
Additional Info
No