getsentry / getsentry/sentry-react-native

Raise minimum TypeScript to 5.0.4 and drop TS 3.8 support (v9)

Offen
#6,657 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

React-Native
Vorherrschende Sprache
TypeScript
Sterne
1.8k
Forks
367
Ø Merge
1 T. 6 Std.
Gemergte PRs (30 T.)
94

Beschreibung

Summary

Raise the React Native SDK's minimum supported TypeScript version to 5.0.4 and drop the TypeScript 3.8 down-leveling setup.

Target: v9 (next major). This is a breaking change and will be implemented as part of the v9 major, alongside the @sentry/* JavaScript SDK v11 bump.

Background

JavaScript SDK v11 raises its minimum TypeScript to 5.0.4 and stops emitting down-leveled types (migration guide — TypeScript Version Policy). Confirmed against the alpha: @sentry/core@11.0.0-alpha.2 no longer ships the typesVersions / types-ts3.8 fallback that v10 provided for TS <5.0.

Because the RN SDK re-exports and references @sentry/core types, its effective TypeScript floor is inherited from core. The v11 core .d.ts files use TS 4.0/4.5+ syntax (labeled tuple elements; inline type import specifiers) that older TypeScript cannot parse — this is what fails the Type Check TypeScript 3.8 CI job on the alpha.2 spike (#6655). Our own downlevel-dts step only rewrites the RN SDK's own declarations; it does not (and cannot practically) rewrite the transitive @sentry/core types.

See the alpha.2 tracking notes in #6656.

Is 5.0.4 viable for React Native?

Yes. 5.0.4 is exactly the TypeScript version the RN community template pinned for RN 0.73–0.76; RN 0.77+ ships newer (^5.8.x). RN 0.71/0.72 templated TS 4.8.4, but TypeScript is decoupled from the RN version and can be bumped independently.

User impact

Compile-time only, TypeScript users only:

  • Not affected: JavaScript-only users, and TypeScript users already on >= 5.0.4 (the majority).
  • Affected: TypeScript users below 5.0.4 — they must bump typescript (a devDependency change, independent of their RN version). No runtime/behavior impact.

The SDK's react-native peer floor stays >= 0.65.0: the SDK still runs on old RN, but its types will require TS 5.0.4.

Tasks

  • Raise the minimum supported TypeScript to 5.0.4.
  • Remove the down-level setup: the downlevel build step, the downlevel-dts devDependency, and the typesVersions <4.9 → ts3.8 mapping in packages/core/package.json.
  • Replace/retire the Type Check TypeScript 3.8 CI job with one pinned to the new 5.0.4 floor.
  • Document in the v9 migration guide / release notes: "Minimum TypeScript raised to 5.0.4 (following @sentry/core v11); React Native support unchanged (>= 0.65). TypeScript users below 5.0.4 must upgrade TypeScript — this does not require a React Native upgrade."

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie mit der Überprüfung des CI-Jobs Type Check TypeScript 3.8, des Downlevel-Build-Schritts und des typesVersions-Mappings in packages/core/package.json. Prüfen Sie die Alpha-Tracking-Notizen in #6656 und die TypeScript-Versionsrichtlinie im verlinkten Migrationsleitfaden. Als abgeschlossen gilt die Aufgabe, wenn die Mindestversion 5.0.4 ist, das alte Downlevel-Setup und der CI-Job entfernt oder aktualisiert wurden und die v9-Migrations- oder Release-Notizen die Auswirkungen auf Benutzer dokumentieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
react-native, typescript
Bereich
build-system, ci-cd, documentation, mobile
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
70/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.