Skip to content

Commit 8646671

Browse files
committed
feat: update to latest Sentry SDK
1 parent 41607d0 commit 8646671

File tree

16 files changed

+7341
-4960
lines changed

16 files changed

+7341
-4960
lines changed

package.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,30 @@
1717
"plugin.watch": "npm run plugin.watch.tsc & npm run plugin.watch.android & npm run plugin.watch.ios"
1818
},
1919
"devDependencies": {
20-
"@commitlint/cli": "^11.0.0",
21-
"@commitlint/config-conventional": "^11.0.0",
22-
"@nativescript/core": "7.0.13",
23-
"@nativescript/types-ios": "7.0.4",
24-
"@nativescript/types-android": "7.0.4",
25-
"@sentry/browser": "6.2.0",
26-
"@sentry/core": "6.2.0",
27-
"@sentry/hub": "6.2.0",
28-
"@sentry/integrations": "6.2.0",
29-
"@sentry/minimal": "6.2.0",
30-
"@sentry/tracing": "6.2.0",
31-
"@sentry/types": "6.2.0",
32-
"@sentry/utils": "6.2.0",
33-
"@types/node": "^14.14.31",
34-
"@typescript-eslint/eslint-plugin": "4.6.0",
35-
"@typescript-eslint/parser": "4.6.0",
36-
"eslint": "7.12.1",
37-
"husky": "^4.3.0",
38-
"lerna": "^3.22.1",
39-
"npm-watch": "^0.7.0",
40-
"prompt": "^1.0.0",
20+
"@commitlint/cli": "^16.2.1",
21+
"@commitlint/config-conventional": "^16.2.1",
22+
"@nativescript/core": "8.1.5",
23+
"@nativescript/types-ios": "8.1.1",
24+
"@nativescript/types-android": "8.1.0",
25+
"@sentry/browser": "6.12.0",
26+
"@sentry/cli": "1.72.1",
27+
"@sentry/core": "6.12.0",
28+
"@sentry/hub": "6.12.0",
29+
"@sentry/integrations": "6.12.0",
30+
"@sentry/react": "6.12.0",
31+
"@sentry/tracing": "6.12.0",
32+
"@sentry/types": "6.12.0",
33+
"@sentry/utils": "6.12.0",
34+
"@sentry/wizard": "^1.2.17",
35+
"@types/node": "^14.18.12",
36+
"@typescript-eslint/eslint-plugin": "5.12.0",
37+
"@typescript-eslint/parser": "5.12.0",
38+
"eslint": "8.9.0",
39+
"husky": "^7.0.4",
40+
"lerna": "^4.0.0",
4141
"rimraf": "^3.0.2",
4242
"stacktrace-parser": "^0.1.10",
43-
"typescript": "~3.9.7"
43+
"typescript": "~4.5.5"
4444
},
4545
"repository": {
4646
"type": "git",

plugin/package.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,17 @@
3232
"url": "https://github.com/nativescript-community/sentry"
3333
},
3434
"dependencies": {
35-
"@sentry/browser": "6.2.0",
36-
"@sentry/core": "6.2.0",
37-
"@sentry/hub": "6.2.0",
38-
"@sentry/integrations": "6.2.0",
39-
"@sentry/minimal": "6.2.0",
40-
"@sentry/tracing": "6.2.0",
41-
"@sentry/types": "6.2.0",
42-
"@sentry/utils": "6.2.0",
43-
"@sentry/wizard": "^1.1.4",
44-
"stacktrace-parser": "0.1.10"
35+
"@sentry/browser": "6.12.0",
36+
"@sentry/cli": "1.72.1",
37+
"@sentry/core": "6.12.0",
38+
"@sentry/hub": "6.12.0",
39+
"@sentry/integrations": "6.12.0",
40+
"@sentry/react": "6.12.0",
41+
"@sentry/tracing": "6.12.0",
42+
"@sentry/types": "6.12.0",
43+
"@sentry/utils": "6.12.0",
44+
"@sentry/wizard": "^1.2.17",
45+
"stacktrace-parser": "^0.1.10"
4546
},
4647
"gitHead": "1e799d9f3a3eeb19c0fc4188be82a6cded4ea727"
47-
}
48+
}

plugin/platforms/android/buildscript.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ repositories {
44
mavenCentral()
55
}
66
dependencies {
7-
classpath 'io.sentry:sentry-android-gradle-plugin:2.1.5'
7+
classpath 'io.sentry:sentry-android-gradle-plugin:3.0.0-rc.1'
88
}

plugin/platforms/android/include.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ android {
77
}
88
}
99
dependencies {
10-
def sentryVersion = project.hasProperty("sentryVersion") ? project.sentryVersion : "5.2.0"
10+
def sentryVersion = project.hasProperty("sentryVersion") ? project.sentryVersion : "5.6.1"
1111
implementation "io.sentry:sentry-android:$sentryVersion"
1212
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"uses":[
3+
"io.sentry:Sentry*",
4+
"io.sentry:Breadcrumb*",
5+
"io.sentry:SentryLevel*",
6+
"io.sentry:SentryEvent*",
7+
"io.sentry:SentryOptions*",
8+
"io.sentry:UserFeedback*",
9+
"io.sentry:RequestDetails*",
10+
"io.sentry.SentryOptions:BeforeSendCallback*",
11+
"io.sentry.protocol:User*",
12+
"io.sentry.protocol:SentryStackTrace*",
13+
"io.sentry.protocol:SentryStackFrame*",
14+
"io.sentry.protocol:SentryException*",
15+
"io.sentry.protocol:SdkVersion*",
16+
"io.sentry.protocol:SentryId*",
17+
"io.sentry.transport:AsyncHttpTransport*",
18+
"io.sentry.transport:RateLimiter*",
19+
"io.sentry.android.core:SentryAndroid*",
20+
"io.sentry:UncaughtExceptionHandlerIntegration*",
21+
"io.sentry.android.core:AnrIntegration*",
22+
"io.sentry.android.core:NdkIntegration*",
23+
"io.sentry.exception:ExceptionMechanismException*",
24+
"io.sentry:ScopeCallback*"
25+
]
26+
}

plugin/platforms/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '7.3.0'
1+
pod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '7.9.0'

src/backend.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { BrowserOptions, Transports } from '@sentry/browser';
22
import { BrowserBackend } from '@sentry/browser/dist/backend';
33
import { BaseBackend, NoopTransport } from '@sentry/core';
4-
import { Event, EventHint, Severity, Transport } from '@sentry/types';
4+
import { CaptureContext, Event, EventHint, Severity, Transport } from '@sentry/types';
55
import { SyncPromise } from '@sentry/utils';
66

77
import { NativeTransport } from './transports/native';
@@ -71,6 +71,26 @@ export interface NativescriptOptions extends BrowserOptions {
7171
enableAutoPerformanceTracking?: boolean;
7272

7373
flushSendEvent?: boolean;
74+
75+
/**
76+
* Enables Out of Memory Tracking for iOS and macCatalyst.
77+
* See the following link for more information and possible restrictions:
78+
* https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/
79+
*
80+
* @default true
81+
* */
82+
enableOutOfMemoryTracking?: boolean;
83+
84+
/**
85+
* Set data to the inital scope
86+
* @deprecated Use `Sentry.configureScope(...)`
87+
*/
88+
initialScope?: CaptureContext;
89+
90+
headers?: {[k: string]: string};
91+
92+
93+
beforeSend?(event: any, hint?);
7494
}
7595

7696
/** The Sentry Nativescript SDK Backend. */

src/integrations/sdkinfo.ts

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
1-
import { EventProcessor, Integration, Package } from "@sentry/types";
2-
import { logger } from "@sentry/utils";
1+
import { EventProcessor, Integration, Package } from '@sentry/types';
2+
import { logger } from '@sentry/utils';
33

4-
import { SDK_NAME, SDK_VERSION } from "../version";
4+
import { SDK_NAME, SDK_VERSION } from '../version';
55
import { NSSentry } from '../nssentry';
66

77
/** Default SdkInfo instrumentation */
88
export class SdkInfo implements Integration {
9-
/**
9+
/**
1010
* @inheritDoc
1111
*/
12-
public static id: string = "SdkInfo";
12+
public static id: string = 'SdkInfo';
1313

14-
/**
14+
/**
1515
* @inheritDoc
1616
*/
17-
public name: string = SdkInfo.id;
17+
public name: string = SdkInfo.id;
1818

19-
private _nativeSdkInfo: Package | null = null;
19+
private _nativeSdkInfo: Package | null = null;
2020

21-
/**
21+
/**
2222
* @inheritDoc
2323
*/
24-
public setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void {
25-
addGlobalEventProcessor(async (event) => {
26-
// The native SDK info package here is only used on iOS as `beforeSend` is not called on `captureEnvelope`.
27-
// this._nativeSdkInfo should be defined a following time so this call won't always be awaited.
28-
if (global.isIOS && this._nativeSdkInfo === null) {
29-
try {
30-
this._nativeSdkInfo = await NSSentry.fetchNativeSdkInfo();
31-
} catch (e) {
32-
// If this fails, go ahead as usual as we would rather have the event be sent with a package missing.
33-
logger.warn(
34-
"[SdkInfo] Native SDK Info retrieval failed...something could be wrong with your Sentry installation:"
35-
);
36-
logger.warn(e);
37-
}
38-
}
24+
public setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void {
25+
addGlobalEventProcessor(async (event) => {
26+
// The native SDK info package here is only used on iOS as `beforeSend` is not called on `captureEnvelope`.
27+
// this._nativeSdkInfo should be defined a following time so this call won't always be awaited.
28+
if (global.isIOS && this._nativeSdkInfo === null) {
29+
try {
30+
this._nativeSdkInfo = await NSSentry.fetchNativeSdkInfo();
31+
} catch (e) {
32+
// If this fails, go ahead as usual as we would rather have the event be sent with a package missing.
33+
logger.warn(
34+
'[SdkInfo] Native SDK Info retrieval failed...something could be wrong with your Sentry installation:'
35+
);
36+
logger.warn(e);
37+
}
38+
}
3939

40-
event.platform = event.platform || "javascript";
41-
event.sdk = {
42-
...(event.sdk ?? {}),
43-
name: SDK_NAME,
44-
packages: [
45-
...((event.sdk && event.sdk.packages) || []),
46-
...((this._nativeSdkInfo && [this._nativeSdkInfo]) || []),
47-
{
48-
name: "npm:@nativescript-community/sentry",
49-
version: SDK_VERSION,
50-
},
51-
],
52-
version: SDK_VERSION,
53-
};
40+
event.platform = event.platform || 'javascript';
41+
event.sdk = {
42+
...(event.sdk ?? {}),
43+
name: SDK_NAME,
44+
packages: [
45+
...((event.sdk && event.sdk.packages) || []),
46+
...((this._nativeSdkInfo && [this._nativeSdkInfo]) || []),
47+
{
48+
name: 'npm:@nativescript-community/sentry',
49+
version: SDK_VERSION,
50+
},
51+
],
52+
version: SDK_VERSION,
53+
};
5454

55-
return event;
56-
});
57-
}
58-
}
55+
return event;
56+
});
57+
}
58+
}

0 commit comments

Comments
 (0)