Skip to content

Commit 960186f

Browse files
Merge branch 'main' into 5.0.0
2 parents fe95540 + 675e538 commit 960186f

Some content is hidden

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

65 files changed

+508
-266
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module.exports = {
1414
},
1515
ignorePatterns: [
1616
'test/react-native/versions/*',
17+
'coverage/**/*',
1718
],
1819
overrides: [
1920
{
@@ -58,5 +59,7 @@ module.exports = {
5859
rules: {
5960
// Bundle size isn't too much of an issue for React Native.
6061
'@sentry-internal/sdk/no-async-await': 'off',
62+
'@sentry-internal/sdk/no-optional-chaining': 'off',
63+
'@sentry-internal/sdk/no-nullish-coalescing': 'off',
6164
},
6265
};

.github/workflows/e2e.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
platform: ['ios', 'android']
3232
include:
3333
- platform: ios
34-
runtime: '16.0'
34+
runtime: 'latest'
3535
device: 'iPhone 14'
3636
steps:
3737
- uses: actions/checkout@v3
@@ -89,9 +89,8 @@ jobs:
8989
mkdir -p DerivedData
9090
defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES
9191
buildArgs=(
92-
'-destination' 'platform=iOS Simulator,name=${{ matrix.device }}'
92+
'-destination' 'platform=iOS Simulator,OS=${{ matrix.runtime }},name=${{ matrix.device }}'
9393
'ONLY_ACTIVE_ARCH=yes'
94-
'-sdk' 'iphonesimulator${{ matrix.runtime }}'
9594
'-derivedDataPath' $(cd "DerivedData" ; pwd -P)
9695
)
9796
echo "buildArgs = ${buildArgs[@]}"
@@ -242,7 +241,7 @@ jobs:
242241
build-type: ['dev', 'production']
243242
include:
244243
- platform: ios
245-
runtime: '16.0'
244+
runtime: 'latest'
246245
device: 'iPhone 14'
247246
# exclude all rn versions lower than 0.70.0 for new architecture
248247
exclude:
@@ -354,9 +353,9 @@ jobs:
354353
-workspace RnDiffApp.xcworkspace \
355354
-configuration "$CONFIG" \
356355
-scheme RnDiffApp \
357-
-destination 'platform=iOS Simulator,name=${{ matrix.device }}' \
356+
-destination 'platform=iOS Simulator,OS=${{ matrix.runtime }},name=${{ matrix.device }}' \
358357
ONLY_ACTIVE_ARCH=yes \
359-
-sdk 'iphonesimulator${{ matrix.runtime }}' \
358+
-sdk 'iphonesimulator' \
360359
-derivedDataPath "$derivedData" \
361360
build
362361

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
- Bump Android SDK from v6.11.0 to v6.12.1 ([#2755](https://github.com/getsentry/sentry-react-native/pull/2755))
1515
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#6121)
1616
- [diff](https://github.com/getsentry/sentry-java/compare/6.11.0...6.12.1)
17+
- Bump JavaScript SDK from v7.29.0 to v7.31.1 ([#2738](https://github.com/getsentry/sentry-react-native/pull/2738))
18+
- [changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md#7311)
19+
- [diff](https://github.com/getsentry/sentry-javascript/compare/7.29.0...7.31.1)
1720

1821
## 5.0.0-alpha.11
1922

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@
4242
"react-native": ">=0.65.0"
4343
},
4444
"dependencies": {
45-
"@sentry/browser": "7.29.0",
45+
"@sentry/browser": "7.31.1",
4646
"@sentry/cli": "2.10.0",
47-
"@sentry/core": "7.29.0",
48-
"@sentry/hub": "7.29.0",
49-
"@sentry/integrations": "7.29.0",
50-
"@sentry/react": "7.29.0",
51-
"@sentry/tracing": "7.29.0",
52-
"@sentry/types": "7.29.0",
53-
"@sentry/utils": "7.29.0"
47+
"@sentry/core": "7.31.1",
48+
"@sentry/hub": "7.31.1",
49+
"@sentry/integrations": "7.31.1",
50+
"@sentry/react": "7.31.1",
51+
"@sentry/tracing": "7.31.1",
52+
"@sentry/types": "7.31.1",
53+
"@sentry/utils": "7.31.1"
5454
},
5555
"devDependencies": {
56-
"@sentry-internal/eslint-config-sdk": "7.29.0",
57-
"@sentry-internal/eslint-plugin-sdk": "7.29.0",
56+
"@sentry-internal/eslint-config-sdk": "7.31.1",
57+
"@sentry-internal/eslint-plugin-sdk": "7.31.1",
5858
"@sentry/typescript": "^5.20.1",
5959
"@sentry/wizard": "2.2.0",
6060
"@types/jest": "^26.0.15",

src/js/NativeRNSentry.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { Package } from '@sentry/types';
2-
import { TurboModule, TurboModuleRegistry } from 'react-native';
1+
import type { Package } from '@sentry/types';
2+
import type { TurboModule} from 'react-native';
3+
import { TurboModuleRegistry } from 'react-native';
34
import type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
45

56
// There has to be only one interface and it has to be named `Spec`

src/js/breadcrumb.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Breadcrumb, SeverityLevel } from '@sentry/types';
1+
import type { Breadcrumb, SeverityLevel } from '@sentry/types';
22
import { severityLevelFromString } from '@sentry/utils';
33

44
export const DEFAULT_BREADCRUMB_LEVEL: SeverityLevel = 'info';

src/js/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { eventFromException, eventFromMessage } from '@sentry/browser';
22
import { BaseClient } from '@sentry/core';
3-
import {
3+
import type {
44
ClientReportEnvelope,
55
ClientReportItem,
66
Envelope,
@@ -17,7 +17,7 @@ import { Alert } from 'react-native';
1717

1818
import { Screenshot } from './integrations/screenshot';
1919
import { defaultSdkInfo } from './integrations/sdkinfo';
20-
import { ReactNativeClientOptions } from './options';
20+
import type { ReactNativeClientOptions } from './options';
2121
import { createUserFeedbackEnvelope, items } from './utils/envelope';
2222
import { ignoreRequireCycleLogs } from './utils/ignorerequirecyclelogs';
2323
import { mergeOutcomes } from './utils/outcome';

src/js/integrations/debugsymbolicator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';
2-
import { Event, EventHint, Integration, StackFrame } from '@sentry/types';
2+
import type { Event, EventHint, Integration, StackFrame } from '@sentry/types';
33
import { addContextToFrame, logger } from '@sentry/utils';
44

55
const INTERNAL_CALLSITES_REGEX = new RegExp(

src/js/integrations/devicecontext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* eslint-disable complexity */
2-
import { Event, EventProcessor, Hub, Integration } from '@sentry/types';
2+
import type { Event, EventProcessor, Hub, Integration } from '@sentry/types';
33
import { logger, severityLevelFromString } from '@sentry/utils';
44

55
import { breadcrumbFromObject } from '../breadcrumb';
6-
import { NativeDeviceContextsResponse } from '../NativeRNSentry';
6+
import type { NativeDeviceContextsResponse } from '../NativeRNSentry';
77
import { NATIVE } from '../wrapper';
88

99
/** Load device context from native. */

src/js/integrations/eventorigin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EventProcessor, Integration } from '@sentry/types';
1+
import type { EventProcessor, Integration } from '@sentry/types';
22

33
/** Default EventOrigin instrumentation */
44
export class EventOrigin implements Integration {

src/js/integrations/modulesloader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Event,EventProcessor, Integration } from '@sentry/types';
1+
import type { Event,EventProcessor, Integration } from '@sentry/types';
22
import { logger } from '@sentry/utils';
33

44
import { NATIVE } from '../wrapper';

src/js/integrations/reactnativeerrorhandlers.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { getCurrentHub } from '@sentry/core';
2-
import { EventHint, Integration, SeverityLevel } from '@sentry/types';
2+
import type { EventHint, Integration, SeverityLevel } from '@sentry/types';
33
import { addExceptionMechanism, logger } from '@sentry/utils';
44

5-
import { ReactNativeClient } from '../client';
5+
import type { ReactNativeClient } from '../client';
66
import { RN_GLOBAL_OBJ } from '../utils/worldwide';
77

88
/** ReactNativeErrorHandlers Options */
@@ -17,9 +17,6 @@ interface PromiseRejectionTrackingOptions {
1717
onHandled: (id: string) => void;
1818
}
1919

20-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
21-
declare const global: any;
22-
2320
/** ReactNativeErrorHandlers Integration */
2421
export class ReactNativeErrorHandlers implements Integration {
2522
/**

src/js/integrations/reactnativeinfo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Context, Event, EventHint, EventProcessor, Integration } from '@sentry/types';
1+
import type { Context, Event, EventHint, EventProcessor, Integration } from '@sentry/types';
22

33
import { isFabricEnabled, isHermesEnabled, isTurboModuleEnabled } from '../utils/environment';
4-
import { ReactNativeError } from './debugsymbolicator';
4+
import type { ReactNativeError } from './debugsymbolicator';
55

66
export interface ReactNativeContext extends Context {
77
js_engine?: string;

src/js/integrations/release.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';
2-
import { Event, Integration } from '@sentry/types';
2+
import type { Event, Integration } from '@sentry/types';
33

44
import { NATIVE } from '../wrapper';
55

src/js/integrations/screenshot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EventHint, Integration } from '@sentry/types';
1+
import type { EventHint, Integration } from '@sentry/types';
22
import { resolvedSyncPromise } from '@sentry/utils';
33

44
import { NATIVE } from '../wrapper';

src/js/integrations/sdkinfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EventProcessor, Integration, Package, SdkInfo as SdkInfoType } from '@sentry/types';
1+
import type { EventProcessor, Integration, Package, SdkInfo as SdkInfoType } from '@sentry/types';
22
import { logger } from '@sentry/utils';
33

44
import { SDK_NAME, SDK_PACKAGE_NAME,SDK_VERSION } from '../version';

src/js/measurements.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { getCurrentHub, getMainCarrier, Hub } from '@sentry/core';
2-
import { Transaction } from '@sentry/tracing';
3-
import { CustomSamplingContext, Span, SpanContext, TransactionContext } from '@sentry/types';
1+
import type { Hub } from '@sentry/core';
2+
import { getCurrentHub, getMainCarrier } from '@sentry/core';
3+
import type { Transaction } from '@sentry/tracing';
4+
import type { CustomSamplingContext, Span, SpanContext, TransactionContext } from '@sentry/types';
45

56
import { ReactNativeTracing } from './tracing';
67

src/js/misc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {
1+
import type {
22
EnvelopeItem,
33
Exception,
44
} from '@sentry/types';

src/js/options.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { BrowserTransportOptions } from '@sentry/browser/types/transports/types';
2-
import { ProfilerProps } from '@sentry/react/types/profiler';
3-
import { ClientOptions, Options } from '@sentry/types';
4-
import { CaptureContext } from '@sentry/types/types/scope';
1+
import type { BrowserTransportOptions } from '@sentry/browser/types/transports/types';
2+
import type { ProfilerProps } from '@sentry/react/types/profiler';
3+
import type { ClientOptions, Options } from '@sentry/types';
4+
import type { CaptureContext } from '@sentry/types/types/scope';
55

6-
import { TouchEventBoundaryProps } from './touchevents';
6+
import type { TouchEventBoundaryProps } from './touchevents';
77

88
export interface BaseReactNativeOptions {
99
/**

src/js/scope.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Scope } from '@sentry/core';
2-
import { Attachment, Breadcrumb, User } from '@sentry/types';
2+
import type { Attachment, Breadcrumb, User } from '@sentry/types';
33

44
import { DEFAULT_BREADCRUMB_LEVEL } from './breadcrumb';
55
import { NATIVE } from './wrapper';

src/js/sdk.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { getIntegrationsToSetup, Hub, initAndBind, makeMain, Scope, setExtra } from '@sentry/core';
1+
import type { Scope} from '@sentry/core';
2+
import { getIntegrationsToSetup, Hub, initAndBind, makeMain, setExtra } from '@sentry/core';
23
import { RewriteFrames } from '@sentry/integrations';
34
import {
45
defaultIntegrations as reactDefaultIntegrations,
56
defaultStackParser,
67
getCurrentHub,
78
makeFetchTransport,
89
} from '@sentry/react';
9-
import { Integration, StackFrame, UserFeedback } from '@sentry/types';
10+
import type { Integration, StackFrame, UserFeedback } from '@sentry/types';
1011
import { logger, stackParserFromStackParserOptions } from '@sentry/utils';
1112
import * as React from 'react';
1213

@@ -22,7 +23,7 @@ import {
2223
SdkInfo,
2324
} from './integrations';
2425
import { Screenshot } from './integrations/screenshot';
25-
import { ReactNativeClientOptions, ReactNativeOptions, ReactNativeWrapperOptions } from './options';
26+
import type { ReactNativeClientOptions, ReactNativeOptions, ReactNativeWrapperOptions } from './options';
2627
import { ReactNativeScope } from './scope';
2728
import { TouchEventBoundary } from './touchevents';
2829
import { ReactNativeProfiler, ReactNativeTracing } from './tracing';

src/js/touchevents.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { addBreadcrumb } from '@sentry/core';
2-
import { SeverityLevel } from '@sentry/types';
2+
import type { SeverityLevel } from '@sentry/types';
33
import { logger } from '@sentry/utils';
44
import * as React from 'react';
55
import { StyleSheet, View } from 'react-native';

src/js/tracing/nativeframes.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { Span, Transaction } from '@sentry/tracing';
2-
import { Event, EventProcessor, Measurements, MeasurementUnit } from '@sentry/types';
1+
import type { Span, Transaction } from '@sentry/tracing';
2+
import type { Event, EventProcessor, Measurements, MeasurementUnit } from '@sentry/types';
33
import { logger, timestampInSeconds } from '@sentry/utils';
44

5-
import { NativeFramesResponse } from '../NativeRNSentry';
5+
import type { NativeFramesResponse } from '../NativeRNSentry';
66
import { NATIVE } from '../wrapper';
77
import { instrumentChildSpanFinish } from './utils';
88

99
export interface FramesMeasurements extends Measurements {
10-
'frames_total': { value: number, unit: MeasurementUnit };
11-
'frames_slow': { value: number, unit: MeasurementUnit };
12-
'frames_frozen': { value: number, unit: MeasurementUnit };
10+
'frames_total': { value: number, unit: MeasurementUnit };
11+
'frames_slow': { value: number, unit: MeasurementUnit };
12+
'frames_frozen': { value: number, unit: MeasurementUnit };
1313
}
1414

1515
/**

src/js/tracing/reactnativenavigation.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import { Transaction as TransactionType, TransactionContext } from '@sentry/types';
1+
import type { Transaction as TransactionType, TransactionContext } from '@sentry/types';
22
import { logger } from '@sentry/utils';
3-
import { EmitterSubscription } from 'react-native';
3+
import type { EmitterSubscription } from 'react-native';
44

5-
import {
6-
InternalRoutingInstrumentation,
5+
import type {
76
OnConfirmRoute,
8-
TransactionCreator,
7+
TransactionCreator} from './routingInstrumentation';
8+
import {
9+
InternalRoutingInstrumentation
910
} from './routingInstrumentation';
10-
import { BeforeNavigate, RouteChangeContextData } from './types';
11+
import type { BeforeNavigate, RouteChangeContextData } from './types';
1112
import { customTransactionSource, defaultTransactionSource, getBlankTransactionContext } from './utils';
1213

1314
interface ReactNativeNavigationOptions {

src/js/tracing/reactnativetracing.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
/* eslint-disable max-lines */
2-
import { Hub } from '@sentry/core';
3-
import {
4-
defaultRequestInstrumentationOptions,
2+
import type { Hub } from '@sentry/core';
3+
import type {
54
IdleTransaction,
6-
instrumentOutgoingRequests,
75
RequestInstrumentationOptions,
8-
startIdleTransaction,
9-
Transaction,
6+
Transaction
107
} from '@sentry/tracing';
118
import {
9+
defaultRequestInstrumentationOptions,
10+
instrumentOutgoingRequests,
11+
startIdleTransaction
12+
} from '@sentry/tracing';
13+
import type {
1214
EventProcessor,
1315
Integration,
1416
Transaction as TransactionType,
1517
TransactionContext,
1618
} from '@sentry/types';
1719
import { logger } from '@sentry/utils';
1820

19-
import { NativeAppStartResponse } from '../NativeRNSentry';
20-
import { RoutingInstrumentationInstance } from '../tracing/routingInstrumentation';
21+
import type { NativeAppStartResponse } from '../NativeRNSentry';
22+
import type { RoutingInstrumentationInstance } from '../tracing/routingInstrumentation';
2123
import { NATIVE } from '../wrapper';
2224
import { NativeFramesInstrumentation } from './nativeframes';
2325
import { StallTrackingInstrumentation } from './stalltracking';
24-
import { BeforeNavigate, RouteChangeContextData } from './types';
26+
import type { BeforeNavigate, RouteChangeContextData } from './types';
2527
import {
2628
adjustTransactionDuration,
2729
getTimeOriginMilliseconds,
@@ -123,7 +125,7 @@ export class ReactNativeTracing implements Integration {
123125
* @inheritDoc
124126
*/
125127
public static id: string = 'ReactNativeTracing';
126-
/** We filter out App starts more than 60s */
128+
/** We filter out App starts more than 60s */
127129
private static _maxAppStart: number = 60000;
128130
/**
129131
* @inheritDoc
@@ -148,9 +150,9 @@ export class ReactNativeTracing implements Integration {
148150
finalTimeoutMs: options.finalTimeoutMs
149151
// eslint-disable-next-line deprecation/deprecation
150152
?? (typeof options.maxTransactionDuration === 'number'
151-
// eslint-disable-next-line deprecation/deprecation
152-
? options.maxTransactionDuration * 1000
153-
: undefined)
153+
// eslint-disable-next-line deprecation/deprecation
154+
? options.maxTransactionDuration * 1000
155+
: undefined)
154156
?? defaultReactNativeTracingOptions.finalTimeoutMs,
155157
idleTimeoutMs: options.idleTimeoutMs
156158
// eslint-disable-next-line deprecation/deprecation

0 commit comments

Comments
 (0)