Skip to content

Commit 49f1a9c

Browse files
Merge 709697c into 077a1bd
2 parents 077a1bd + 709697c commit 49f1a9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+319
-228
lines changed

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
99
## Unreleased
1010

11+
### Upgrading from 6.x to 7.0
12+
13+
Version 7 of the Sentry React Native SDK primarily introduces API cleanup and version support changes. This update contains 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.
14+
15+
Version 7 of the SDK is compatible with Sentry self-hosted versions 24.4.2 or higher (unchanged from v6). Lower versions may continue to work, but may not support all features.
16+
1117
### Dependencies
1218

1319
- Bump Bundler Plugins from v3.2.2 to v3.2.4 ([#4693](https://github.com/getsentry/sentry-react-native/pull/4693), [#4707](https://github.com/getsentry/sentry-react-native/pull/4707))
@@ -186,6 +192,9 @@ Change `Cold/Warm App Start` span description to `Cold/Warm Start` ([#4636](http
186192

187193
### Dependencies
188194

195+
- Bump JavaScript SDK from v8.54.0 to v9.1.0 ([#4568](https://github.com/getsentry/sentry-react-native/pull/4568))
196+
- [changelog](https://github.com/getsentry/sentry-javascript/blob/9.1.0/CHANGELOG.md)
197+
- [diff](https://github.com/getsentry/sentry-javascript/compare/8.54.0...9.1.0)
189198
- Bump Android SDK from v7.20.1 to v8.3.0 ([#4490](https://github.com/getsentry/sentry-react-native/pull/4490))
190199
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#830)
191200
- [diff](https://github.com/getsentry/sentry-java/compare/7.20.1...8.3.0)
@@ -199,6 +208,39 @@ Change `Cold/Warm App Start` span description to `Cold/Warm Start` ([#4636](http
199208
- [changelog](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/main/CHANGELOG.md#320)
200209
- [diff](https://github.com/getsentry/sentry-javascript-bundler-plugins/compare/3.1.2...3.2.0)
201210

211+
212+
### Major Changes
213+
214+
- `ip addresses` is only collected when `sendDefaultPii`: `true`
215+
- Exceptions from `captureConsoleIntegration` are now marked as handled: true by default
216+
- `shutdownTimeout` moved from `core` to `@sentry/react-native`
217+
- `hasTracingEnabled` was renamed to `hasSpansEnabled`
218+
- You can no longer drop spans or return null on `beforeSendSpan` hook
219+
220+
### Removed types
221+
222+
- TransactionNamingScheme
223+
- Request
224+
- Scope (prefer using the Scope class)
225+
226+
### Other removed items.
227+
228+
- `autoSessionTracking` from options.
229+
To enable session tracking, ensure that `enableAutoSessionTracking` is enabled.
230+
231+
- `enableTracing`. Instead, set `tracesSampleRate` to a value greater than `zero` to `enable tracing`, `0` to keep tracing integrations active without sampling, or `undefined` to disable the performance integration.
232+
233+
- `getCurrentHub()`, `Hub`, and `getCurrentHubShim()`
234+
- `spanId` from propagation `context`
235+
- metrics API
236+
- `transactionContext` from `samplingContext`
237+
- `@sentry/utils` package, the exports were moved to `@sentry/core`
238+
- Standalone `Client` interface & deprecate `BaseClient`
239+
240+
## Other Changes
241+
242+
- Fork `scope` if custom scope is passed to `startSpanManual` or `startSpan`
243+
202244
## 6.7.0
203245

204246
> [!WARNING]

dev-packages/e2e-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"devDependencies": {
1414
"@babel/preset-env": "^7.25.3",
1515
"@babel/preset-typescript": "^7.18.6",
16-
"@sentry/core": "8.54.0",
16+
"@sentry/core": "9.1.0",
1717
"@sentry/react-native": "6.11.0-beta.0",
1818
"@types/node": "^20.9.3",
1919
"@types/react": "^18.2.64",

dev-packages/type-check/ts3.8-test/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ declare global {
33
interface IDBObjectStore {}
44
interface Window {
55
fetch: any;
6+
setTimeout: any;
7+
document: any;
68
}
79
interface ShadowRoot {}
810
interface BufferSource {}
@@ -19,6 +21,7 @@ declare global {
1921
redirectCount: number;
2022
}
2123
interface PerformanceEntry {}
24+
interface Performance {}
2225
}
2326

2427
declare module 'react-native' {

packages/core/package.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,21 @@
6565
"react-native": ">=0.65.0"
6666
},
6767
"dependencies": {
68-
"@sentry/babel-plugin-component-annotate": "3.2.4",
69-
"@sentry/browser": "8.54.0",
68+
"@sentry/babel-plugin-component-annotate": "3.1.2",
69+
"@sentry/browser": "9.1.0",
7070
"@sentry/cli": "2.43.0",
71-
"@sentry/core": "8.54.0",
72-
"@sentry/react": "8.54.0",
73-
"@sentry/types": "8.54.0",
74-
"@sentry/utils": "8.54.0"
71+
"@sentry/core": "9.1.0",
72+
"@sentry/react": "9.1.0",
73+
"@sentry/types": "9.1.0"
7574
},
7675
"devDependencies": {
7776
"@babel/core": "^7.25.2",
7877
"@expo/metro-config": "0.19.5",
7978
"@mswjs/interceptors": "^0.25.15",
8079
"@react-native/babel-preset": "0.77.1",
81-
"@sentry-internal/eslint-config-sdk": "8.54.0",
82-
"@sentry-internal/eslint-plugin-sdk": "8.54.0",
83-
"@sentry-internal/typescript": "8.54.0",
80+
"@sentry-internal/eslint-config-sdk": "9.1.0",
81+
"@sentry-internal/eslint-plugin-sdk": "9.1.0",
82+
"@sentry-internal/typescript": "9.1.0",
8483
"@sentry/wizard": "4.6.0",
8584
"@testing-library/react-native": "^12.7.2",
8685
"@types/jest": "^29.5.13",
@@ -110,7 +109,7 @@
110109
"react-native": "0.77.1",
111110
"react-test-renderer": "^18.3.1",
112111
"rimraf": "^4.1.1",
113-
"ts-jest": "^29.1.1",
112+
"ts-jest": "^29.3.1",
114113
"typescript": "4.9.5",
115114
"uglify-js": "^3.17.4",
116115
"uuid": "^9.0.1",

packages/core/plugin/src/withSentry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface PluginProps {
1818
const withSentryPlugin: ConfigPlugin<PluginProps | void> = (config, props) => {
1919
const sentryProperties = getSentryProperties(props);
2020

21-
if (props && props.authToken) {
21+
if (props?.authToken) {
2222
// If not removed, the plugin config with the authToken will be written to the application package
2323
delete props.authToken;
2424
}

packages/core/plugin/src/withSentryAndroidGradlePlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function withSentryAndroidGradlePlugin(
3535
const withSentryProjectBuildGradle = (config: any): any => {
3636
return withProjectBuildGradle(config, (projectBuildGradle: any) => {
3737
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
38-
if (!projectBuildGradle.modResults || !projectBuildGradle.modResults.contents) {
38+
if (!projectBuildGradle.modResults?.contents) {
3939
warnOnce('android/build.gradle content is missing or undefined.');
4040
return config;
4141
}

packages/core/src/js/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export type {
22
Breadcrumb,
3-
Request,
43
SdkInfo,
54
Event,
65
Exception,
@@ -43,7 +42,6 @@ export {
4342
getClient,
4443
setCurrentClient,
4544
addEventProcessor,
46-
metricsDefault as metrics,
4745
lastEventId,
4846
} from '@sentry/core';
4947

packages/core/src/js/integrations/debugsymbolicator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function replaceExceptionFramesInException(exception: Exception, frames: SentryS
143143
* @param frames StackFrame[]
144144
*/
145145
function replaceThreadFramesInEvent(event: Event, frames: SentryStackFrame[]): void {
146-
if (event.threads && event.threads.values && event.threads.values[0] && event.threads.values[0].stacktrace) {
146+
if (event.threads?.values?.[0]?.stacktrace) {
147147
event.threads.values[0].stacktrace.frames = frames.reverse();
148148
}
149149
}

packages/core/src/js/integrations/default.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,7 @@ export function getDefaultIntegrations(options: ReactNativeClientOptions): Integ
9393
// hasTracingEnabled from `@sentry/core` only check if tracesSampler or tracesSampleRate keys are present
9494
// that's different from prev imp here and might lead misconfiguration
9595
// `tracesSampleRate: undefined` should not enable tracing
96-
const hasTracingEnabled =
97-
options.enableTracing ||
98-
typeof options.tracesSampleRate === 'number' ||
99-
typeof options.tracesSampler === 'function';
96+
const hasTracingEnabled = typeof options.tracesSampleRate === 'number' || typeof options.tracesSampler === 'function';
10097
if (hasTracingEnabled && options.enableAppStartTracking) {
10198
integrations.push(appStartIntegration());
10299
}

packages/core/src/js/integrations/nativelinkederrors.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const nativeLinkedErrorsIntegration = (options: Partial<LinkedErrorsOptio
4343
};
4444

4545
function preprocessEvent(event: Event, hint: EventHint | undefined, client: Client, limit: number, key: string): void {
46-
if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {
46+
if (!event.exception?.values || !hint || !isInstanceOf(hint.originalException, Error)) {
4747
return;
4848
}
4949

@@ -176,10 +176,10 @@ function exceptionFromAppleStackReturnAddresses(objCException: {
176176
type: objCException.name,
177177
value: objCException.message,
178178
stacktrace: {
179-
frames: (nativeStackFrames && nativeStackFrames.frames.reverse()) || [],
179+
frames: nativeStackFrames?.frames.reverse() || [],
180180
},
181181
},
182-
appleDebugImages: (nativeStackFrames && (nativeStackFrames.debugMetaImages as DebugImage[])) || [],
182+
appleDebugImages: (nativeStackFrames?.debugMetaImages as DebugImage[]) || [],
183183
};
184184
}
185185

0 commit comments

Comments
 (0)