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

jest-haste-map: Fork watchman watcher so we can fix things #5387

Merged
merged 1 commit into from
Feb 6, 2018

Conversation

jeanlauliac
Copy link
Contributor

This is just a fork of the WatchmanWatcher as modified in amasad/sane#106. I also modified a few things (ex. use const/let) to make it pass the linter. However, no logic should have been changed by this changeset.

The reason for forking is that (1) the new fresh_instance is hard to fit into the model of sane, that wasn't designed for that possibility and (2) sane doesn't fit very well around watchman model to start with. With watchman, one is not supposed to do the file system crawling and watching operations separately. The reason for that is that files may have changed before you even start watching. Instead, "add" events are generated when you start watching, or you have to use the concept of clock specs to ensure continuity.

So overall the PR on sane was just a hack, and it will be cleaner to fork and have a unified way to use the fb-watchman package, that we do already use for the file crawling in jest-haste-map.

The follow-up on this changeset will be to react properly to fresh_instance events. The longer term follow up is to flowify/clean-up, then ensure continuity by feeding the crawling clock back into the subscription.

Test plan

Would the existing automated test ensure proper functioning of the watch?

Copy link
Member

@cpojer cpojer left a comment

Choose a reason for hiding this comment

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

This looks good, feel free to merge it. So we are only partially forking sane instead of forking everything? I am wondering what it would take to just fork the whole thing, but for now I'm totally fine with this of course. Thanks for looking into this!

@SimenB
Copy link
Member

SimenB commented Jan 24, 2018

Lots of test failures on CI

@jeanlauliac
Copy link
Contributor Author

I'll look into the failures. I couldn't run the tests locally yet because my watchman was broken, will try again.

@jeanlauliac
Copy link
Contributor Author

I'll go ahead with this and merge. We can revert if any problem pops up, but I think it should be fairly safe?

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants