-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
What if Watchman CLI is missing... #2643
Conversation
…y into relay-compiler-no-watchman
} | ||
} catch { | ||
return resolve(false); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL about command
! ✨
How about using the exit status, though? (And made it async too, although it probably matters very little overall.)
const exec = require("util").promisify(require("child_process").exec)
undefined
> exec("command -v does-not-exist").then(() => console.log("Exists!")).catch(() => console.log("Does not exist!"))
Promise { … }
> Does not exist!
> exec("command -v ls").then(() => console.log("Exists!")).catch(() => console.log("Does not exist!"))
Promise { … }
> Exists!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that this won't work on windows. I will add something else.
Can you clarify if using watchman without The amount of faffing with ‘watch’ related options in the code is starting to confuse me a bit, so it would be nice if we could simplify that without a loss in performance. |
I'm not sure about the performance differences between watchman and fast-glob. But I think at this point, it's fine to keep it as it is. We've been working recently on the new relay compiler. It's ready, but still has a lot of dependencies on internal tools. And we still are using both versions - but I think once we complete the migration, we will replace an open source version too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alunyov has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Here is an updated version of the
GraphQLWatchmanClient.isAvailable
. (as a fix for #2617)Now, it's also checking if the
watchman
CLI is available.Test plan (Tested with
relay-examples:relay-publish-test
(relayjs/relay-examples#89)First of all, I've removed watchman from my machine.
Then,
Compiled without errors.