Resolve "100% CPU for webpack-dev-server running in GDK"
What does this MR do?
- Adds a
postinstall
hook topackage.json
that will fail loudly whenfsevents
is unavailable. - Updates
fsevents
sub-dependency to a version that includes Node v10 binaries. - Changes
.nvmrc
to use latest LTS version (currently v8.11.3) rather than latest stable version
Are there points in the code the reviewer needs to double check?
You can force a failure state by checking out 9ebb6c0e (before the fix for node v10), installing node v10.5.0, and then running yarn install
. It should fail to find a precompiled binary and then fail to compile it manually, however instead of exiting with code 0, it will display a message indicating that fsevents
was not installed correctly.
Why was this MR needed?
fsevents would fail silently when an incompatible version of node was used (or if any other error occurred while installing the binary) and webpack-dev-server
, rather than failing would attempt to use manual filesystem polling to watch for changes instead, resulting in 100% CPU usage and other issues.
Screenshots (if relevant)
postinstall pass | postinstall fail |
---|---|
Does this MR meet the acceptance criteria?
- Conform by the code review guidelines
-
Has been reviewed by a Frontend maintainer -
Has been reviewed by a Backend maintainer
-
-
Conform by the style guides -
If you have multiple commits, please combine them into a few logically organized commits by squashing them
What are the relevant issue numbers?
Closes #33886 (closed)
Edited by Mike Greiling