Skip to content

Commit 558d898

Browse files
committed
feat: external sourcemap upload for compiled binaries
Two-step build: bundle TS → JS+sourcemap, then compile JS → binary. The sourcemap is uploaded to Sentry for server-side stack trace resolution, never shipped to users in the binary. Impact vs current (no sourcemaps): Download size: +0.04 MB gzipped (+0.1%) Delta patches: +0.83 KB per release Binary size: +0.54 MB raw (+0.5%) Impact vs inline sourcemaps: Download size: -2.26 MB gzipped (saved) Delta patches: -36.22 KB per release (saved) Binary size: -3.23 MB raw (saved) This gives Sentry accurate function names and file paths for: - Proper issue grouping (merges CLI-1D/BW/98 into one issue) - Accurate stack traces (no more minified func/BJ8/pp1 names) - Better error classification (splits misgroued CLI-N events) Build changes: - script/build.ts: Step 1 bundles with external sourcemap, Step 2 compiles the JS without re-minifying - CI: passes SENTRY_AUTH_TOKEN to build-binary job for upload - Intermediate JS/map files cleaned up after compile
1 parent 4b4ed91 commit 558d898

File tree

3 files changed

+184
-59
lines changed

3 files changed

+184
-59
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ jobs:
225225
- name: Build
226226
env:
227227
SENTRY_CLIENT_ID: ${{ vars.SENTRY_CLIENT_ID }}
228+
# Sourcemap upload to Sentry (non-fatal, skipped when token is absent)
229+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
228230
# Set on main/release branches so build.ts runs binpunch + creates .gz
229231
RELEASE_BUILD: ${{ github.event_name != 'pull_request' && '1' || '' }}
230232
run: bun run build --target ${{ matrix.target }}

0 commit comments

Comments
 (0)