Expo Router performance auto instrumentation
Description
There is a new router for RN apps Expo Router, currently in RC.
- https://expo.github.io/router/docs/
It's built on top of react-navigation so maybe auto instrumentation will work out of the box, but we need to check that.
Maybe it works OOTB because its based on one of our integrations that we already support, likely has to be tested but in the case, offering 1st class support.
Let's start by testing if it works OOTB and later prioritize again in case it does not work.
Hi @krystofwoldrich do you have any update on this item? Dealing with this right now. Expo-router does not have a standard App.js entry point, so I'm trying to figure out if there is a workaround. Looks like I'm not alone: https://github.com/expo/sentry-expo/issues/370 Thanks
Hey @k1n8t1c thanks for flagging this - we're already in the holiday slowdown, but expect updates after the holidays!
Hey @krystofwoldrich please do update us on this issue. I'm working on an Expo project and would definitely appreciate an update on this.
My team is also implementing sentry for Expo and we hit the same roadblock. Greatly appreciate for any help on this.
Hey everyone, not sure if this is the preferred route, but in case it helps someone.
Working with expo router, I tried a couple of "hacks",
- first, I wrapped the RootLayout element in our _layout.js before export- that did not enable instrumentation
- then I followed this guide for enabling screen tracking in the expo router: https://docs.expo.dev/router/reference/screen-tracking/ combined with this guide https://docs.expo.dev/router/reference/screen-tracking/ This did the trick, at least for navigation events. Later, I might consider implementing custom instrumentation for the expo router if this issue is not resolved with expo router 3 and Expo 50.
Thank you, everyone, for the messages and for letting us know about your interest, we are currently finalizing the deprecation of the sentry-expo library (https://github.com/getsentry/sentry-react-native/issues/3262).
And following that, we will work on new features like Expo Router Automatic Instrumentation.
Todos:
- [x] Add Guide to Sentry Docs (from https://docs.expo.dev/guides/using-sentry/#usage-with-expo-router)
- [x] Enable the auto instrumentation in the Sentry Expo Sample application
Docs are at https://docs.sentry.io/platforms/react-native/performance/instrumentation/expo-router/ Sample code here https://github.com/getsentry/sentry-react-native/blob/df6100af9c83e90d455c144985fd895d704516d5/samples/expo/app/_layout.tsx#L21-L23