-
Notifications
You must be signed in to change notification settings - Fork 906
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
Allow platforms and community packages to provide additional health checks #1231
Allow platforms and community packages to provide additional health checks #1231
Conversation
Nice! Kindly asking @lucasbento @molant to review :) |
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.
Sorry for taking so long to review this, I checked this PR multiple times and I was sure that I had already submitted a review.
I don't really have much to comment here besides that this is an awesome initiative.
The thing that we would need to work on the most is the documentation, I think the API can get pretty confusing to understand without some visuals (screenshots of the list, the loading part, how errors are printed out, etc).
I would love to have this merged soon as it's a major contribution and will increase the value of react-native doctor
greatly.
```js | ||
module.exports = { | ||
healthChecks: [ | ||
{ | ||
label: 'Foo', | ||
healthchecks: [ | ||
label: 'bar-installed', | ||
getDiagnostics: async () => ({ | ||
needsToBeFixed: !isBarInstalled() | ||
}), | ||
runAutomaticFix: async ({loader}) => { | ||
await installBar(); | ||
loader.succeed(); | ||
}, | ||
} | ||
], | ||
}; | ||
``` |
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.
This is so awesome.
I added a little more documentation, but I think its probably something we can add to later. Hopefully once this merges+publishes I can add links to samples etc to at least react-native-windows where we will have a bunch of additional health checks. |
npm: AvailableInformation; | ||
Watchman: AvailableInformation; | ||
}; | ||
SDKs: { |
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.
is the idea that this is what will get asked of envinfo? if so, please make sure that info continues to report the windows properties we care about: Windows SDKs, VS installs, dev mode reg keys.
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.
Love this feautre. LGTM. Just a quick question on the type defs itself (left somewhere in the review) and this one is good to go from my side!
PS. Looks like a little rebase to resolve conflicts might be needed |
Summary:
Out of tree platforms, and specific community modules may have their own set of health checks that could help developers diagnose issues and be more productive. In particular I am looking at how to have react-native-windows provide checks to doctor. This change allows any out of tree platform to be able to provide their own checks.
Some talking points:
Test Plan:
I'm posting this early because I expect lots of feedback. I've run this locally with changes to react-native-windows to run through the end to end of adding health checks in react-native-windows and them showing up in doctor.