[DO NOT MERGE]: chore(deps): bump @sentry/* to 11.0.0-alpha.2 - #6655
[DO NOT MERGE]: chore(deps): bump @sentry/* to 11.0.0-alpha.2#6655antonis wants to merge 3 commits into
Conversation
Spike to surface JS v11 compatibility issues via CI. Bumps first-party @sentry/* dependencies (browser, core, react, bundler-plugins, eslint-plugin-sdk, typescript) to 11.0.0-alpha.2 across core and the sample/e2e apps, and adapts the SDK source to the v11 breaking changes: - spanToJSON() now returns the streamed shape; switched the internals that need the classic SpanJSON to spanToStaticSpanJSON(). - inboundFiltersIntegration -> eventFiltersIntegration (re-exported under the RN public name). - AI instrumentation (OpenAI/Anthropic/GenAI/LangChain/LangGraph) moved to server-only @sentry/server-utils; dropped those re-exports. - SEMANTIC_ATTRIBUTE_SENTRY_SOURCE -> SENTRY_SEGMENT_NAME_SOURCE alias. - ExtendedError / User index signatures tightened to unknown; narrowed the affected call sites. - enableLogs and sendDefaultPii are now RN-owned options (core removed them / RN Omits dataCollection); cast getOptions() accordingly. - Test harness migrated off the removed Scope.clear() via a clearAllScopes() helper in test/testutils.ts. Local: yarn build compiles clean. Known remaining test failures are tracked as follow-ups (old span shape in assertions, obsolete AI export test, measurements investigation). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
- Remove orphaned getCurrentScope/getGlobalScope/getIsolationScope imports left by the Scope.clear() -> clearAllScopes() test migration (10 files). - Regenerate the API report to reflect the removed AI instrumentation re-exports and the inboundFilters -> eventFilters rename. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Format the 16 source/test files touched by the v11 migration. The earlier Lint run never reached the oxfmt step because oxlint failed first on the orphaned scope imports; with those fixed, oxfmt --check surfaced the drift. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Android (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 68672fc+dirty | 425.02 ms | 487.56 ms | 62.54 ms |
| 71abba0+dirty | 496.54 ms | 525.16 ms | 28.63 ms |
| 7ff4d0f+dirty | 413.81 ms | 450.64 ms | 36.83 ms |
| 9ad4522+dirty | 420.73 ms | 444.18 ms | 23.45 ms |
| 0a147b2+dirty | 464.71 ms | 538.81 ms | 74.09 ms |
| d2eadf8+dirty | 414.64 ms | 454.56 ms | 39.92 ms |
| 57e0069+dirty | 413.82 ms | 453.47 ms | 39.65 ms |
| 26843eb+dirty | 532.15 ms | 624.13 ms | 91.98 ms |
| 9210ae6+dirty | 475.41 ms | 525.24 ms | 49.84 ms |
| 1e5d96d+dirty | 519.43 ms | 543.62 ms | 24.19 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 68672fc+dirty | 48.30 MiB | 53.61 MiB | 5.31 MiB |
| 71abba0+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| 7ff4d0f+dirty | 48.30 MiB | 53.60 MiB | 5.30 MiB |
| 9ad4522+dirty | 49.74 MiB | 55.38 MiB | 5.63 MiB |
| 0a147b2+dirty | 49.74 MiB | 55.08 MiB | 5.34 MiB |
| d2eadf8+dirty | 48.30 MiB | 53.48 MiB | 5.18 MiB |
| 57e0069+dirty | 49.74 MiB | 54.85 MiB | 5.11 MiB |
| 26843eb+dirty | 49.74 MiB | 55.26 MiB | 5.52 MiB |
| 9210ae6+dirty | 48.30 MiB | 53.54 MiB | 5.23 MiB |
| 1e5d96d+dirty | 49.74 MiB | 54.81 MiB | 5.07 MiB |
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 68ae91b+dirty | 3834.04 ms | 1216.60 ms | -2617.44 ms |
| 0b5a379+dirty | 3828.91 ms | 1214.12 ms | -2614.79 ms |
| f170ec3+dirty | 3822.26 ms | 1218.33 ms | -2603.93 ms |
| 68672fc+dirty | 3841.58 ms | 1228.89 ms | -2612.69 ms |
| 2c735cc+dirty | 1229.67 ms | 1221.50 ms | -8.17 ms |
| b9bebee+dirty | 3850.15 ms | 1227.51 ms | -2622.64 ms |
| a50b33d+dirty | 1197.74 ms | 1197.17 ms | -0.57 ms |
| 5569641+dirty | 3839.22 ms | 1231.30 ms | -2607.91 ms |
| f9c1ed4+dirty | 3833.98 ms | 1226.30 ms | -2607.68 ms |
| 7ac3378+dirty | 1213.37 ms | 1218.15 ms | 4.78 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 68ae91b+dirty | 4.98 MiB | 6.46 MiB | 1.48 MiB |
| 0b5a379+dirty | 5.15 MiB | 6.70 MiB | 1.54 MiB |
| f170ec3+dirty | 5.15 MiB | 6.69 MiB | 1.53 MiB |
| 68672fc+dirty | 5.15 MiB | 6.71 MiB | 1.55 MiB |
| 2c735cc+dirty | 3.38 MiB | 4.74 MiB | 1.35 MiB |
| b9bebee+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| a50b33d+dirty | 3.38 MiB | 4.73 MiB | 1.35 MiB |
| 5569641+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| f9c1ed4+dirty | 4.98 MiB | 6.50 MiB | 1.53 MiB |
| 7ac3378+dirty | 3.38 MiB | 4.76 MiB | 1.38 MiB |
📲 Install BuildsAndroid
|
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 71abba0+dirty | 3852.70 ms | 1224.53 ms | -2628.16 ms |
| bc0d8cf+dirty | 3834.64 ms | 1223.91 ms | -2610.73 ms |
| 68ae91b+dirty | 3836.36 ms | 1222.04 ms | -2614.32 ms |
| 267d3ed+dirty | 3860.14 ms | 1223.39 ms | -2636.76 ms |
| f170ec3+dirty | 3844.74 ms | 1222.67 ms | -2622.07 ms |
| b9bebee+dirty | 3858.02 ms | 1231.92 ms | -2626.11 ms |
| d038a14+dirty | 3831.11 ms | 1216.30 ms | -2614.81 ms |
| 853723c+dirty | 3849.33 ms | 1221.07 ms | -2628.26 ms |
| e763471+dirty | 3826.10 ms | 1221.52 ms | -2604.58 ms |
| 3d31fcf+dirty | 3857.46 ms | 1237.17 ms | -2620.29 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 71abba0+dirty | 5.15 MiB | 6.67 MiB | 1.52 MiB |
| bc0d8cf+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| 68ae91b+dirty | 4.98 MiB | 6.46 MiB | 1.48 MiB |
| 267d3ed+dirty | 5.15 MiB | 6.69 MiB | 1.54 MiB |
| f170ec3+dirty | 5.15 MiB | 6.69 MiB | 1.53 MiB |
| b9bebee+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| d038a14+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| 853723c+dirty | 5.15 MiB | 6.69 MiB | 1.53 MiB |
| e763471+dirty | 4.98 MiB | 6.51 MiB | 1.53 MiB |
| 3d31fcf+dirty | 4.98 MiB | 6.56 MiB | 1.58 MiB |
Android (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3b6e9f9+dirty | 442.39 ms | 486.44 ms | 44.05 ms |
| 57e0069+dirty | 442.25 ms | 486.64 ms | 44.39 ms |
| fa21fca+dirty | 455.70 ms | 551.22 ms | 95.52 ms |
| eb93136+dirty | 500.37 ms | 532.58 ms | 32.21 ms |
| 3a829f0+dirty | 410.78 ms | 454.22 ms | 43.44 ms |
| 5b7e8a7+dirty | 601.58 ms | 634.98 ms | 33.40 ms |
| 6176a94+dirty | 403.58 ms | 446.73 ms | 43.15 ms |
| 9c84b9a+dirty | 429.26 ms | 448.90 ms | 19.64 ms |
| bf168a4+dirty | 430.60 ms | 459.31 ms | 28.71 ms |
| 20fbd51+dirty | 594.38 ms | 655.35 ms | 60.97 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3b6e9f9+dirty | 48.30 MiB | 53.54 MiB | 5.23 MiB |
| 57e0069+dirty | 49.74 MiB | 54.85 MiB | 5.11 MiB |
| fa21fca+dirty | 49.74 MiB | 55.37 MiB | 5.63 MiB |
| eb93136+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| 3a829f0+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| 5b7e8a7+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| 6176a94+dirty | 48.30 MiB | 53.54 MiB | 5.24 MiB |
| 9c84b9a+dirty | 49.74 MiB | 55.36 MiB | 5.62 MiB |
| bf168a4+dirty | 49.74 MiB | 55.09 MiB | 5.35 MiB |
| 20fbd51+dirty | 49.74 MiB | 54.81 MiB | 5.07 MiB |
| @@ -24,10 +20,8 @@ import { captureFeedback } from '@sentry/core'; | |||
| import { captureMessage } from '@sentry/core'; | |||
| import { Client } from '@sentry/core'; | |||
| import type { ClientOptions } from '@sentry/core'; | |||
| import { CompiledGraph } from '@sentry/core'; | |||
| import { consoleLoggingIntegration } from '@sentry/browser'; | |||
| import { consoleSandbox } from '@sentry/core'; | |||
| import { createLangChainCallbackHandler } from '@sentry/core'; | |||
| import { createReduxEnhancer } from '@sentry/react'; | |||
| import { dedupeIntegration } from '@sentry/react'; | |||
| import type { Envelope } from '@sentry/core'; | |||
| @@ -47,33 +41,17 @@ import { getCurrentScope } from '@sentry/core'; | |||
| import { getGlobalScope } from '@sentry/core'; | |||
| import { getIsolationScope } from '@sentry/core'; | |||
| import { getRootSpan } from '@sentry/core'; | |||
| import { GoogleGenAIChat } from '@sentry/core'; | |||
| import { GoogleGenAIClient } from '@sentry/core'; | |||
| import { GoogleGenAIOptions } from '@sentry/core'; | |||
| import type { HostComponent } from 'react-native'; | |||
| import { httpClientIntegration } from '@sentry/react'; | |||
| import { httpContextIntegration } from '@sentry/react'; | |||
| import type { ImageStyle } from 'react-native'; | |||
| import { inboundFiltersIntegration } from '@sentry/react'; | |||
| import { instrumentAnthropicAiClient } from '@sentry/core'; | |||
| import { InstrumentedMethod } from '@sentry/core'; | |||
| import { instrumentGoogleGenAIClient } from '@sentry/core'; | |||
| import { instrumentLangGraph } from '@sentry/core'; | |||
| import { instrumentOpenAiClient } from '@sentry/core'; | |||
| import { instrumentStateGraph } from '@sentry/core'; | |||
| import { instrumentStateGraphCompile } from '@sentry/core'; | |||
| import { eventFiltersIntegration as inboundFiltersIntegration } from '@sentry/react'; | |||
| import { Integration } from '@sentry/core'; | |||
| import { LangChainIntegration } from '@sentry/core'; | |||
| import { LangChainOptions } from '@sentry/core'; | |||
| import { LangGraphIntegration } from '@sentry/core'; | |||
| import { LangGraphOptions } from '@sentry/core'; | |||
| import { lastEventId } from '@sentry/core'; | |||
| import { logger } from '@sentry/browser'; | |||
| import type { makeFetchTransport } from '@sentry/browser'; | |||
| import { Metric } from '@sentry/core'; | |||
| import { metrics } from '@sentry/browser'; | |||
There was a problem hiding this comment.
Removing previously documented AI re-exports breaks React Native consumers and leaves a failing test
The v11 adaptation removes instrumentOpenAiClient, instrumentAnthropicAiClient, instrumentGoogleGenAIClient, createLangChainCallbackHandler, instrumentLangGraph/instrumentStateGraph*, and related types from the @sentry/react-native entrypoint. These helpers were explicitly exposed for React Native apps in the 8.x changelog, while the package version remains 8.24.0. This is an unannounced public API break, and packages/core/test/aiExports.test.ts still expects the functions and alias to exist. Before merging, either preserve compatibility with a deprecation shim or document the removal as a React Native breaking change, update the package version/migration guidance, and update or remove the stale test; @sentry/server-utils is server-only and is not a drop-in React Native replacement.
Evidence
packages/core/src/js/index.tsno longer re-exports the OpenAI, Anthropic, Google GenAI, LangChain, or LangGraph helpers, and states that they moved to server-only@sentry/server-utils.- The 8.x changelog explicitly documented these helpers as re-exports for use in React Native apps, establishing that they were part of the supported public surface.
packages/core/test/aiExports.test.tsstill checks each helper and directly comparesSentry.instrumentLangGraphwithSentry.instrumentStateGraph, so the current entrypoint cannot satisfy the existing test.packages/core/package.jsonremains at8.24.0, and the current Unreleased changelog has no migration or breaking-change note for this removal.
Also found at 5 additional locations
packages/core/etc/sentry-react-native.api.md:418-423packages/core/etc/sentry-react-native.api.md:490-495packages/core/src/js/index.ts:50-62packages/core/etc/sentry-react-native.api.md:104-109packages/core/etc/sentry-react-native.api.md:149-161
Identified by Warden · code-review · TU5-K4F
| } | ||
| const root = getRootSpan(active); | ||
| const origin = spanToJSON(root).origin; | ||
| const origin = spanToStaticSpanJSON(root).origin; |
There was a problem hiding this comment.
spanToStaticSpanJSON switch breaks expoRouterErrorBoundary origin tests
Update expoRouterErrorBoundary.test.tsx to mock spanToStaticSpanJSON (not spanToJSON) so the navigation-origin guard and setStatus assertions still exercise this path.
Evidence
- Hunk changes
markActiveNavigationSpanErrored()to read origin viaspanToStaticSpanJSON(root).origin. packages/core/test/tracing/expoRouterErrorBoundary.test.tsxstill only stubsspanToJSONto return{ origin: span?.__origin }and leavesspanToStaticSpanJSONas the real@sentry/coreexport.- Tests that set
mockActiveSpan.__origin(marks the active navigation span as errored,does not touch user-owned spans) therefore no longer drive the origin check or reliably assertsetStatus.
Identified by Warden · code-review · S2S-3M7
|
Closing in favour of the newest beta #6665 |
📢 Type of change
📜 Description
Spike bumping the first-party
@sentry/*dependencies to11.0.0-alpha.2to surface JS v11 compatibility work early — opened as a draft to exercise CI (TS 3.8 compat, lint, circular-dep, API report, native/e2e once labeled).Bumps
@sentry/browser,@sentry/core,@sentry/react,@sentry/react-native-bundler-plugins,@sentry/eslint-plugin-sdk,typescriptinpackages/coreand the matching refs in the sample/e2e apps, and adapts the SDK source to the v11 breaking changes:spanToJSON()now returns the streamed shape (name/attributes/end_timestamp,statuscollapsed took/error). Switched the internals that need the classicSpanJSONtospanToStaticSpanJSON()(12 files).inboundFiltersIntegration→eventFiltersIntegration, re-exported under the existing RN public name.@sentry/server-utils(which RN does not depend on); dropped those re-exports and their types.SEMANTIC_ATTRIBUTE_SENTRY_SOURCEreplaced bySENTRY_SEGMENT_NAME_SOURCE(aliased to keep call sites stable).ExtendedErrorandUserindex signatures changedany→unknown(andUser.namedropped from the typed interface); narrowed the affected call sites.enableLogsandsendDefaultPiiare no longer on core's client options (core removed them / RNOmitsdataCollection); declared them onBaseReactNativeOptionsand castgetOptions()toReactNativeClientOptionswhere read.Scope.clear()via aclearAllScopes()helper intest/testutils.ts, replacing the per-suitegetCurrentScope()/getIsolationScope()/getGlobalScope().clear()reset blocks.Findings from cross-referencing the JS v11 migration guide against the RN public export surface. These are the changes that actually reach
@sentry/react-nativeconsumers:spanToJSON()return shape changed — RN re-exportsspanToJSON. It now returns the streamed shape (name,attributes,end_timestamp,status: 'ok' | 'error',is_segment) instead of classicSpanJSON(description,data,op,timestamp,origin, granular status). User code reading the old fields (e.g. inbeforeSendSpan) breaks. The core escape hatchspanToStaticSpanJSON()is not currently re-exported from RN, so users have no supported way to get the old shape — see Next steps.Scope.clear()removed — RN re-exportsScope; any user calling.clear()breaks. UsewithScope/withIsolationScopeor re-init.openAIIntegration,anthropicAIIntegration,googleGenAIIntegration,instrument*Client, etc. are no longer re-exported (moved to server-only@sentry/server-utils).any→unknown) +User.namedropped — re-exported types (User,StackFrame,SamplingContext, …) may require explicit narrowing for TS users;User.nameis no longer in the typed interface.InboundFilters→EventFilters(partially shielded) — the export is aliased, but the default integration now reports itself as'EventFilters', so lookups/filters by the string'InboundFilters'(getIntegrationByName('InboundFilters'),integrations.filter(i => i.name !== 'InboundFilters')) break.@sentry/typesno longer published — users importing types directly from@sentry/typesmust switch to@sentry/core.Partially shielded —⚠️ logs/metrics gap):
sendDefaultPii→dataCollection(RN keeps its own
sendDefaultPiiandOmitsdataCollection. For events, sessions and spans PII is unchanged: RN setsinfer_ipvia_metadata.sdk.settings(client.ts:63), gatesaddAutoIpAddressToSessiononsendDefaultPii(client.ts:85), and the span-envelopeingest_settingsis browser-gated (void 0on mobile). But logs & metrics envelopes leak: core derives theirinfer_ipfromgetDataCollectionOptions().userInfo(logs/internal.js:115,metrics/internal.js:114), which resolves to the permissive defaulttruebecause RN never setsdataCollection— sosendDefaultPii: falseno longer suppresses IP inference on logs/metrics. Tracked by the Linear blocker "MigratesendDefaultPiito newDataCollectionspec [React Native]"; the fix is to seeddataCollection.userInfofromsendDefaultPii.Shielded by the RN wrapper (NOT breaking for RN users):
enableLogsremoved from core — RN re-declares it as its own option.unhandledvscrashed,pagelifecycle) — browser-runtime only; RN uses native session tracking.spanToStreamedSpanJSONremoval, metrics CDN bundle — N/A to RN.💡 Motivation and Context
Tracking the JS 11 alpha/beta releases (alpha.2) to find breaking changes and things that need handling in the RN SDK before the real bump. Follows the cadence of the routine dependency-update PRs.
💚 How did you test it?
yarn build(tsc) compiles clean against11.0.0-alpha.2(0 errors).yarn testlocally: theScope.clear()harness crash is resolved (recovered ~250 tests). Remaining failures are catalogued below and are the point of this spike — CI is expected to be red.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Known remaining test failures (follow-ups, not yet addressed):
spanToJSON(span).status/.data; needs the samespanToStaticSpanJSONswap on the test side.aiExports.test.ts— asserts the now-removed AI re-exports; obsolete, to be deleted.undefinedin stall-tracking / native-frames transactions — needs investigation (possible real v11 behavior change, not just a test edit).spanToStaticSpanJSON()from the RN public exports so users retain an escape hatch to the classic span shape.CHANGELOG.mdentry once the approach is confirmed.