ignite icon indicating copy to clipboard operation
ignite copied to clipboard

Boilerplate Enhancement: Crash Reporting

Open jamonholmgren opened this issue 2 years ago • 1 comments

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

jamonholmgren avatar May 16 '22 16:05 jamonholmgren

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.

lindboe avatar May 16 '22 16:05 lindboe

Implemented in #1996

Will be included in Ignite v8: Maverick #1987

frankcalise avatar Aug 14 '22 16:08 frankcalise