Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(browser): Add View Hierarchy integration #14981

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

Draft
timfish wants to merge 3 commits into develop
base: develop
Choose a base branch
Loading
from timfish/feat/browser-view-hierarchy

Conversation

Copy link
Collaborator

@timfish timfish commented Jan 11, 2025

image

This issue needs resolving before the wireframe is drawn correctly outside of flutter projects:

By default it captures the entire DOM, but it is configurable:

Capture only React components (uses attributes added by Sentry bundler plugins):

import * as Sentry from '@sentry/browser';
Sentry.init({
 dsn: '__DSN__',
 integrations: [Sentry.viewHierarchyIntegration({
 onElement: ({componentName}) => componentName ? {} : 'children'
 })],
});

Capture only Web Components:

import * as Sentry from '@sentry/browser';
Sentry.init({
 dsn: '__DSN__',
 integrations: [Sentry.viewHierarchyIntegration({
 onElement: ({tagName}) => tagName.includes('-') ? {} : 'children'
 })],
});

Copy link

codecov bot commented Jan 11, 2025
edited
Loading

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
628 1 627 299
View the top 1 failed tests by shortest run time
client-app-routing-instrumentation.test.ts Creates a navigation transaction for app router routes
Stack Traces | 30s run time
client-app-routing-instrumentation.test.ts:19:5 Creates a navigation transaction for app router routes

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link
Member

woah

what does it look like with minified class names? (and you don't have react component annotations or similar?)

Copy link
Collaborator Author

timfish commented Jan 14, 2025

By default it's capturing getComponentName(element) || element.tagName.toLowerCase(). So the above example actually has no React components on the page, it's simply displaying HTML elements and the tag names with a hyphen (-) are Web Components.

Here is the full event:
https://sentry-sdks.sentry.io/issues/6212345017/events/c6fa1362bdf5410487cf8461d6168583/

@mydea mydea mentioned this pull request Mar 28, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /