Skip to content
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

ref(react): Improve React Router instrumentation docs #10837

Merged
merged 2 commits into from
Jul 26, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jul 25, 2024

While creating a small react router test app, I tried to apply our RR6 routing instrumentation and ran into every possible pitfall along the way. First, I imported the hooks from the wrong packages, then I missed that I need to apply wrapCreateBrowserRouter and ultimately (not my proudest moment lol) missed calling sentryCreateBrowserRouter.

Because IMO it's really easy to fall into at least one of these problems, I thought, our code snippet highlighting feature would work well here because the setup is (compared to other routing instrumentations) quite involved. So this PR adds some highlighting to the various RR version code snippets and slightly streamlines wording.

Example:
image

Note: All snippet highlights assume that Sentry.init was already set up beforehand which I think is a fair assumption, given this is a guide on a sub-page.

Copy link

vercel bot commented Jul 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
changelog ❌ Failed (Inspect) Jul 26, 2024 7:52am
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2024 7:52am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
develop-docs ⬜️ Ignored (Inspect) Visit Preview Jul 26, 2024 7:52am

Copy link

codecov bot commented Jul 25, 2024

Bundle Report

Changes will decrease total bundle size by 15 bytes ⬇️

Bundle name Size Change
sentry-docs-server 9.54MB 6 bytes ⬇️
sentry-docs-edge-server 255.36kB 3 bytes ⬇️
sentry-docs-client 8.18MB 6 bytes ⬇️

Co-authored-by: Sigrid Huemer <32902192+s1gr1d@users.noreply.github.com>
@Lms24 Lms24 enabled auto-merge (squash) July 26, 2024 07:39
@Lms24 Lms24 merged commit 763529c into master Jul 26, 2024
8 of 9 checks passed
@Lms24 Lms24 deleted the lms/ref-react-rr6-code-snippet branch July 26, 2024 07:52
@github-actions github-actions bot locked and limited conversation to collaborators Aug 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants