Skip to content

feat(react): Add React version to events#12390

Merged
AbhiPrasad merged 4 commits intodevelopfrom
abhi-react-version
Jun 18, 2024
Merged

feat(react): Add React version to events#12390
AbhiPrasad merged 4 commits intodevelopfrom
abhi-react-version

Conversation

@AbhiPrasad
Copy link
Contributor

Given React 19 has changes with error handling, we may want to treat it differently in the product. (see https://www.notion.so/sentry/React-JS-19-23a7a2c5f88d4ef59a4b9647c84333a3?d=98df57f2272d482fa12a3c0618b43fc4#9bb5d5f0a9604508bb290fd7405fcce0 as an example).

To make this easier, we now attach the react version as context on all outgoing events.

@AbhiPrasad AbhiPrasad requested review from a team, Lms24, andreiborza and stephanie-anderson and removed request for a team June 6, 2024 14:14
import { init as browserInit, setContext } from '@sentry/browser';
import { applySdkMetadata } from '@sentry/core';

import { version } from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how nice of them to export this. I wish more packages did that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to sanity check, is this exported in all react versions (*that we support)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it is

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2024

size-limit report 📦

Path Size
@sentry/browser 22.03 KB (0%)
@sentry/browser (incl. Tracing) 33.2 KB (0%)
@sentry/browser (incl. Tracing, Replay) 68.94 KB (0%)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.27 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) 73.01 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) 85.19 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 87.02 KB (0%)
@sentry/browser (incl. metrics) 26.21 KB (0%)
@sentry/browser (incl. Feedback) 38.24 KB (0%)
@sentry/browser (incl. sendFeedback) 26.65 KB (0%)
@sentry/browser (incl. FeedbackAsync) 31.22 KB (0%)
@sentry/react 24.77 KB (-0.12% 🔽)
@sentry/react (incl. Tracing) 36.25 KB (-0.1% 🔽)
@sentry/vue 26.03 KB (0%)
@sentry/vue (incl. Tracing) 35.06 KB (0%)
@sentry/svelte 22.17 KB (0%)
CDN Bundle 23.36 KB (0%)
CDN Bundle (incl. Tracing) 34.89 KB (0%)
CDN Bundle (incl. Tracing, Replay) 68.99 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) 74.19 KB (0%)
CDN Bundle - uncompressed 68.68 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 103.29 KB (0%)
CDN Bundle (incl. Tracing, Replay) - uncompressed 213.74 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 226.33 KB (0%)
@sentry/nextjs (client) 36.14 KB (+1.49% 🔺)
@sentry/sveltekit (client) 33.83 KB (0%)
@sentry/node 112.67 KB (0%)
@sentry/node - without tracing 90.07 KB (0%)
@sentry/aws-serverless 99.16 KB (0%)

@AbhiPrasad AbhiPrasad force-pushed the abhi-react-version branch from ade4c8e to ae28b65 Compare June 17, 2024 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants