ignite
ignite copied to clipboard
Boilerplate Enhancement: Crash Reporting
Crash reporting is one of the first things we add to new Ignite projects. It would be great to have a defined place to add this.
My current idea is to add a crash-reporting.ts
file to the boilerplate with some comments:
/**
* This is where you put your crash reporting service initialization code.
* If you're using Crashlytics: <link to Crashlytics docs>
* If you're using Sentry: <link to Sentry docs>
* If you're using Bugsnag: <link to Bugsnag docs>
*/
We could potentially add a generic interface that works with all three of those systems, so it's easier to swap them in and out:
export function reportCrash(error) {
// Sentry.captureException(error)
// crashlytics().recordError(error)
// Bugsnag.notify(error)
}
Open to additional feedback on this. I would recommend putting this file in app/config/crash-reporting.ts
It's a common task to also want to instruction react-navigation to be able to track page navigation. We might want to also consider adding a generic placeholder function for things like that if that's compatible with all these options.
Implemented in #1996
Will be included in Ignite v8: Maverick #1987