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

Offen
#26,127 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Bereich
build-system

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

@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

Vorherrschende Sprache
TypeScript
Sterne
8.8k
Forks
1.9k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
744

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus getsentry/sentry-javascript

Alle Issues in getsentry/sentry-javascript

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

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