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

🐛Force usage of chokidar 3 #298

Merged
merged 1 commit into from
Jul 28, 2020
Merged

Conversation

cowboyd
Copy link
Contributor

@cowboyd cowboyd commented Jul 27, 2020

Motivation

fixes #188

The current version of webpack that we're using has a bug that causes the tests to crashes on MacOS with some regularity. That is because it depends on chokidar 2 which uses the fsevents api which has a crictical bug on MacOS.

Approach

This manually forces all modules to use chokidar 3 which does not use the fsevents module at all. The v3 API is apparently similar enough that webpack is able to use it as a drop-in replacement for v2. Howeve, it is worth noting that because this is technically a semver violation, it will cause a console warning every time a yarn install is run.

This resolution can be removed once an upgrade is made to webpack 5 or to a different depedency bundler like parcel or rollup.

Learning

@kettanaito
Copy link
Member

Hey, @cowboyd. Thanks for preparing this.

This resolution can be removed once an upgrade is made to webpack 5 or to a different depedency bundler like parcel or rollup.

This is a fair point. The library itself is bundled via Rollup. We use webpack to bundle usage examples (which are also test scenarios) and establish a dev server that's used in tests. I suppose something similar can be done with Rollup, either with native plugins, or manually (build + Express server, for example). I wouldn't tackle it here, but it's a noteworthy point.

kettanaito
kettanaito previously approved these changes Jul 28, 2020
Motivation
----------

fixes mswjs#188

The current version of webpack that we're using has [a bug][1] that
causes the tests to crashes on MacOS with some regularity. That is
because it depends on chokidar 2 which uses the `fsevents` api which
has a [crictical bug][2] on MacOS.

Approach
--------

This manually forces all modules to use chokidar 3 which does not use
the `fsevents` module at all. While this does trigger a semver
violation because webpack 4 depends on chokidar 2, the API is
apparently similar enough that all the tests pass. It does however
give rise to a warning in the console upon installation of depedencies
via a `yarn`.

This resolution can be removed once an upgrade is made to webpack 5 or
to a different depedency bundler like [parcel][3] or [rollup][4].

Learning
--------

* [Selective dependency resolutions ][5]

[1]: webpack/webpack#10037
[2]: fsevents/fsevents#314
[3]: http://parceljs.org
[4]: https://rollupjs.org
[5]: https://classic.yarnpkg.com/en/docs/selective-version-resolutions/
Copy link
Member

@kettanaito kettanaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for these changes! Approved.
Welcome to contributors 🎉

@kettanaito kettanaito merged commit 637f5af into mswjs:master Jul 28, 2020
@cowboyd cowboyd deleted the force-chokidar-3 branch July 28, 2020 15:48
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.

Integration tests fail locally with "function uv_close"
2 participants