Skip to content

feat: @sentry/vue - #2953

Merged
HazAT merged 19 commits into
masterfrom
feat/sentry-vue
Dec 1, 2020
Merged

HazAT merged 19 commits into
masterfrom
feat/sentry-vue

Conversation

@HazAT

@HazAT HazAT commented Oct 2, 2020 •

Copy link
Copy Markdown
Member

@sentry/vue SDK no support for Vue3 yet.

getsentry/sentry-docs#2689

image
image

// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import * as Sentry from '@sentry/vue'
import { Integrations } from '@sentry/tracing'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'

Vue.use(Router)

const Foo = { template: '<div>foo</div>' }
const Bar = { template: '<div>bar</div>' }

const router = new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    { path: '/foo/:id', component: Foo },
    { path: '/bar', component: Bar }
  ]
})

Vue.config.productionTip = false

Sentry.init({
  Vue: Vue,
  debug: true,
  dsn: 'https://b3910b9bca4b4bdc878871f37f93767a@o447951.ingest.sentry.io/5429219',
  attachProps: true,
  tracesSampleRate: 1,
  integrations: [
    new Integrations.BrowserTracing({
      routingInstrumentation: Sentry.vueRouterInstrumentation(router)
    })
  ],
  tracingOptions: {
    trackComponents: true
  }
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})

@Kocal Kocal mentioned this pull request Oct 31, 2020
@github-actions

github-actions Bot commented Nov 10, 2020 •

Copy link
Copy Markdown
Contributor

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 19.72 KB (+0.01% 🔺)
@sentry/browser - Webpack 20.59 KB (0%)
@sentry/react - Webpack 20.59 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 26.86 KB (+0.01% 🔺)

@HazAT
HazAT marked this pull request as ready for review November 12, 2020 14:49
@HazAT
HazAT requested a review from kamilogorek as a code owner November 12, 2020 14:49
Comment thread README.md Resolved
Comment thread packages/integrations/src/angular.ts Resolved
Comment thread packages/integrations/src/vue.ts Resolved
Comment thread packages/vue/.eslintrc.js Resolved
Comment thread packages/vue/README.md Resolved
Comment thread packages/vue/README.md Resolved
Comment thread packages/vue/README.md Resolved
Comment thread packages/vue/README.md Resolved
Comment thread packages/vue/package.json Resolved
Comment thread packages/vue/rollup.config.js Resolved
Comment thread packages/vue/src/eventprocessor.ts Resolved
Comment thread packages/vue/src/index.bundle.ts Resolved
Comment thread packages/vue/src/index.bundle.ts Resolved
Comment thread packages/vue/src/index.ts Resolved
Comment thread packages/vue/src/sdk.ts Resolved
Comment thread packages/vue/src/sdk.ts
export function init(
options: Partial<Omit<VueOptions, 'tracingOptions'> & { tracingOptions: Partial<TracingOptions> }> = {},
): void {
if (options.defaultIntegrations === undefined) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options.defaultIntegrations === true should also do this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can also be an array, we have this logic everywhere so I rather not change it just here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, then we have a bug in 4 places :(

Sentry.init({
  defaultIntegrations: true
})

should work, but it won't now. Can we fix it in this PR plz?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type of the option is defined as defaultIntegrations?: false | Integration[];
So either it has to be omitted, or false or array. It can't be set to true

Comment thread packages/vue/src/sdk.ts Resolved
Comment thread packages/vue/src/sdk.ts Resolved
Comment thread packages/vue/src/sdk.ts Resolved
Comment thread packages/vue/src/sdk.ts Resolved
Comment thread packages/vue/src/vuerouter.ts Resolved
Comment thread packages/vue/src/vuerouter.ts Resolved

@kamilogorek kamilogorek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed

HazAT and others added 3 commits November 30, 2020 20:11
Co-authored-by: Kamil Ogórek <kamil.ogorek@gmail.com>
Co-authored-by: Kamil Ogórek <kamil.ogorek@gmail.com>
@HazAT
HazAT requested a review from kamilogorek December 1, 2020 09:26
Comment thread packages/vue/src/sdk.ts Resolved
Comment thread packages/vue/src/sdk.ts Resolved
Comment thread packages/integrations/src/angular.ts Resolved
Comment thread packages/vue/src/sdk.ts Resolved
Comment thread packages/vue/src/sdk.ts Resolved
@kamilogorek
kamilogorek self-requested a review December 1, 2020 10:19
@HazAT
HazAT merged commit 4334375 into master Dec 1, 2020
@HazAT
HazAT deleted the feat/sentry-vue branch December 1, 2020 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants