-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(angular): call showReportDialog
in root context
#11703
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
Conversation
e3c1594
to
34a62e3
Compare
packages/angular/.eslintrc.cjs
Outdated
@@ -3,5 +3,8 @@ module.exports = { | |||
browser: true, | |||
}, | |||
extends: ['../../.eslintrc.js'], | |||
rules: { | |||
'@sentry-internal/sdk/no-optional-chaining': 'off', |
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.
we do not want to turn this off - see https://blog.sentry.io/performance-impact-of-generated-javascript/#removing-optional-chaining
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.
I removed it.
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.
Hey, thanks for opening this PR! In addition to Abhi's comment, I had another question. But thanks for improving the documentation around this file - this already makes it a lot clearer!
packages/angular/src/zone.ts
Outdated
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
const isNgZoneEnabled = typeof Zone !== 'undefined' && !!Zone.current; | ||
const isNgZoneEnabled = typeof Zone !== 'undefined' && !!Zone.root?.run; |
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.
!!Zone.root?.run
is this function also available in older Angular versions? We need to stay compatible with Angular 14+
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.
Yes, it does.
34a62e3
to
ac3ab8b
Compare
This commit calls `showReportDialog` outside of the Angular context to prevent unnecessary view updates when asynchronous tasks are set up within the `showReportDialog` function.
ac3ab8b
to
b05462a
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.
Thank you!
This commit calls
showReportDialog
outside of the Angular context to preventunnecessary view updates when asynchronous tasks are set up within the
showReportDialog
function.