Update @sentry/react from v7 to v10#121
Merged
Merged
Conversation
Bumps @sentry/react ^7.120.3 -> ^10.60.0 (most recent), plus the supporting toolchain required by the new major: - sentry-testkit ^5.0.5 -> ^6.4.1 (v8+ compatible) - typescript ^4.7.4 -> ^5.9.3 (Sentry v9+ requires TS >= 5.0.4) Source changes for SDK breaking changes: - ErrorBoundary: import ErrorBoundaryProps from the package root (the internal @sentry/react/types/errorboundary path was removed in v8) and cast the now-`unknown` callback error to Error at the boundary. - ErrorBoundary story: String(props.error) for the now-`unknown` type. Test changes (environment/SDK behavior, not product bugs): - v8+ exposes its exports as read-only getters, breaking jest.spyOn. Mock @sentry/react in the affected specs so spies and the testkit transport keep working. - Add a jest setup file polyfilling performance.getEntriesByType, which v10's default browserTracingIntegration calls on init but jsdom lacks. - Reset the testkit between ErrorBoundary tests; v10 flushes captured events synchronously, exposing cross-test report leakage. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
RoyEJohnson
approved these changes
Jun 24, 2026
RoyEJohnson
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me. I note that Rex uses TypeScript 4.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the Sentry SDK to the most recent version:
@sentry/react^7.120.3→^10.60.0, along with the toolchain the new major requires.Dependency bumps
@sentry/react:^7.120.3→^10.60.0sentry-testkit:^5.0.5→^6.4.1(v8+ compatible)typescript:^4.7.4→^5.9.3— Sentry v9+ requires TS ≥ 5.0.4. Stayed on the latest 5.x rather than TS 6, whichts-jest@28doesn't support.Source changes (SDK breaking changes)
ErrorBoundary.tsx—ErrorBoundaryPropsnow imported from the package root; the internal@sentry/react/types/errorboundarydeep path was removed in v8. v10 retypes theonError/fallbackerrorasunknown, so added narrowas Errorcasts at the boundary (the runtime value from a React error boundary is always anError).ErrorBoundary.stories.tsx—props.error.toString()→String(props.error)for the now-unknowntype.Test changes (environment/SDK behavior — not product bugs)
jest.spyOn. Mocked@sentry/reactin the affected specs (spread +__esModule: true) so spies and the testkit transport keep working with the real implementations.src/test/setup.ts(wired viasetupFilesAfterEnv) polyfillingperformance.getEntriesByType— v10's defaultbrowserTracingIntegrationruns web-vitals instrumentation oninit, which jsdom doesn't implement.testkit.reset()to theErrorBoundaryspec'safterEach— v10 flushes captured events synchronously, which exposed cross-test report leakage.Verification
yarn typecheck✅yarn test✅ (214/214)yarn build✅yarn lint✅ (only a pre-existing "React version not specified" warning, unrelated)Note for reviewers
The TypeScript
4.7 → 5.9bump is lib-wide. Worth a sanity check that downstream consumers pinning against this lib's emitted types are comfortable with TS 5.x before release.🤖 Generated with Claude Code