jest-haste-map: Fork watchman watcher so we can fix things#5387
jest-haste-map: Fork watchman watcher so we can fix things#5387jeanlauliac merged 1 commit intomasterfrom
Conversation
cpojer
left a comment
There was a problem hiding this comment.
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!
|
Lots of test failures on CI |
|
I'll look into the failures. I couldn't run the tests locally yet because my watchman was broken, will try again. |
911daeb to
ddda298
Compare
|
I'll go ahead with this and merge. We can revert if any problem pops up, but I think it should be fairly safe? |
|
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. |
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_instanceis hard to fit into the model ofsane, that wasn't designed for that possibility and (2)sanedoesn'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
sanewas just a hack, and it will be cleaner to fork and have a unified way to use thefb-watchmanpackage, that we do already use for the file crawling injest-haste-map.The follow-up on this changeset will be to react properly to
fresh_instanceevents. 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?