-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
refactor(ember): Use @embroider/macros instead of runInDebug for @sentry/ember #2873
Conversation
cc @k-fish |
Thanks for the catch! Ah that's interesting that it doesn't get stripped despite the docs saying it does here: https://github.com/emberjs/ember.js/blob/29accc754fc05a80c236dfcd75abaf08c45514b7/packages/%40ember/debug/index.ts#L267, I see you've brought it up on the ember.js repo, but maybe before it's fully removed that doc can be changed? I'm going to hold off merging this in until the ember tests are re-enabled on PR's (which should be soon-ish). |
Good point, I made a PR to update the docs (emberjs/ember.js#19126). |
f22b5ba
to
68eb8af
Compare
I have updated the PR to also use @embroider/macros to test if in test environment, instead of |
packages/ember/package.json
Outdated
"@sentry/browser": "5.24.2", | ||
"@sentry/tracing": "5.24.2", | ||
"@sentry/types": "5.24.2", | ||
"@sentry/utils": "5.24.2", | ||
"@types/babel__core": "^7.1.9", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add babel__core
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm it resulted in type errors without it, but I just checked again, not anymore! But I have updated @embroider/macros a few versions in between, that probably improved somewhat there. I removed it!
This ensures that the debug code is actually stripped from production builds.
68eb8af
to
f464cac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This ensures that the debug code is actually stripped from production builds, to produce (slightly, but still) smaller production builds.
Small explanation, if you are not aware of @embroider/macros: This is a purely build-time addon that will strip "dead" code branches of conditions using
macroCondition()
.Before submitting a pull request, please take a look at our
Contributing guidelines and verify:
yarn lint
) & (yarn test
).