Skip to content

Commit e54b1ed

Browse files
Merge efea84f into ae2f6bc
2 parents ae2f6bc + efea84f commit e54b1ed

40 files changed

+210
-202
lines changed

packages/core/package.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,20 @@
6666
},
6767
"dependencies": {
6868
"@sentry/babel-plugin-component-annotate": "3.1.2",
69-
"@sentry/browser": "8.54.0",
69+
"@sentry/browser": "9.1.0",
7070
"@sentry/cli": "2.41.1",
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.0",
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": "3.40.0",
8584
"@testing-library/react-native": "^12.7.2",
8685
"@types/jest": "^29.5.13",
@@ -100,7 +99,7 @@
10099
"eslint-plugin-react-native": "^3.8.1",
101100
"expo": "^52.0.0",
102101
"expo-module-scripts": "3.1.0",
103-
"jest": "^29.6.2",
102+
"jest": "^29.7.0",
104103
"jest-environment-jsdom": "^29.6.2",
105104
"jest-extended": "^4.0.2",
106105
"madge": "^6.1.0",
@@ -110,7 +109,7 @@
110109
"react-native": "0.77.0",
111110
"react-test-renderer": "^18.3.1",
112111
"rimraf": "^4.1.1",
113-
"ts-jest": "^29.1.1",
112+
"ts-jest": "^29.2.5",
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
@@ -15,7 +15,7 @@ interface PluginProps {
1515
const withSentryPlugin: ConfigPlugin<PluginProps | void> = (config, props) => {
1616
const sentryProperties = getSentryProperties(props);
1717

18-
if (props && props.authToken) {
18+
if (props?.authToken) {
1919
// If not removed, the plugin config with the authToken will be written to the application package
2020
delete props.authToken;
2121
}

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
@@ -91,10 +91,7 @@ export function getDefaultIntegrations(options: ReactNativeClientOptions): Integ
9191
// hasTracingEnabled from `@sentry/core` only check if tracesSampler or tracesSampleRate keys are present
9292
// that's different from prev imp here and might lead misconfiguration
9393
// `tracesSampleRate: undefined` should not enable tracing
94-
const hasTracingEnabled =
95-
options.enableTracing ||
96-
typeof options.tracesSampleRate === 'number' ||
97-
typeof options.tracesSampler === 'function';
94+
const hasTracingEnabled = typeof options.tracesSampleRate === 'number' || typeof options.tracesSampler === 'function';
9895
if (hasTracingEnabled && options.enableAppStartTracking) {
9996
integrations.push(appStartIntegration());
10097
}

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

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function setupErrorUtilsGlobalHandler(): void {
9999
return;
100100
}
101101

102-
const defaultHandler = errorUtils.getGlobalHandler && errorUtils.getGlobalHandler();
102+
const defaultHandler = errorUtils.getGlobalHandler?.();
103103

104104
// eslint-disable-next-line @typescript-eslint/no-explicit-any
105105
errorUtils.setGlobalHandler(async (error: any, isFatal?: boolean) => {
@@ -155,7 +155,9 @@ function setupErrorUtilsGlobalHandler(): void {
155155
return;
156156
}
157157

158-
void client.flush(client.getOptions().shutdownTimeout || 2000).then(
158+
// SEE: https://github.com/getsentry/sentry-javascript/pull/15217
159+
// void client.flush(client.getOptions().shutdownTimeout || 2000).then(
160+
void client.flush(2000).then(
159161
() => {
160162
defaultHandler(error, isFatal);
161163
},

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ export const screenshotIntegration = (): Integration => {
1818
};
1919

2020
async function processEvent(event: Event, hint: EventHint, client: ReactNativeClient): Promise<Event> {
21-
const hasException = event.exception && event.exception.values && event.exception.values.length > 0;
21+
const hasException = event.exception?.values?.length > 0;
2222
if (!hasException || client.getOptions().beforeScreenshot?.(event, hint) === false) {
2323
return event;
2424
}
2525

2626
const screenshots: ScreenshotAttachment[] | null = await NATIVE.captureScreenshot();
27-
if (screenshots && screenshots.length > 0) {
27+
if (screenshots?.length > 0) {
2828
hint.attachments = [...screenshots, ...(hint?.attachments || [])];
2929
}
3030

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function getHostnameFromString(urlString: string): string | null {
103103
const regex = /^(?:\w+:)?\/\/([^/:]+)(:\d+)?(.*)$/;
104104
const matches = urlString.match(regex);
105105

106-
if (matches && matches[1]) {
106+
if (matches?.[1]) {
107107
return matches[1];
108108
} else {
109109
// Invalid URL format

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const viewHierarchyIntegration = (): Integration => {
2121
};
2222

2323
async function processEvent(event: Event, hint: EventHint): Promise<Event> {
24-
const hasException = event.exception && event.exception.values && event.exception.values.length > 0;
24+
const hasException = event.exception?.values?.length > 0;
2525
if (!hasException) {
2626
return event;
2727
}

0 commit comments

Comments
 (0)