autoWrapExpoRouterErrorBoundary is opt-in but could be the default

Offen
#6,738 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
45/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
react-native, typescript
Bereich
build-system, mobile

Rechercherichtung

Start in packages/core/src/js/tools/metroconfig.ts and trace autoWrapExpoRouterErrorBoundary through withSentryConfig and getSentryExpoConfig. Validate the Babel rewrite against the supported Expo Router versions and route layouts, including aliased exports and existing imports. Done means a decided default for the next major version, with an escape hatch if needed, plus coverage for the validated structures.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Breaking Change Next Major React-Native

autoWrapExpoRouterErrorBoundary (in withSentryConfig/getSentryExpoConfig, packages/core/src/js/tools/metroconfig.ts) auto-wraps Expo Router's per-route ErrorBoundary re-exports with Sentry.wrapExpoRouterErrorBoundary at build time, so render-phase errors that hit the fallback get captured without the user touching their route files.

It currently defaults to false (getsentry/sentry-react-native#6347), so Expo Router users only get this error capture if they know the option exists and opt in explicitly:

module.exports = getSentryExpoConfig(__dirname, {
  autoWrapExpoRouterErrorBoundary: true,
});

Since the whole point is capturing errors users wouldn't otherwise think to instrument, most Expo Router apps are silently missing this coverage. Worth considering flipping the default to true in the next major version.

Needs scoping before landing:

  • Confirm the babel rewrite (detecting export { ErrorBoundary } from 'expo-router' and aliased variants) is safe to apply unconditionally across the range of Expo Router versions/route layouts we support - it already skips files that already import wrapExpoRouterErrorBoundary, but should be validated against a wider set of real app structures.
  • Decide whether this should ship default-on directly in 9.0, or default-on with an escape hatch (autoWrapExpoRouterErrorBoundary: false) for a deprecation cycle.
Vorherrschende Sprache
TypeScript
Sterne
1.8k
Forks
371
Ø Merge
22 Std. 3 Min.
Gemergte PRs (30 T.)
106

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus getsentry/sentry-react-native

Alle Issues in getsentry/sentry-react-native

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.