Update Vue and Nuxt component tracking docs: Options API requirement and stale defaults

未关闭
#19,290 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@s1gr1d 已经在做这个了。

开始于 2026年9月7日。

评估

这个 Issue 还没有评估数据。

描述

Docs Platform: JavaScript SDKs
SDK

JavaScript SDK

Description

Follow-up to getsentry/sentry-javascript#23375.

Nuxt 5 disables Vue's Options API by default
(nuxt/nuxt#35791), which turns app.mixin() into a silent no-op. The SDK records the default
spans through an app.mount() wrap instead; component tracking (trackComponents) still needs
the Options API.

Affected pages:

What to document

  • Component tracking needs the Options API. trackComponents (and non-default hooks)
    only work through app.mixin(). The SDK logs a console warning when the mixin is unavailable.
  • Nuxt 5 callout. The Options API is off by default there; component spans need
    vue: { optionsApi: true } in nuxt.config.ts. Plain Vue users control it through the
    __VUE_OPTIONS_API__ define in their bundler.
  • Default spans work without the Options API. Application Render and the root
    Vue <Root> mount span are always recorded. On Nuxt without the Options API, the root render
    span extends until the page's <Suspense> boundary resolves.
  • Fix the default hook set. Both pages say ['activate', 'mount', 'update']; the SDK
    default is ['activate', 'mount'] (packages/vue/src/constants.ts).
  • Fix the span op. The Vue page says ui.vue.render; the SDK emits op ui.render with
    origin auto.ui.vue.
  • Fix the timeout wording. "Waits for the last component to render" is wrong: debounce
    timers are per component, so late mounts (async components, lazy routes, <Suspense>) do not
    extend the span. It ends with the initial synchronous render.
  • Root component is always tracked. hooks apply to the root even with
    trackComponents: false, e.g. hooks: ['update'] alone produces a Vue <Root> ui.update
    span. Undocumented on both pages.

References

  • packages/vue/src/tracing.ts, packages/vue/src/constants.ts
  • packages/vue/test/integration/mixinRegistration.test.ts (root tracking, hook behavior, late
    children not extending the span)
  • dev-packages/e2e-tests/test-applications/vue-3/tests/performance.test.ts (delayed async
    component, both variants)
Suggested Solution

No response

主要语言
MDX
星标
451
派生
1.7k
平均合并
1 天 10 小时
30 天内合并 PR
566

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

getsentry/sentry-docs 的其他 Issue

查看 getsentry/sentry-docs 的全部 Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。