Skip to content

feat(ember)!: Update to v2 addon format - #23252

Open
mydea wants to merge 6 commits into
developfrom
feat/ember-v2-format-rebased
Open

feat(ember)!: Update to v2 addon format#23252
mydea wants to merge 6 commits into
developfrom
feat/ember-v2-format-rebased

Conversation

@mydea

@mydea mydea commented Aug 11, 2026

Copy link
Copy Markdown
Member

Rebased continuation of #19229 (original author @aklkv) onto current develop, with merge conflicts resolved and the failing tests fixed.

Migrates @sentry/ember from the legacy v1 addon format to the Ember v2 addon format, so the package works with both classic Ember builds and Embroider-optimized builds and no longer depends on @embroider/macros at runtime. See #19229 for the full description of the migration.

Why a new branch

The original PR was ~1900 commits behind develop and conflicting. Rather than resolve the same conflicts twice across its two commits, I squashed them into one and rebased against the final state once.

The subtle part: the migration renamed packages/ember/addon/src/. Git therefore saw develop's later behavioral changes to those files as edits to deleted files and did not surface them as conflicts. Several develop-side changes had to be ported into the new src/ files by hand:

Build/tooling reconciliation

  • Re-added the nested typescript: ~5.8.0 devDependency pin. develop upgraded to TypeScript 7 (the native compiler, which drops typescript/lib/tsc), and glint's declaration build needs the classic JS compiler — the same stop-gap develop already applies to ember (see chore(v11): Upgrade to TypeScript 7.0 #19435). Without the pin the declaration build fails with ERR_PACKAGE_PATH_NOT_EXPORTED.
  • Bumped @sentry/browser / @sentry/core from the PR's stale 10.53.1 to 10.67.0 and added @sentry/conventions (now imported by the ported instrumentation).
  • Removed the PR's import/no-unresolved oxlint rule (doesn't exist in this repo's oxlint 1.75) and wrapped URL_FULL in filterCollectedUrl() for the sdk/no-unfiltered-url-attributes rule, which now applies since the code lives under src/**.

Test fixes

The originally-failing tests came down to three things:

  • Span-op port above — fixed the captures correct spans for navigation assertions.
  • Missing traceLifecycle: 'static' in the two new e2e apps (ember-strict-resolver, ember-vite). develop made span-streaming the default and disables it in the ember test apps (test: Disable span streaming in remaining tests #22588); the new apps predated that, so their performance tests hung waiting for transaction events that never arrived under streaming.
  • Stale assertions in ember-strict-resolver's sentry-performance.test.ts, updated from the old ui.ember.* op schema to the new router / function / ui.task ops.

All four ember e2e apps pass (ember-classic 6/6, ember-embroider 6/6, ember-strict-resolver 10/10, ember-vite 5/5), along with the ember unit tests, lint, and build.

Supersedes #19229.

Comment thread packages/ember/src/utils/instrumentEmberAppInstanceForPerformance.ts Outdated
Comment thread packages/ember/src/utils/browserTracingIntegration.ts Outdated
const globalsPerformanceConfig = {
disableRunloopPerformance: options.disableRunloopPerformance ?? false,
minimumRunloopQueueDuration: options.minimumRunloopQueueDuration,
minimumRunloopQueueDuration: options.minimumRunloopQueueDuration ?? 0,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Idle timeout default dropped

Medium Severity

The Ember integration no longer sets idleTimeout to 5000. It now inherits the browser default of 1000ms. Quiet stretches during a transition (for example a slow model hook without child spans) can finish the navigation/pageload span early, truncating Ember route timing that previously waited up to 5 seconds.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1f20412. Configure here.

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.

this seems fine

@mydea
mydea force-pushed the feat/ember-v2-format-rebased branch 3 times, most recently from 4b990e8 to 4dcd6de Compare August 11, 2026 08:53

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

There are 4 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4dcd6de. Configure here.

Comment thread packages/ember/src/utils/instrumentEmberGlobals.ts Outdated
appInstance,
}),
);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

FastBoot guard removed despite docs

Medium Severity

The v1 initializer skipped instrumentation when service:fastboot reported FastBoot, but the new instrumentAppInstancePerformance path has no equivalent check. UPGRADE.md still claims FastBoot is detected automatically, so SSR apps can run browser performance setup on the server.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4dcd6de. Configure here.

