Ship production builds for @sentry/core and browser-utils

Aperta
#26,127 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à
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, typescript
Ambito
build-system

Direzione di ricerca

Start by comparing the package export conditions and build setup for @sentry/browser with those for @sentry/core and @sentry/browser-utils; the issue names no source files or tests. Check how production builds are generated and verify the package exports resolve to them without a bundler define. Done means the production entry points omit debug code by default, with build and package resolution checks confirming the behavior.

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

Descrizione

@sentry/browser 11.10.0 has development and production export conditions, and its default import resolves to build/npm/esm/prod, so its debug logging is stripped by default. @sentry/core and @sentry/browser-utils 11.10.0 export only react-native, import and require. Their single build keeps debug logging behind DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__).

  • Without a bundler define for __SENTRY_DEBUG__, every browser app ships the core and browser-utils debug code even though it uses the prod build of @sentry/browser.
  • Measured with esbuild 0.27 (minified) on a tracing-only browser setup: defining __SENTRY_DEBUG__: false cuts about 6 KB raw (137,636 → 131,987 B) and about 1.6 KB br-11.
  • Apps without a Sentry bundler plugin or a manual define don't get this saving.

Proposal from the reporter: ship production builds, or the same export conditions as @sentry/browser, for @sentry/core and @sentry/browser-utils, so the prod build drops debug code by default.

via @BYK.

--

View Session in Sentry

Lingua principale
TypeScript
Stelle
8.8k
Fork
1.9k
Merge medio
1g 8h
PR unite (30g)
744

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-javascript

Tutte le issue di getsentry/sentry-javascript

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.