Conversation
53dd617 to
822ed0a
Compare
nicohrubec
left a comment
There was a problem hiding this comment.
Hey, thanks for contributing. A few notes:
- This PR is way too large. Please split it up into smaller pieces so we can review it properly.
- Is there a way to get this done without introducing breaking changes? If no, then we need to wait with this until our next major.
Hi @nicohrubec, thanks for the feedback! I understand the concern about PR size. Unfortunately, the v1 → v2 addon migration is an atomic change — you can't incrementally migrate between formats. The build pipeline, entry point structure, and package.json layout must change together for the addon to function. That said, the core SDK functionality is unchanged — the same instrumentation, error handling, and performance tracking code. The changes fall into two categories:
The actual instrumentation logic in I'm happy to:
Regarding breaking changes — the v2 format requires explicit Let me know how you'd like to proceed! |
822ed0a to
4874c99
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| const _global = GLOBAL_OBJ as typeof GLOBAL_OBJ & GlobalConfig; | ||
| _global.__sentryEmberConfig = _global.__sentryEmberConfig ?? {}; | ||
| return _global.__sentryEmberConfig; | ||
| } |
There was a problem hiding this comment.
Unused global config storage mechanism is dead code
Low Severity
The _getSentryInitConfig() function stores init configuration in a global variable (__sentryEmberConfig), but this global is never read anywhere in the codebase. In the v1 addon, the performance module used getSentryConfig() to read both environment and global config, but that function was removed during migration. The new setupPerformance() takes options directly via parameters. The _getSentryInitConfig call in init(), the GlobalConfig type, and the comment "Persist Sentry init options for reference" are all vestigial code that adds unnecessary complexity.
Additional Locations (2)
|
@aklkv thanks a lot for doing this!🙏 FWIW: While waiting for this, I realized I didn't use the performance part of the addon, and was able to just use the That also means that the 'breaking change' mentioned in the PR is a very welcome change to reduce the scope of what is delegated to the 'ember' part of the addon. Most is now just handled by the core apis, which it how it should be👍 (the link to Ember v2 addon format is broken in the pr description, btw) |
NullVoxPopuli
left a comment
There was a problem hiding this comment.
This is a good PR.
I understand the maintainer's perspective of wanting it split up tho.
The only way to do so would be rearranging the monorepo a bit to make a separate test app package.
This would mean the goal of that PR is to just delete the dummy app from the existing v1 addon.
That will still be a large pr, and i don't really see a way to get better than 2 large prs for this needed work.
Maintainers,
You mentioned breaking change timing - i suspect that is because all packages in this repo are released at once?
May i introduce you to https://github.com/release-plan/release-plan ?
It allows each package to be published independently with correct semver inference based on changes in git (and labels assessing impact on a pr) it helps a lot!
| <meta name="description" content=""> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
|
||
| <script>if(window.performance&&window.performance.mark){window.performance.mark('@sentry/ember:initial-load-start');}</script> |
There was a problem hiding this comment.
What are these additions for? Are they needed?
There was a problem hiding this comment.
Since this is an app file, did the readme get updated to reflect the situation that wants this added?
Is it required?
| } | ||
| } | ||
|
|
||
| export default instrumentRoutePerformance(WithLoadingIndexRoute); |
| const _global = GLOBAL_OBJ as typeof GLOBAL_OBJ & GlobalConfig; | ||
| _global.__sentryEmberConfig = _global.__sentryEmberConfig ?? {}; | ||
| return _global.__sentryEmberConfig; | ||
| } |
There was a problem hiding this comment.
Ah! My questions were answered here in this doc! Tyty!


Before submitting a pull request, please take a look at our
Contributing guidelines and verify:
yarn lint) & (yarn test).Summary
Migrates
@sentry/emberfrom the legacy v1 addon format to the Ember v2 addon format. This modernizes the package to work with both classic Ember builds and Embroider-optimized builds, and removes the runtime dependency on@embroider/macros.Changes
ember-clibuild pipeline withrollup(transpilation →dist/) +tsc(declarations →declarations/)addon-main.cjsusing@embroider/addon-shimas the addon entry pointember-addon.version: 2, updatedexportsmap, addedember-addon.app-jsmapping@embroider/macrosgetOwnConfig()with explicitSentry.init()calls and a newsetupPerformance()exportAPI changes:
init()is now called directly inapp.tsor an initializer (no moreENV['@sentry/ember']config)setupPerformance()must be called from an instance-initializer to opt into performance instrumentation<script>tags inindex.htmlUPGRADE.mdwith detailed migration guideTest & CI updates:
ember-classic,ember-embroider) to use v2 patterns:ENV['@sentry/ember']toSentry.init()inapp.ts<script>tags toindex.html.github/workflows/build.ymlCACHED_BUILD_PATHSfrompackages/ember/*.d.tstopackages/ember/dist+packages/ember/declarationsTypeScript fixes:
"types": ["ember-source/types"]totsconfig.publish.jsonfor Ember module resolution during declaration generation@ember/routing/-private/transition)instrumentFunctiongeneric to avoid tuple mismatch errorsBreaking Changes
ENV['@sentry/ember']config inconfig/environment.jsis no longer supported — useSentry.init()directlysetupPerformance()from an instance-initializer<script>tags inapp/index.htmlCloses #15835