return {
[URL_PATH]: path,
[URL_FULL]: getAbsoluteUrl(fullUrl),
[URL_FULL]: filterCollectedUrl(getAbsoluteUrl(fullUrl)),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

URL filter omits in-scope client

Low Severity

Flagged because of the project review rule on unfiltered URL attributes. filterCollectedUrl() is used for url.full, but the in-scope client from instrumentEmberAppInstanceForPerformance is not passed through, so filtering can fall back to the wrong client.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 4dcd6de. Configure here.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 30.26 kB - -
@sentry/browser - with treeshaking flags 28.44 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.78 kB - -
@sentry/browser (incl. Tracing) 48.5 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.52 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.4 kB - -
@sentry/browser (incl. Tracing, Replay) 87.94 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.3 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.65 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.32 kB - -
@sentry/browser (incl. Feedback) 47.58 kB - -
@sentry/browser (incl. sendFeedback) 35.08 kB - -
@sentry/browser (incl. FeedbackAsync) 40.23 kB - -
@sentry/browser (incl. Metrics) 31.29 kB - -
@sentry/browser (incl. Logs) 31.55 kB - -
@sentry/browser (incl. Metrics & Logs) 32.24 kB - -
@sentry/react 32.06 kB - -
@sentry/react (incl. Tracing) 50.69 kB - -
@sentry/vue 35.32 kB - -
@sentry/vue (incl. Tracing) 50.45 kB - -
@sentry/svelte 30.28 kB - -
CDN Bundle 31.52 kB - -
CDN Bundle (incl. Tracing) 48.78 kB - -
CDN Bundle (incl. Logs, Metrics) 33.75 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.76 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.3 kB - -
CDN Bundle (incl. Tracing, Replay) 86.38 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.29 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.08 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.1 kB - -
CDN Bundle - uncompressed 93.59 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.5 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.06 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.36 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 228.98 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.75 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.6 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.45 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.28 kB - -
@sentry/nextjs (client) 53.24 kB - -
@sentry/sveltekit (client) 48.91 kB - -
@sentry/core/server 65.45 kB - -
@sentry/core/browser 51.79 kB - -
@sentry/node 117.89 kB -0.01% -1 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 82.05 kB -0.01% -1 B 🔽
@sentry/aws-serverless 91.42 kB - -
@sentry/cloudflare (withSentry) - minified 214.07 kB - -
@sentry/cloudflare (withSentry) 528.94 kB - -

View base workflow run

@mydea
mydea force-pushed the feat/ember-v2-format-rebased branch from 4dcd6de to 6884073 Compare August 11, 2026 09:15
Comment thread yarn.lock

"@babel/plugin-transform-runtime@7.18.10", "@babel/plugin-transform-runtime@^7.13.9":
"@babel/plugin-transform-runtime@7.18.10":

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Critical severity vulnerability may affect your project—review required:
Line 2594 lists a dependency (@babel/plugin-transform-runtime) with a known Critical severity vulnerability.

ℹ️ Why this matters

Affected versions of @babel/traverse and babel-traverse are vulnerable to Incomplete List of Disallowed Inputs / Incorrect Comparison. Compiling untrusted code with Babel using plugins that invoke the internal path.evaluate() or path.evaluateTruthy() methods (for example @babel/plugin-transform-runtime, @babel/preset-env with useBuiltIns, or any polyfill‐provider plugin) allows a maliciously crafted AST to execute arbitrary code on the build machine during compilation.

References: GHSA, CVE

To resolve this comment:
Check if you use Babel to compile untrusted JavaScript.

💬 Ignore this finding

To ignore this, reply with:

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

You can view more details on this finding in the Semgrep AppSec Platform here.

@mydea
mydea marked this pull request as ready for review August 11, 2026 09:36
@mydea
mydea requested a review from a team as a code owner August 11, 2026 09:36
@mydea
mydea requested review from chargome and s1gr1d and removed request for a team August 11, 2026 09:36
Comment on lines +134 to +140
transitionSpan = startInactiveSpan({
attributes: {
// TODO(conventions): Replace `'router'` with the `router` span op constant once it is released in `@sentry/conventions`.
[SENTRY_OP]: 'router',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.ember',
},
name: `route:${fromRoute} -> route:${toRoute}`,

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.

Bug: A transitionSpan is incorrectly created on initial page load when fromRoute is null, leading to a malformed span name and potential attribute overwrites on the pageload span.
Severity: MEDIUM

Suggested Fix

Add a conditional check to ensure transitionSpan is not created when fromRoute is null. This will restrict transition span creation to actual route-to-route navigations and prevent instrumentation interference during the initial page load.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: packages/ember/src/utils/instrumentEmberAppInstanceForPerformance.ts#L134-L140

Potential issue: During an initial page load, the `routeWillChange` event fires with a
`null` value for `fromRoute`. The code unconditionally creates a `transitionSpan` for
this event, resulting in a span with a semantically incorrect name like `"route:null ->
route:InitialRoute"`. This span is created as a child of the main pageload span
(`activeRootSpan`). When the subsequent `routeDidChange` event fires, it ends this
incorrect span and modifies attributes on the parent `activeRootSpan`, which can
overwrite important pageload data.

Did we get this right? 👍 / 👎 to inform future reviews.

Comment on lines 54 to +63
afterAllSetup(client) {
integration.afterAllSetup(client);

// Run this in the next tick to ensure the ember router etc. is properly initialized
instrumentEmberAppInstanceForPerformance(
client,
appInstance,
appInstancePerformanceConfig,
startBrowserTracingPageLoadSpan,
startBrowserTracingNavigationSpan,
);

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.

Bug: The removal of the _hasMountedSentryPerformanceRouting guard allows instrumentEmberAppInstanceForPerformance to be called multiple times, which will register duplicate router event listeners.
Severity: MEDIUM

Suggested Fix

Reintroduce a guard to prevent instrumentEmberAppInstanceForPerformance from executing more than once for the same application instance. This can be achieved by setting a flag on the appInstance or within a module-level scope after the first execution.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: packages/ember/src/utils/browserTracingIntegration.ts#L54-L63

Potential issue: The removal of the `_hasMountedSentryPerformanceRouting` guard, which
previously prevented re-instrumentation, introduces a regression. While the Sentry
integration system deduplicates integrations by name, it is still possible to call
`instrumentEmberAppInstanceForPerformance` directly multiple times for the same
application instance. This will bypass the integration-level check and attach duplicate
event listeners to the Ember router service, leading to redundant instrumentation and
potential unpredictable behavior.

Did we get this right? 👍 / 👎 to inform future reviews.

mydea and others added 6 commits August 11, 2026 13:16
Squashed from PR #19229 (getsentry/sentry-javascript).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Squashed and rebased continuation of PR #19229 (original author @aklkv) onto current develop.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mydea
mydea force-pushed the feat/ember-v2-format-rebased branch from 8a593fd to 01de976 Compare August 11, 2026 11:17
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.

1 participant