Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: @sentry/vue #2953

Merged
merged 19 commits into from
Dec 1, 2020
Merged

feat: @sentry/vue #2953

merged 19 commits into from
Dec 1, 2020

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://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
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
HazAT added 10 commits November 23, 2020 09:03

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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 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
@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.

None yet

2 participants