Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

snitin315
Copy link
Member

@snitin315 snitin315 commented May 3, 2022

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

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

]
}
}
},
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member Author

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.

if (typeof watchOptions.poll !== "undefined") {
return Boolean(watchOptions.poll);
}
if (typeof compilerWatchOptions.poll !== "undefined") {
return Boolean(compilerWatchOptions.poll);
}

// 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

Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member

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

@codecov
Copy link

codecov bot commented May 3, 2022

Codecov Report

Merging #4424 (c2fee3b) into master (c2fee3b) will not change coverage.
The diff coverage is n/a.

❗ Current head c2fee3b differs from pull request most recent head ae2312b. Consider uploading reports for the commit ae2312b to get more accurate results

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c2fee3b...ae2312b. Read the comment docs.

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.

webpack-dev-server goes into infinite compile loop after making the smallest change to the source code
2 participants