Skip to content

Commit 8a7ce86

Browse files
lucas-zimermanantoniskrystofwoldrichcoolguyzone
authored
feat(React Native) Add react native V7 migration (#13025)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR This PR adds the migration guide to React Native V7. Since a final version isn't released, I added a warning mentioning that the migration guide can change while a final release isn't made ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) --------- Co-authored-by: Antonis Lilis <[email protected]> Co-authored-by: Krystof Woldrich <[email protected]> Co-authored-by: Alex Krawiec <[email protected]>
1 parent 9d6909f commit 8a7ce86

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: Migrate from 6.x to 7.x
3+
sidebar_order: 99
4+
description: "Learn how to migrate from version 6 to version 7 of the Sentry React Native SDK"
5+
---
6+
7+
<Alert level="warning" title="Important">
8+
Version 7 is still under development, this documentation may change before the final release.
9+
</Alert>
10+
11+
The main goal of version 7 of the Sentry React Native SDK is to provide compatibility with Sentry JavaScript version 9. This update includes breaking changes due to the upgrade to JavaScript SDK v9, the removal of deprecated APIs, and a reorganization of the npm package structure.
12+
13+
## Important Changes in Dependencies
14+
15+
The Sentry React Native SDK ships with the Sentry JavaScript SDK Version 9 as a dependency. This version includes a number of behavioral changes that will not be caught by type checkers, linters, or tests, so we recommend carefully reading through the entire migration guide instead of relying on automatic tooling. Please follow [the JavaScript migration guides](/platforms/javascript/guides/react/migration/v8-to-v9/) to complete the upgrade.
16+
17+
The initial `@sentry/[email protected]` ships with `@sentry/[email protected]`. Always use the exact JavaScript SDK version if adding it manually to your project. Any other version might not be compatible with the React Native SDK.
18+
19+
Version 7 also includes a major upgrade to the Android SDK dependency, introducing behavioral changes, breaking changes, and deprecations. If you are using the Android SDK directly, please follow the [Android SDK version 8 migration guide](/platforms/android/migration/#migrating-from-iosentrysentry-7x-to-iosentrysentry-800).
20+
21+
### Major Changes in Sentry JS SDK v9
22+
23+
Other general JavaScript SDK version 9 changes are described in the [JavaScript SDK 8.x to 9.x migration guide](/platforms/javascript/guides/react/migration/v8-to-v9/).
24+
25+
### Self-Hosted Sentry Compatibility
26+
27+
Beginning with version 7.0.0, the Sentry Capacitor SDK will only support self-hosted Sentry instances version 25.2.0 and above. This change does not affect users of `sentry.io`.
28+
29+
## Important React Native SDK `7.x` Changes
30+
31+
This section describes API changes in the Sentry React Native SDK, version 7.
32+
33+
### `captureUserFeedback` is now removed
34+
35+
You can use the updated snippet in order to capture user Feedback:
36+
37+
```javascript diff
38+
+ import { captureFeedback } from '@sentry/react-native';
39+
- import { captureUserFeedback } from '@sentry/react-native';
40+
41+
+ captureUserFeedback({
42+
- captureFeedback({
43+
name: 'my name',
44+
45+
message: 'it broke',
46+
associatedEventId: 'eventID',
47+
});
48+
```
49+
50+
Additionally you can also see our new Feedback integration by checking the [User Feedback Configuration guide](../../user-feedback/configuration/)
51+
52+
### `autoSessionTracking` united with `enableAutoSessionTracking`
53+
54+
Option key `autoSessionTracking` was removed. Use `enableAutoSessionTracking` instead, enabled by default.
55+
56+
```javascript diff
57+
Sentry.init({
58+
+ enableAutoSessionTracking: true,
59+
- autoSessionTracking: true,
60+
});
61+
```
62+
63+
### `browserReplayIntegration` can be used directly without the `isWeb` check
64+
65+
The check is now done inside of the integration, simplifying workflows.
66+
67+
```javascript diff
68+
Sentry.init({
69+
+ integrations: [ Sentry.browserReplayIntegration() ],
70+
- integrations: (defaultIntegrations) => {
71+
- if (Platform.OS === 'web') {
72+
- defaultIntegrations.push(Sentry.browserReplayIntegration());
73+
- }
74+
- return defaultIntegrations;
75+
- },
76+
});
77+
```
78+
79+
### `Cold/Warm App Start` spans were renamed to `Cold/Warm Start`
80+
81+
The `App` word was removed from the span description. If you have any logic in your application or in Sentry based on this span description, please, make sure to update.
82+
83+
### Detection of Expo Go uses `ExpoGo` module
84+
85+
Starting with version 7.0.0, the Sentry React Native SDK will use the `ExpoGo` module to detect if the application is running on Expo Go. This differs from the previous behavior, where the SDK would check for the deprecated `appOwnership` property. This new approach doesn't work for Expo SDK 49 and older.
86+
The minimum supported Expo SDK version is 50, same as in Sentry React Native SDK v6.

0 commit comments

Comments
 (0)