Skip to content

feat(tracing): Track wrapExpoRouterErrorBoundary adoption#6425

Merged
antonis merged 3 commits into
mainfrom
feat/track-expo-router-error-boundary-adoption
Jul 10, 2026
Merged

feat(tracing): Track wrapExpoRouterErrorBoundary adoption#6425
antonis merged 3 commits into
mainfrom
feat/track-expo-router-error-boundary-adoption

Conversation

@antonis

@antonis antonis commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Type of change

  • Bugfix
  • New feature
  • Enhancement (feature-adoption telemetry)
  • Refactoring

Description

Registers a no-op ExpoRouterErrorBoundary integration when the user calls Sentry.wrapExpoRouterErrorBoundary(...) (i.e., at module-evaluation time of the route file that uses the wrap), so the name flows through to event.sdk.integrations. Covers both manual usage and code emitted by the Babel auto-wrap plugin — both paths ultimately call wrapExpoRouterErrorBoundary and share this marker.

Motivation and Context

Part of #6415. The wrap adds route-scoped context to boundary errors, but nothing about the emitted event distinguishes "wrap installed" from "user's global handler caught it" today. Same pattern as feedback/lazy.ts and PR #6421.

The registration fires at wrap-call time rather than on the mount of the wrapped boundary, so we count "wrap installed" (not just "wrap engaged with an error"). Expo Router lazy-loads route files during navigation, so Sentry.init() has typically completed by the time the wrap runs — if not, registerFeatureMarker silently no-ops.

How did you test it?

  • New test in test/tracing/expoRouterErrorBoundary.test.tsx asserting the marker is registered synchronously at wrap-call time (before any component mount).
  • Existing boundary tests continue to pass.
  • Full local suite green.

Checklist

Base

Stacked on top of #6421. When #6421 merges, GitHub will automatically retarget this PR to main.

Refs: #6415

antonis added 2 commits July 9, 2026 08:47
Register a no-op `GlobalErrorBoundary` integration when the
component mounts so the name flows through to
`event.sdk.integrations` — the same channel used for feature-
adoption signals like `MobileFeedback` and `AppStart`.

Also introduces a shared `registerFeatureMarker` helper.
Subsequent markers for other opt-in features
(NavigationContainer, ExpoRouter error boundary, AppLoaded, ...)
will use this helper — see #6415.

Refs: #6415
Register a no-op `ExpoRouterErrorBoundary` integration when the
wrapped Expo Router error boundary mounts so the name flows
through to `event.sdk.integrations`.

Refs: #6415
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • feat(tracing): Track wrapExpoRouterErrorBoundary adoption by antonis in #6425
  • feat(core): Track GlobalErrorBoundary adoption by antonis in #6421

🤖 This preview updates automatically when you update the PR.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against e5c60fa

@antonis antonis marked this pull request as ready for review July 9, 2026 06:59
The wrapped boundary only mounts when Expo Router actually
renders it (i.e., on an error), so a `useEffect`-based marker
would undercount adoption for apps that ship the wrap but never
hit a route error. Registering at wrap-call time fires as soon
as the user's route file evaluates.

No client is present if the wrap is called before
`Sentry.init()`, but that is very rare in practice — Expo Router
lazy-loads route files during navigation, so init has typically
completed by then.

@lucas-zimerman lucas-zimerman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lucas-zimerman lucas-zimerman added the ready-to-merge Triggers the full CI test suite label Jul 9, 2026
@sentry

sentry Bot commented Jul 10, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.17.2 (97) Release

⚙️ sentry-react-native Build Distribution Settings

@github-actions

Copy link
Copy Markdown
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3853.85 ms 1232.81 ms -2621.04 ms
Size 4.98 MiB 6.53 MiB 1.55 MiB

Baseline results on branch: feat/track-global-error-boundary-adoption

Startup times

Revision Plain With Sentry Diff
5204779+dirty 3819.71 ms 1213.64 ms -2606.07 ms

App size

Revision Plain With Sentry Diff
5204779+dirty 4.98 MiB 6.53 MiB 1.55 MiB

@github-actions

Copy link
Copy Markdown
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3845.37 ms 1228.24 ms -2617.13 ms
Size 4.98 MiB 6.53 MiB 1.55 MiB

Baseline results on branch: feat/track-global-error-boundary-adoption

Startup times

Revision Plain With Sentry Diff
5204779+dirty 3842.28 ms 1219.11 ms -2623.17 ms

App size

Revision Plain With Sentry Diff
5204779+dirty 4.98 MiB 6.53 MiB 1.55 MiB

Base automatically changed from feat/track-global-error-boundary-adoption to main July 10, 2026 06:08
@antonis antonis merged commit 05047ad into main Jul 10, 2026
111 of 119 checks passed
@antonis antonis deleted the feat/track-expo-router-error-boundary-adoption branch July 10, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants