Skip to content

Commit 5dc56bc

Browse files
committed
feat: bump to latest JS/native SDKs
1 parent f0269f6 commit 5dc56bc

Some content is hidden

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

56 files changed

+13243
-8539
lines changed

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
shamefully-hoist=true
2+
strict-peer-dependencies=false
3+
loglevel=error

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Be sure to run a new build after adding plugins to avoid any issues.
1515

1616
You will need to add something like this to your webpack config so that the source maps gets uploaded. I dont set `auth` or `project` in the options as i use a `.sentryclirc` config file.
1717
* `SOURCEMAP_REL_DIR`: i almost always set it to `../../sourcemaps`
18-
* `SENTRY_PREFIX`: i almost always set it to `app:///`
18+
* `SENTRY_PREFIX`: the default is `app:///`
1919
```javascript
2020
if (!!sentry && !!uploadSentry) {
2121
config.devtool = false;
@@ -98,7 +98,6 @@ sentry_upload_dsym
9898

9999
```typescript
100100
import * as Sentry from '@nativescript-community/sentry';
101-
import { getAppId, getBuildNumber, getVersionName } from 'nativescript-extendedinfo';
102101

103102
const buildNumber = await getBuildNumber();
104103
const versionName = await getVersionName();
@@ -108,15 +107,12 @@ Sentry.init({
108107
dsn: SENTRY_DSN,
109108
debug: true,
110109
enableAutoPerformanceTracking: true,
111-
appPrefix: SENTRY_PREFIX,
112-
release: `${appId}@${versionName}+${buildNumber}`,
113-
dist: `${buildNumber}.${__ANDROID__ ? 'android' : 'ios'}`
114110
});
115111
```
116112

117113
## Reporting NativeScript errors
118114

119-
The `handleUncaughtErrors` method ensures all unhandled NativeScript errors will be caught by Sentry in production, using a [custom error handler](https://docs.nativescript.org/core-concepts/error-handling).
115+
The `onerror` method ensures all unhandled NativeScript errors will be caught by Sentry in production, using a [custom error handler](https://docs.nativescript.org/core-concepts/error-handling).
120116

121117

122118
## Reporting handled errors

demo-vue/app/App_Resources/Android/app.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
android {
22
defaultConfig {
3-
compileSdkVersion 28
3+
compileSdkVersion 31
44
multiDexEnabled true
55
minSdkVersion 18
6-
targetSdkVersion 28
7-
versionCode 102
6+
targetSdkVersion 31
7+
versionCode 104
88
versionName "2.0"
99
ndk {
1010
abiFilters.clear()

demo-vue/app/App_Resources/Android/src/main/AndroidManifest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@
2222
android:name="com.tns.NativeScriptActivity"
2323
android:label="@string/title_activity_kimera"
2424
android:configChanges="keyboardHidden|orientation|screenSize"
25-
android:theme="@style/LaunchScreenTheme">
25+
android:theme="@style/LaunchScreenTheme"
26+
android:exported="true">
2627
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
2728
<intent-filter>
2829
<action android:name="android.intent.action.MAIN" />
2930
<category android:name="android.intent.category.LAUNCHER" />
3031
</intent-filter>
3132
</activity>
32-
<activity android:name="com.tns.ErrorReportActivity"/>
33+
<activity android:name="com.tns.ErrorReportActivity" android:exported="false"/>
3334
<meta-data android:name="io.sentry.dsn" android:value="https://[email protected]/5" />
3435
</application>
3536
</manifest>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<resources>
2-
<string name="app_name">Bugsnag - Demo</string>
3-
<string name="title_activity_kimera">Bugsnag - Demo</string>
2+
<string name="app_name">Sentry Demo</string>
3+
<string name="title_activity_kimera">Sentry Demo</string>
44
</resources>

demo-vue/app/App_Resources/iOS/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<plist version="1.0">
44
<dict>
55
<key>CFBundleVersion</key>
6-
<string>103</string>
6+
<string>104</string>
77
<key>CFBundleShortVersionString</key>
88
<string>2.0</string>
99
<key>CFBundleDevelopmentRegion</key>

demo-vue/app/main.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
import * as Sentry from '@nativescript-community/sentry';
22
import { Application } from '@nativescript/core';
33
import { on as applicationOn, launchEvent } from '@nativescript/core/application';
4-
import { getAppId, getBuildNumber, getVersionName } from 'nativescript-extendedinfo';
54
import Vue from 'nativescript-vue';
65
import Home from './views/Home';
76

87

98

109
async function startSentry() {
1110
try {
12-
const versionName = await getVersionName();
13-
const buildNumber = await getBuildNumber();
14-
const appId = await getAppId();
1511
Sentry.init({
1612
dsn: SENTRY_DSN,
1713
debug: true,
18-
enableAutoPerformanceTracking: true,
19-
appPrefix: SENTRY_PREFIX,
20-
release: `${appId}@${versionName}+${buildNumber}`,
21-
dist: `${buildNumber}.${__ANDROID__ ? 'android' : 'ios'}`
14+
flushSendEvent: true,
15+
enableAutoPerformanceTracking: true
2216
});
2317
console.log('startSentry done ');
2418
setTimeout(()=>{
2519
console.log('timeout');
2620
Sentry.withScope(scope => {
2721
console.log('about to captureMessage ');
28-
scope.setTag('myTag', 'tag-value');
29-
scope.setExtra('myExtra', 'extra-value');
30-
scope.addBreadcrumb({ message: 'test' });
31-
Sentry.captureMessage('Hello Sentry!');
22+
try {
23+
24+
scope.setTag('myTag', 'tag-value');
25+
scope.setExtra('myExtra', 'extra-value');
26+
scope.addBreadcrumb({ message: 'test' });
27+
Sentry.captureMessage('Hello Sentry!');
28+
// Sentry.flush();
29+
} catch (error) {
30+
console.error(error);
31+
}
3232
});
3333
}, 1000);
3434
} catch(err){console.error(err, err.stack);}

demo-vue/app/views/Home.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default {
1515
<Button text="throwError" @tap="throwError"/>
1616
<Button text="crashTest" @tap="crashTest"/>
1717
<Button text="nativeCrashTest" @tap="nativeCrashTest"/>
18+
<Button text="flush" @tap="flush"/>
1819
</StackLayout>
1920
</Page>
2021
`,
@@ -37,6 +38,9 @@ export default {
3738
},
3839
nativeCrashTest() {
3940
TestClass.someMethod();
41+
},
42+
flush() {
43+
Sentry.flush();
4044
}
4145
}
4246
};

demo-vue/package.json

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,29 @@
44
"readme": "README.md",
55
"repository": "http://www.github.com/nativescript-community/sentry.git",
66
"dependencies": {
7-
"@nativescript-community/sentry": "../plugin",
8-
"@nativescript/core": "8.1.5",
9-
"nativescript-extendedinfo": "^1.0.11",
10-
"nativescript-vue": "2.9.0"
7+
"@nativescript-community/sentry": "link:../plugin",
8+
"@nativescript/core": "8.3.5",
9+
"nativescript-vue": "2.9.3"
1110
},
1211
"devDependencies": {
13-
"@babel/core": "~7.17.5",
14-
"@babel/preset-env": "~7.16.11",
15-
"@nativescript/android": "8.2.0-alpha.11",
16-
"@nativescript/ios": "6.5.4",
17-
"@nativescript/webpack": "~5.0.4",
18-
"@sentry/cli": "1.72.1",
19-
"@sentry/webpack-plugin": "1.18.5",
20-
"babel-loader": "~8.2.3",
12+
"@babel/core": "~7.19.3",
13+
"@babel/preset-env": "~7.19.4",
14+
"@nativescript/android": "8.3.1",
15+
"@nativescript/ios": "8.3.3",
16+
"@nativescript/webpack": "~5.0.9",
17+
"@sentry/browser": "7.15.0",
18+
"@sentry/cli": "2.7.0",
19+
"@sentry/core": "7.15.0",
20+
"@sentry/hub": "7.15.0",
21+
"@sentry/integrations": "7.15.0",
22+
"@sentry/tracing": "7.15.0",
23+
"@sentry/types": "7.15.0",
24+
"@sentry/utils": "7.15.0",
25+
"@sentry/webpack-plugin": "1.19.1",
26+
"babel-loader": "~8.2.5",
2127
"cross-var": "^1.1.0",
22-
"nativescript-vue-template-compiler": "~2.9.0",
23-
"node-sass": "^7.0.1",
28+
"nativescript-vue-template-compiler": "~2.9.3",
29+
"node-sass": "^7.0.3",
2430
"vue": "~2.6.14",
2531
"vue-loader": "~15.9.8"
2632
},

0 commit comments

Comments
 (0)