Replace deprecated `_INTERNAL_flushLogsBuffer` with `flushLogsBuffer`

Aperta
#7,108 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
55/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react-native, typescript
Ambito
backend

Direzione di ricerca

Start in packages/core/src/js/client.ts and inspect the three spies in packages/core/test/client.test.ts. First confirm that the required @sentry/core release exports flushLogsBuffer; then replace the old name in those locations and verify the client tests. Done means the client and test spies use the new export and the JS SDK team is told the alias is no longer used by RN.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Next Major React-Native Task

Context

@sentry/core is dropping its _INTERNAL_-prefixed exports (getsentry/sentry-javascript#26744). _INTERNAL_flushLogsBuffer is renamed to flushLogsBuffer. The old name stays as a deprecated alias for now because React Native still uses it. The alias can't be removed until we switch.

This is the only _INTERNAL_ export from @sentry/core that the RN SDK uses.

⚠️ This will be implemented in the next major.

Usages

  • packages/core/src/js/client.ts: called on the client's flush event and from the idle timer after afterCaptureLog, when enableLogs is on.
  • packages/core/test/client.test.ts: three tests use jest.spyOn(SentryCore, '_INTERNAL_flushLogsBuffer'). The export name is a string here, so the type checker won't catch it. Rename these by hand.

Tasks

  • Bump @sentry/core to a release that exports flushLogsBuffer (getsentry/sentry-javascript#26744 merged and released).
  • Replace _INTERNAL_flushLogsBuffer with flushLogsBuffer in client.ts and the test spies.
  • Tell the JS SDK team the alias is no longer used by RN, so it can be removed.

Notes

  • Users won't see any change, and no changelog entry is needed. We can make the switch as soon as the new name is released, before the next major if that's convenient. It is tracked for the next major because the JS SDK can only drop the alias after we switch.
  • Related: #6969
Lingua principale
TypeScript
Stelle
1.8k
Fork
371
Merge medio
22h 3m
PR unite (30g)
106

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di getsentry/sentry-react-native

Tutte le issue di getsentry/sentry-react-native

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.