Skip to content

Conversation

@HazAT
Copy link
Member

@HazAT HazAT commented Oct 2, 2020

@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://[email protected]/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
Copy link
Contributor

github-actions bot commented Nov 10, 2020

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
export function init(
options: Partial<Omit<VueOptions, 'tracingOptions'> & { tracingOptions: Partial<TracingOptions> }> = {},
): void {
if (options.defaultIntegrations === undefined) {
Copy link
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
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
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
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

Copy link
Contributor

@kamilogorek kamilogorek left a comment

Choose a reason for hiding this comment

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

Reviewed

@HazAT HazAT requested a review from kamilogorek December 1, 2020 09:26
@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.

3 participants