-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(angular): Fall back to element tagName
when name is not provided to TraceDirective
#14778
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
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.
Interesting change, thanks @arturovt! Would be great to get this working but I wanna make sure it works across our supported version range. I'll give this a try in an old NG14 test app of mine but it would be great if you could add a test in our Angular 19 e2e test app: https://github.com/getsentry/sentry-javascript/tree/develop/dev-packages/e2e-tests/test-applications/angular-19
If you don't have time, let me know, then I can take over as well.
…ided The `trace` directive should typically be declared on components to validly trace the lifecycle (from `ngOnInit` to `ngAfterViewInit`, when child views are also rendered). If `trace` is mistakenly not provided, we fall back to `tagName`.
2cbed30
to
baf79c5
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.
I tested this in Angular 14 - worked perfectly! 👍
I adjusted our e2e tests to also cover the trace
without a custom name call.
Thanks for contributing! Will merge this today. Due to the holidays, expect this to be released at the beginning of January.
tagName
when trace
is not providedtagName
when trace
is not provided
tagName
when trace
is not providedtagName
when name is not provided to TraceDirective
…d to `TraceDirective` (#14778) The `trace` directive should typically be declared on components to validly trace the lifecycle (from `ngOnInit` to `ngAfterViewInit`, when child views are also rendered). If `trace` is mistakenly not provided, we fall back to `tagName` instead of "unknown component". --------- Co-authored-by: Lukas Stracke <[email protected]>
…ided to `TraceDirective` (#14828) Backport of #14778 --------- Co-authored-by: Artur <[email protected]>
The
trace
directive should typically be declared on components to validly trace the lifecycle (fromngOnInit
tongAfterViewInit
, when child views are also rendered). Iftrace
is mistakenly not provided, we fall back totagName
.