Skip to content

[DO NOT MERGE]: chore(deps): bump @sentry/* to 11.0.0-beta.0 - #6665

Draft
antonis wants to merge 10 commits into
mainfrom
chore/js-11-beta-0-compat
Draft

[DO NOT MERGE]: chore(deps): bump @sentry/* to 11.0.0-beta.0#6665
antonis wants to merge 10 commits into
mainfrom
chore/js-11-beta-0-compat

Conversation

@antonis

@antonis antonis commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

Spike / DO NOT MERGE. Compatibility probe for the @sentry/* JavaScript SDK v11.0.0-beta.0. Branched off the alpha.2 spike (#6655) with main merged in. Tracks what breaks (for the SDK and for its users) and what still needs covering before the v11 bump (RN-586). Not for merge.

📜 Description

Bumps @sentry/* from 11.0.0-alpha.2 to 11.0.0-beta.0 across packages/core, the samples and dev-packages/e2e-tests, and adapts the SDK to compile, pass its full test suite, and preserve v8 runtime behavior for end users.

The suite is fully green (1913 SDK + 340 tools tests) and build, lint, format, circular-dep and API report all pass.

Source changes (runtime)

  • tracing/span.ts — real bug fix. v11 no longer stores the active span on a scope._sentrySpan property; it keeps a WeakRef under scope.refs.span. RN's clearActiveSpanFromScope was deleting the old (now non-existent) field, so the previous navigation/interaction span was never detached and became the parent of the next root span — corrupting the trace hierarchy for every navigation and UI-interaction transaction. Now clears via the official _INTERNAL_setSpanForScope helper. This is a latent bug that would ship broken under v11 regardless of the pre-release testing, and the internal field move is not documented in the migration guide.
  • sdk.tsxtraceLifecycle: 'static' pin. v11 defaults span handling to 'stream'. Mobile opts into 'static' so transactions keep being sent as transaction envelopes (the classic v8 shape the native SDKs ingest), rather than streamed spans. This keeps end-user behavior unchanged.
  • tracing/span.ts / replay/xhrUtils.ts — entry-point split. New in beta.0: the @sentry/core main entry was split into shared / browser / server subpaths. startIdleSpan and the XhrBreadcrumbHint type moved to @sentry/core/browser. Core ships root-level shim stubs (browser.d.ts / browser.js) so RN's classic moduleResolution: node still resolves the subpath; jest resolves it via RNTestEnvironment.js. Not in the beta.0 migration guide.

⚠️ Breaking changes for Sentry React Native SDK users

When the SDK bundles @sentry/* v11, the following are user-visible breaking changes. Anything RN could absorb has been absorbed (see the last sub-list) so this set is the residue users still need to know about.

Confirmed breaking:

Change What breaks for the user Migration
Scope.clear() removed Scope is re-exported from @sentry/react-native; getCurrentScope().clear() (or .clear() on any scope) no longer exists. Re-run code in a fresh scope via withScope / withIsolationScope, or re-init the SDK.
spanToJSON() shape changed Re-exported from @sentry/react-native. Now returns the streamed shape (name, attributes, status: 'ok' | 'error', end_timestamp, is_segment, …) instead of the classic description / op / data / timestamp / origin / measurements. Code reading classic fields (e.g. in beforeSendTransaction) breaks. Use the classic fields off event.spans directly, or the classic-shape helper (RN re-exporting spanToStaticSpanJSON is a follow-up — see Next steps).
Custom span status messages normalized span.setStatus({ code: SPAN_STATUS_ERROR, message: 'my text' }) — only canonical status strings survive; any non-canonical message now surfaces as internal_error, so custom status text is lost. Use a canonical status, or carry the detail on a span attribute / tag.
InboundFiltersEventFilters inboundFiltersIntegration still works (aliased), but the integration's name is now "EventFilters". Looking up / removing the integration by the string "InboundFilters" breaks. Reference "EventFilters".
AI instrumentation helpers removed instrumentOpenAiClient, instrumentAnthropicAiClient, instrumentGoogleGenAIClient, createLangChainCallbackHandler, the LangGraph helpers, etc. are no longer re-exported from @sentry/react-native (moved to the server-only @sentry/server-utils, which RN does not depend on). These are Node/server helpers with little RN applicability; import from a server SDK if needed.
@sentry/types no longer published Types moved into @sentry/core. Direct imports from @sentry/types break. Import types from @sentry/react-native (or @sentry/core).
Public types tightened (anyunknown) Several public types were narrowed; TypeScript users may see new compile errors. Add narrowing / casts where needed.

In progress — will be handled before the bump (tracked, not decided in this spike):

  • sendDefaultPiidataCollection. Dedicated Linear project; the infer_ip PII gap is scoped to logs + metrics envelopes only (events / sessions / spans are already safe). Intent is for users to keep working without a forced rename.
  • Minimum TypeScript 5.0.4. @sentry/core v11 no longer ships TS 3.8 types — it dropped build/types-ts3.8 and its typesVersions mapping — so TS 3.8 falls back to the modern .d.ts and fails to parse them (skipLibCheck can't help: it skips type-checking, not parsing). This raises the floor to TS 5.0.4. Done in this branch: the CI type-compat guard was retargeted from TS 3.8 to 5.0.4 (ts3.8-testts5.0-test); verified @sentry/react-native@sentry/core@11.0.0-beta.0 type-checks cleanly under 5.0.4. Still open: RN currently still down-levels and ships its own TS 3.8 types; whether to drop that (and formally raise the documented minimum) is the remaining decision. Tracked as RN-754 / Raise minimum TypeScript to 5.0.4 and drop TS 3.8 support (v9) #6657.

Explicitly NOT breaking for RN users (RN preserves v8 behavior):

  • Span streaming — pinned to traceLifecycle: 'static'; transactions still send as envelopes.
  • enableLogs — RN re-declares the option.
  • attachStacktrace default — RN already defaults it to true.
  • enableMetrics removal — was never a public RN option, so nothing to migrate.

💡 Motivation and Context

Continuous validation of the JS v11 pre-releases ahead of the RN major (RN-586). Confirms whether each pre-release introduces new breakages, catalogues the user-facing breaking surface, and re-verifies the known gaps still need covering. The beta.0-specific findings (all now handled in this branch):

Change RN handling
Active span moved to scope.refs.span WeakRef New / undocumented — fixed clearActiveSpanFromScope (runtime bug).
@sentry/core entry-point split (browser subpath) New in beta.0startIdleSpan / XhrBreadcrumbHint imports moved to @sentry/core/browser.
AI instrumentation helpers moved to @sentry/server-utils Re-exports dropped (see breaking-changes table).
Span streaming is the default Pinned traceLifecycle: 'static'.
spanToJSON shape changed Source uses spanToStaticSpanJSON internally; RN sample's TurboModule screen switched to spanToStaticSpanJSON (see e2e note below); user-facing re-export flagged.
Non-canonical span status normalized to internal_error Absorbed; assertions updated.
Child spans drop default sentry.source: 'custom' Absorbed; assertions updated.
Scope.clear() removed Absorbed via resetScope test helper.
InboundFiltersEventFilters rename eventFiltersIntegration aliased as inboundFiltersIntegration.
Dropped TS 3.8 down-levelled types (min TS 5.0.4) CI type-compat guard retargeted from TS 3.8 to 5.0.4 (ts3.8-testts5.0-test).

💚 How did you test it?

  • yarn build — clean.

  • yarn lint, format, yarn circularDepCheck — pass.

  • yarn api-report:check — passes.

  • TS-compat guard — retargeted from TypeScript 3.8 to 5.0.4 (v11's new floor) and verified locally: @sentry/react-native@sentry/core@11.0.0-beta.0 type-checks with exit 0.

  • yarn testall green (1913 SDK + 340 tools + 1). The v11 adaptations: spanToJSONspanToStaticSpanJSON where the classic shape is asserted; startIdleSpan imported from @sentry/core/browser; Scope.clear()resetScope helper; non-canonical status assertions → internal_error; child-span sentry.source dropped; app.start snapshot re-locked (sentry.segment.name.source + status: 'ok'); obsolete enableMetrics and AI-exports tests removed.

  • e2e (REV2, iOS + Android) — the turboModuleSpanAttributes flow failed identically on both platforms: the RN sample's TurboModuleScreen rendered the aggregated turbo_module.* attributes by reading spanToJSON(span).data, which v11 empties (streamed shape has no .data), so the on-screen scrollUntilVisible found nothing. Fixed the sample to read via spanToStaticSpanJSON — the same classic-shape helper the SDK uses internally. (e2e-v2 only re-runs with the ready-to-merge label, so this isn't auto-verified on push.)

Local install needed YARN_NPM_MINIMAL_AGE_GATE=0 to bypass yarn's 1-day publish quarantine on beta.0. CI will be blocked the same way until beta.0 is >1 day old — no .yarnrc.yml change was committed (keeps the supply-chain gate intact).

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 Next steps

  • Cover the remaining gaps before the v11 bump (RN-586): the sendDefaultPiidataCollection migration (logs/metrics PII), re-exporting spanToStaticSpanJSON so users keep a classic-shape helper, and the down-levelled-types shipping decision — whether RN stops shipping its own TS 3.8 types and formally raises the documented minimum to 5.0.4 (RN-754). The CI type-compat guard is already retargeted to 5.0.4 in this branch.

antonis and others added 5 commits September 2, 2026 17:09
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>
- 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>
Bumps the JS SDK spike from 11.0.0-alpha.2 to 11.0.0-beta.0 across core,
samples and e2e-tests.

beta.0 splits the `@sentry/core` main entry into shared/browser/server
subpaths, removing `startIdleSpan` and `XhrBreadcrumbHint` from the root
export. Import both from the `@sentry/core/browser` subpath (the root-level
shim stubs keep classic `moduleResolution: node` resolution working):

- tracing/span.ts: `startIdleSpan` -> `@sentry/core/browser`
- replay/xhrUtils.ts: `XhrBreadcrumbHint` type -> `@sentry/core/browser`

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Sep 3, 2026

Copy link
Copy Markdown

JS-11

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • [DO NOT MERGE]: chore(deps): bump @sentry/* to 11.0.0-beta.0 by antonis in #6665

🤖 This preview updates automatically when you update the PR.

@antonis antonis added the ready-to-merge Triggers the full CI test suite label Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 425.90 ms 449.02 ms 23.12 ms
Size 50.56 MiB 56.45 MiB 5.89 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0b5120f+dirty 503.22 ms 538.60 ms 35.38 ms
ad66da3+dirty 468.46 ms 533.56 ms 65.10 ms
8448c07+dirty 422.88 ms 471.22 ms 48.34 ms
9474ead+dirty 411.45 ms 446.80 ms 35.35 ms
f6ce4ff+dirty 464.62 ms 481.48 ms 16.86 ms
890d145+dirty 504.54 ms 491.55 ms -12.99 ms
68ae91b+dirty 416.44 ms 477.56 ms 61.12 ms
3ce5254+dirty 410.57 ms 448.48 ms 37.91 ms
acd838e+dirty 422.63 ms 462.39 ms 39.76 ms
2e64504+dirty 450.52 ms 482.70 ms 32.18 ms

App size

Revision Plain With Sentry Diff
0b5120f+dirty 48.30 MiB 53.58 MiB 5.28 MiB
ad66da3+dirty 48.30 MiB 53.49 MiB 5.19 MiB
8448c07+dirty 49.74 MiB 55.37 MiB 5.63 MiB
9474ead+dirty 48.30 MiB 53.61 MiB 5.30 MiB
f6ce4ff+dirty 49.74 MiB 55.45 MiB 5.71 MiB
890d145+dirty 43.75 MiB 48.14 MiB 4.39 MiB
68ae91b+dirty 49.74 MiB 54.79 MiB 5.05 MiB
3ce5254+dirty 43.75 MiB 48.12 MiB 4.37 MiB
acd838e+dirty 48.30 MiB 53.60 MiB 5.30 MiB
2e64504+dirty 49.74 MiB 55.45 MiB 5.71 MiB

@sentry

sentry Bot commented Sep 3, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.25.0 (105) Release

⚙️ sentry-react-native Build Distribution Settings

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3862.20 ms 1231.60 ms -2630.61 ms
Size 5.15 MiB 6.87 MiB 1.72 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
ecf47a2+dirty 3835.20 ms 1222.43 ms -2612.77 ms
3817909+dirty 1183.90 ms 1187.50 ms 3.60 ms
5ee78d6+dirty 3847.52 ms 1224.27 ms -2623.25 ms
890d145+dirty 1223.59 ms 1231.37 ms 7.78 ms
e763471+dirty 3841.16 ms 1218.06 ms -2623.09 ms
3d31fcf+dirty 3838.09 ms 1223.46 ms -2614.63 ms
9210ae6+dirty 3815.93 ms 1214.14 ms -2601.79 ms
26843eb+dirty 3861.60 ms 1238.77 ms -2622.82 ms
7a89652+dirty 3861.46 ms 1229.61 ms -2631.85 ms
9ad4522+dirty 3850.40 ms 1222.40 ms -2628.00 ms

App size

Revision Plain With Sentry Diff
ecf47a2+dirty 4.98 MiB 6.46 MiB 1.49 MiB
3817909+dirty 3.38 MiB 4.73 MiB 1.35 MiB
5ee78d6+dirty 5.15 MiB 6.69 MiB 1.53 MiB
890d145+dirty 3.38 MiB 4.77 MiB 1.38 MiB
e763471+dirty 4.98 MiB 6.51 MiB 1.53 MiB
3d31fcf+dirty 4.98 MiB 6.56 MiB 1.58 MiB
9210ae6+dirty 5.15 MiB 6.68 MiB 1.53 MiB
26843eb+dirty 4.98 MiB 6.53 MiB 1.55 MiB
7a89652+dirty 5.15 MiB 6.70 MiB 1.55 MiB
9ad4522+dirty 4.98 MiB 6.56 MiB 1.58 MiB

Previous results on branch: chore/js-11-beta-0-compat

Startup times

Revision Plain With Sentry Diff
b19757e+dirty 3863.06 ms 1235.43 ms -2627.64 ms
6576cfd+dirty 3851.04 ms 1231.85 ms -2619.19 ms

App size

Revision Plain With Sentry Diff
b19757e+dirty 5.15 MiB 6.87 MiB 1.72 MiB
6576cfd+dirty 5.15 MiB 6.87 MiB 1.72 MiB

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3857.04 ms 1222.17 ms -2634.87 ms
Size 5.15 MiB 6.87 MiB 1.72 MiB

Baseline results on branch: main

Startup times

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

Previous results on branch: chore/js-11-beta-0-compat

Startup times

Revision Plain With Sentry Diff
b19757e+dirty 3853.54 ms 1240.77 ms -2612.77 ms
6576cfd+dirty 3860.96 ms 1236.00 ms -2624.96 ms

App size

Revision Plain With Sentry Diff
b19757e+dirty 5.15 MiB 6.87 MiB 1.72 MiB
6576cfd+dirty 5.15 MiB 6.87 MiB 1.72 MiB

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 461.00 ms 521.23 ms 60.23 ms
Size 50.56 MiB 56.45 MiB 5.89 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
5a010b7+dirty 475.15 ms 519.02 ms 43.88 ms
f9c1ed4+dirty 520.57 ms 594.84 ms 74.27 ms
c2e182c+dirty 468.50 ms 545.44 ms 76.94 ms
2c735cc+dirty 435.20 ms 459.48 ms 24.28 ms
af33f3b+dirty 417.68 ms 448.04 ms 30.37 ms
7d8c8bd+dirty 406.06 ms 460.88 ms 54.81 ms
890d145+dirty 486.42 ms 514.85 ms 28.43 ms
ef27341+dirty 519.02 ms 553.42 ms 34.40 ms
bf168a4+dirty 430.60 ms 459.31 ms 28.71 ms
41d6254+dirty 406.20 ms 445.52 ms 39.32 ms

App size

Revision Plain With Sentry Diff
5a010b7+dirty 48.30 MiB 53.58 MiB 5.28 MiB
f9c1ed4+dirty 49.74 MiB 54.86 MiB 5.12 MiB
c2e182c+dirty 49.74 MiB 54.85 MiB 5.11 MiB
2c735cc+dirty 43.94 MiB 48.94 MiB 5.00 MiB
af33f3b+dirty 49.74 MiB 55.09 MiB 5.35 MiB
7d8c8bd+dirty 48.30 MiB 53.54 MiB 5.23 MiB
890d145+dirty 43.94 MiB 49.00 MiB 5.06 MiB
ef27341+dirty 48.30 MiB 53.54 MiB 5.24 MiB
bf168a4+dirty 49.74 MiB 55.09 MiB 5.35 MiB
41d6254+dirty 48.30 MiB 53.60 MiB 5.30 MiB

Previous results on branch: chore/js-11-beta-0-compat

Startup times

Revision Plain With Sentry Diff
b19757e+dirty 460.30 ms 497.48 ms 37.18 ms
6576cfd+dirty 447.00 ms 481.54 ms 34.54 ms

App size

Revision Plain With Sentry Diff
b19757e+dirty 50.56 MiB 56.45 MiB 5.89 MiB
6576cfd+dirty 50.56 MiB 56.45 MiB 5.89 MiB

Comment on lines 8 to 57
@@ -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';
import { OpenAiClient } from '@sentry/core';
import { OpenAiOptions } from '@sentry/core';
import type { Options } from '@sentry/core';
import { Profiler } from '@sentry/react';
import * as React_2 from 'react';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Removing AI instrumentation exports breaks the existing React Native API and test suite

@sentry/react-native previously re-exported the AI manual-instrumentation helpers, but packages/core/src/js/index.ts now removes them because JavaScript SDK v11 moved them to the server-only @sentry/server-utils package. Since React Native does not depend on that package, existing applications lose both the TypeScript and runtime exports while the package version remains 8.24.0. The existing aiExports.test.ts also still asserts these exports and will fail. Preserve a supported React Native-compatible export, or update the test and document the breaking migration before shipping the dependency bump.

Evidence
  • packages/core/src/js/index.ts no longer re-exports the OpenAI, Anthropic, Google GenAI, LangChain, or LangGraph helpers and explicitly states that React Native does not depend on @sentry/server-utils.
  • packages/core/test/aiExports.test.ts imports the package entry point and expects all seven removed helpers to be functions, so the configured Jest suite will fail.
  • packages/core/package.json still declares version 8.24.0, making the removal a breaking change in the React Native package rather than an announced major release.
  • Consumers importing these helpers from @sentry/react-native have no supported in-package migration because the suggested server-only package is not a React Native dependency.
Also found at 5 additional locations
  • packages/core/etc/sentry-react-native.api.md:106-109
  • packages/core/etc/sentry-react-native.api.md:490-495
  • packages/core/etc/sentry-react-native.api.md:149-161
  • packages/core/etc/sentry-react-native.api.md:399-418
  • packages/core/package.json:76-81

Identified by Warden · code-review · W4Y-3U8

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Intentional for this spike — this PR is a DO NOT MERGE compatibility probe for @sentry/* v11.0.0-beta.0, not a shipping change, so the package version deliberately stays on the 8.x line. Three clarifications on th
e finding:

  • Test suite is green. aiExports.test.ts was removed in this branch (7c61999d) together with the export removal, so the Jest suite passes — the "the configured Jest suite will fail" part is stale against the cur
    rent tip.
  • The removal is documented as breaking. It is listed in the PR's "Breaking changes for Sentry React Native SDK users" table: the AI helpers (instrumentOpenAiClient, instrumentAnthropicAiClient, instrumentGoogl eGenAIClient, LangChain/LangGraph, …) moved upstream to the server-only @sentry/server-utils in v11. These are Node/server helpers with little RN applicability, which is why RN does not take that dependency.
  • The user-facing migration lands with the v11 bump (RN-586). That major release is what will announce this — and the other v11 breaking changes catalogued in this PR — to users; this branch only validates the surfa
    ce ahead of it.

Comment thread packages/core/package.json
Comment thread packages/core/etc/sentry-react-native.api.md
Comment thread packages/core/src/js/tracing/expoRouterErrorBoundary.tsx
Comment thread packages/core/test/tracing/integrations/stallTracking/stalltracking.test.ts Outdated
Production fixes:
- clearActiveSpanFromScope: v11 stores the active span in a WeakRef under
  scope.refs.span, not the removed scope._sentrySpan property. Deleting the
  old field was a no-op, leaving the previous navigation/interaction span
  active so it became the parent of the next root span. Clear via the
  official _INTERNAL_setSpanForScope helper instead.
- sdk.tsx: pin traceLifecycle: 'static' so mobile keeps the classic
  transaction-envelope behavior instead of v11's new streaming default.

Test updates for v11 behavior changes:
- spanToJSON -> spanToStaticSpanJSON where the classic span shape is asserted.
- startIdleSpan now imported from @sentry/core/browser (entry-point split).
- Scope.clear() removed -> resetScope helper mirrors the old reset.
- Non-canonical status messages normalize to 'internal_error'.
- Child spans no longer carry a default sentry.source: 'custom'.
- app.start snapshot: sentry.segment.name.source key and status 'ok'.
- Drop obsolete enableMetrics suppression test and aiExports test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
antonis and others added 4 commits September 3, 2026 12:34
@sentry/core v11.0.0-beta.0 drops its down-levelled TS 3.8 types
(no `build/types-ts3.8`, `typesVersions` removed), raising the floor to
TypeScript 5.0.4. The old "Type Check Typescript 3.8" guard failed with
parse errors it can't skip (skipLibCheck only skips type-checking, not
parsing) when TS 3.8 hits v11's modern `.d.ts` syntax.

Retarget the guard to TypeScript 5.0.4 (the new minimum): rename the
ts3.8-test project to ts5.0-test and bump its TypeScript devDependency.
Verified locally that @sentry/react-native -> @sentry/core@11.0.0-beta.0
type-checks cleanly under 5.0.4.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…me.source

JS v11 removed the `sentry.source` semantic attribute; the transaction name
source now lives under `sentry.segment.name.source` on the segment span. The
navigation transaction's serialized `contexts.trace.data` therefore carries the
new key (matching the app-start unit snapshot already updated in this branch).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…mpat

# Conflicts:
#	dev-packages/e2e-tests/package.json
#	samples/expo/package.json
#	samples/react-native-macos/package.json
#	samples/react-native/package.json
#	yarn.lock
… v11

JS v11's `spanToJSON` returns the streamed span shape, which no longer
carries the classic `.data` attribute bag. The TurboModule Playground
screen read `spanToJSON(span).data`, so under v11 it collected no
`turbo_module.*` attributes and rendered nothing — failing the
`turboModuleSpanAttributes` e2e flow on both iOS and Android at the
on-screen `scrollUntilVisible` step. Switch to `spanToStaticSpanJSON`,
the classic-shape helper the SDK already uses internally.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment on lines 1 to 17
@@ -11,7 +11,7 @@
"devDependencies": {
"@types/react": "17.0.83",
"@types/react-native": "0.65.30",
"typescript": "3.8.3"
"typescript": "5.0.4"
},
"dependencies": {
"@sentry/expo-upload-sourcemaps": "file:.yalc/@sentry/expo-upload-sourcemaps",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TS type-check no longer validates published ts3.8 types

This suite now type-checks only with TypeScript 5.0.4, so it no longer exercises the still-published typesVersions/ts3.8 downlevel path for TS < 4.9; keep a TS < 4.9 check or drop that support path together.

Evidence
  • Hunk renames the package to sentry-react-native-ts-5-0-test and pins typescript to 5.0.4 (was 3.8.3).
  • dev-packages/type-check/run-type-check.sh only enters ts5.0-test and runs yarn type-check there.
  • packages/core/package.json still ships typesVersions["<4.9"] -> ts3.8/* and a downlevel-dts ... --to=3.8 build.
  • With TS 5.0.4, resolution uses main dist typings, so the downleveled ts3.8 types are never compiled in CI.

Identified by Warden · code-review · 8CF-9M7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Blocked ready-to-merge Triggers the full CI test suite skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant