Skip to content

Commit

Permalink
fix(types): use @sentry/minimal instead of @sentry/types (#142)
Browse files Browse the repository at this point in the history
@sentry/types was misleading, and not the right import for the types. Essential
functions like withScope were not part of the implementation. I checked the
sentry code, and found out there is indeed a little difference between client
and server, BUT only in terms of configuration. @sentry/minimal is the function
set for error logging which all implementations support. regarding error logging
they seem all identical. The difference lies in configuration objects like
BrowserOptions vs NodeOptions etc...
  • Loading branch information
simllll committed Feb 3, 2020
1 parent 074e1a6 commit de1874c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"@sentry/integrations": "^5.11.1",
"@sentry/node": "^5.11.2",
"@sentry/webpack-plugin": "^1.9.3",
"@sentry/types": "^5.11.0",
"consola": "^2.11.3",
"deepmerge": "^4.2.2"
},
Expand Down
10 changes: 5 additions & 5 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import { Client } from '@sentry/types';
import * as SentryTypes from '@sentry/minimal';

// add type to Vue context
declare module 'vue/types/vue' {
interface Vue {
readonly $sentry: Client;
readonly $sentry: typeof SentryTypes;
}
}

// App Context and NuxtAppOptions
declare module '@nuxt/types' {
interface Context {
readonly $sentry: Client;
readonly $sentry: typeof SentryTypes;
}

interface NuxtAppOptions {
readonly $sentry: Client;
readonly $sentry: typeof SentryTypes;
}
}

// add types for Vuex Store
declare module 'vuex/types' {
interface Store<S> {
readonly $sentry: Client;
readonly $sentry: typeof SentryTypes;
}
}

0 comments on commit de1874c

Please sign in to comment.