Skip to content

Commit 9aa01c1

Browse files
committed
fix: Remove sentry/vue in favor of sentry/browser and try to load deps fine granularly
Signed-off-by: Marcel Klehr <[email protected]>
1 parent d496afb commit 9aa01c1

File tree

5 files changed

+18
-40
lines changed

5 files changed

+18
-40
lines changed

package-lock.json

Lines changed: 4 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"@capacitor/status-bar": "7.x",
9393
"@isomorphic-git/lightning-fs": "4.x",
9494
"@jcoreio/async-throttle": "^1.6.1",
95-
"@sentry/vue": "10.x",
95+
"@sentry/browser": "10.x",
9696
"@sentry/webpack-plugin": "2.x",
9797
"async-lock": "^1.2.8",
9898
"async-parallel": "^1.2.3",

src/lib/Account.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Capacitor } from '@capacitor/core'
1111
import IAccount from './interfaces/Account'
1212
import Mappings from './Mappings'
1313
import { isTest } from './isTest'
14-
import * as Sentry from '@sentry/vue'
14+
import { setUser, setContext, withScope, captureException } from '@sentry/browser'
1515
import AsyncLock from 'async-lock'
1616
import CachingTreeWrapper from './CachingTreeWrapper'
1717

@@ -172,7 +172,7 @@ export default class Account {
172172
this.localCachingResource = new CachingTreeWrapper(await this.getResource())
173173

174174
Logger.log('Starting sync process for account ' + this.getLabel())
175-
Sentry.setUser({ id: this.id })
175+
setUser({ id: this.id })
176176
this.syncing = true
177177
await this.setData({ syncing: 0.05, scheduled: false, error: null })
178178

@@ -322,18 +322,18 @@ export default class Account {
322322
const message = await Account.stringifyError(e)
323323
console.error('Syncing failed with', message)
324324
Logger.log('Syncing failed with', message)
325-
Sentry.setContext('accountData', {
325+
setContext('accountData', {
326326
...this.getData(),
327327
username: 'SENSITIVEVALUEHIDDEN',
328328
password: 'SENSITIVEVALUVALUEHIDDEN',
329329
passphrase: 'SENSITIVEVALUVALUEHIDDEN'
330330
})
331-
Sentry.withScope((scope) => {
331+
withScope((scope) => {
332332
scope.setTag('adapter', this.getData().type)
333333
if (e.list) {
334-
Sentry.captureException(message)
334+
captureException(message)
335335
} else {
336-
Sentry.captureException(e)
336+
captureException(e)
337337
}
338338
})
339339

src/lib/sentry.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import packageJson from '../../package.json'
2-
import * as Sentry from '@sentry/browser'
2+
import { setTag, init } from '@sentry/browser'
33
import { Capacitor } from '@capacitor/core'
44

5-
Sentry.setTag('platform', Capacitor.getPlatform())
5+
setTag('platform', Capacitor.getPlatform())
66

77
export const dsn = 'https://836f0f772fbf2e12b9dd651b8e6b6338@o4507214911307776.ingest.de.sentry.io/4507216408870992'
88

99
export function initEmpty() {
10-
Sentry.init({
10+
init({
1111
dsn: dsn,
1212
integrations: [],
1313
sampleRate: 0,
@@ -17,7 +17,7 @@ export function initEmpty() {
1717
}
1818

1919
export function initSharp() {
20-
Sentry.init({
20+
init({
2121
dsn: dsn,
2222
integrations: [],
2323
sampleRate: 0.15,

src/ui/views/Feedback.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</template>
3333

3434
<script>
35-
import * as Sentry from '@sentry/browser'
35+
import { isInitialized, captureFeedback } from '@sentry/browser'
3636
import { initEmpty } from '../../lib/sentry'
3737
3838
export default {
@@ -61,10 +61,10 @@ export default {
6161
if (!this.submitEnabled) {
6262
return
6363
}
64-
if (!(await Sentry.isInitialized())) {
64+
if (!(await isInitialized())) {
6565
initEmpty()
6666
}
67-
Sentry.captureFeedback({
67+
captureFeedback({
6868
name: this.name,
6969
email: this.email,
7070
message: this.message,

0 commit comments

Comments
 (0)