feat(replay): Use data sentry element as fallback for the component name#11383
feat(replay): Use data sentry element as fallback for the component name#11383
Conversation
size-limit report 📦
|
|
We would need to index
The plugin applies a @0Calories please correct me if anything I mentioned is wrong or if I'm missing any info! |
|
@c298lee I'd recommend against sending it as @billyvg Regarding the topic of what specifically See the article here for more |
0Calories
left a comment
There was a problem hiding this comment.
LGTM! Just have one nit, but feel free to ignore it if too troublesome
|
OK, did some reading, the I took a look at what this look like on Sentry ( If we have a component
|
…ame (getsentry#11383) Adds element name as fallback. If component name exists, use that, else if element name exists use that, else use selector name. The element name and component name mirrors that of [React components vs elements](https://legacy.reactjs.org/blog/2015/12/18/react-components-elements-and-instances.html) Example with Replay Play/Pause Button: | Name Type | HTML Tree| -------------|------------| | Component Name | none > none > ReplayControls > ButtonBar > none | | Element Name | FullViewport > none > ButtonGrid > ButtonGrid > ReplayPlayPauseButton | | Element + Component fallback | FullViewPort > none > ButtonGrid > ButtonGrid > ReplayPlayPauseButton | | Component + Element fallback | FullViewPort > none > ReplayControls > ButtonBar > ReplayPlayPauseButton | More elements have an `data-sentry-element` attribute than `data-sentry-component` attribute, so adding in the element name means more elements in the tree will have a descriptive name. Furthermore, the component name usually provides more context (eg. ReplayControls vs ButtonGrid) so it should take precedence over the element name Relates to getsentry/sentry#64673
Adds element name as fallback. If component name exists, use that, else if element name exists use that, else use selector name. The element name and component name mirrors that of React components vs elements
Example with Replay Play/Pause Button:
More elements have an
data-sentry-elementattribute thandata-sentry-componentattribute, so adding in the element name means more elements in the tree will have a descriptive name. Furthermore, the component name usually provides more context (eg. ReplayControls vs ButtonGrid) so it should take precedence over the element nameRelates to getsentry/sentry#64673