feat(debug-files): migrate DIF parser to the Archive/ObjectFile API by BYK · Pull Request #1124 · getsentry/cli · GitHub
Skip to content

feat(debug-files): migrate DIF parser to the Archive/ObjectFile API#1124

Merged
BYK merged 1 commit into
mainfrom
byk/feat/debug-files-new-symbolic-api
Jun 23, 2026
Merged

feat(debug-files): migrate DIF parser to the Archive/ObjectFile API#1124
BYK merged 1 commit into
mainfrom
byk/feat/debug-files-new-symbolic-api

Conversation

@BYK

@BYK BYK commented Jun 23, 2026

Copy link
Copy Markdown
Member

Migrates the DIF parser onto the new @sentry/symbolic 13.4.0 API (getsentry/symbolic#992 + #993), which replaced the flat parse_debug_file/peek_format functions with an Archive/ObjectFile class API.

Changes

  • src/lib/dif/index.ts:
    • parseDebugFilenew Archive(data) + archive.objects() with the camelCase getters (debugId, codeId, arch, fileFormat, kind, has*).
    • peekFormatArchive.peek(data) ?? "unknown" (peek now returns undefined for an unrecognized format, matching the old "unknown").
    • Dropped the snake_case RawArchiveInfo bridging type.
  • Bump @sentry/symbolic 13.3.013.4.0.

The public TS surface (parseDebugFile, peekFormat, DifArchiveInfo, DifObjectInfo) is unchanged, so debug-files/check.ts and the existing tests are untouched.

Validation

Against the published 13.4.0: tsc --noEmit clean, test/lib/dif/index.test.ts 9/9.

Note: 13.4.0 includes the ObjectFile rename (#993) — the prior Object export name shadowed the JS global Object and broke initSync in the shipped --target web glue. The CLI uses object instances (not the class name), so this migration is unaffected by the rename either way, but 13.4.0 is required for initSync to work at all.

The new @sentry/symbolic 13.4.0 (getsentry/symbolic#992, #993) replaces the
flat parse_debug_file/peek_format functions with an Archive/ObjectFile class
API. Rewrite src/lib/dif/index.ts onto it:

- parseDebugFile -> new Archive(data) + archive.objects() with the camelCase
  getters (debugId, codeId, arch, fileFormat, kind, has*).
- peekFormat -> Archive.peek(data) ?? "unknown" (peek now returns undefined
  for an unrecognized format).
- Drop the snake_case RawArchiveInfo bridging type.

The public TS surface (parseDebugFile, peekFormat, DifArchiveInfo,
DifObjectInfo) is unchanged, so debug-files/check.ts and the tests are
untouched. Bumps @sentry/symbolic 13.3.0 -> 13.4.0. Validated: typecheck
clean and dif unit tests 9/9 against the published 13.4.0.
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@BYK BYK merged commit 55850fa into main Jun 23, 2026
27 checks passed
@BYK BYK deleted the byk/feat/debug-files-new-symbolic-api branch June 23, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant