-
Notifications
You must be signed in to change notification settings - Fork 0
chore: Merge upstream changes #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…etsentry#134) The debug ID field on all source maps is now **serialized as `debugId` rather than `debug_id`**. To maintain backwards-compatibility with source maps that contain a `debug_id` field, we can still read the `debug_id` field. If a source map contains a `debugId` field and a `debug_id` field, **the `debugId` field takes precedence, which is a change from the old behavior**. Corresponding Sentry CLI PR: getsentry/sentry-cli#3005 Closes getsentry#96 Closes [CLI-240](https://linear.app/getsentry/issue/CLI-240/turn-debug-id-field-to-debugid)
Integrate changes from upstream getsentry/rust-sourcemap v9.3.0 release: - Update CHANGELOG.md with upstream changes - Merge improvements to decoder, encoder, and type definitions - Update test suite with upstream enhancements Conflicts resolved by keeping swc-project fork modifications: - Cargo.toml: Maintain package name as 'swc_sourcemap' and current version - src/sourceview.rs: Keep BytesStr-based implementation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR merges upstream changes that standardize the serialization of debug IDs in source maps. The main change involves serializing the debugId field using camelCase instead of snake_case (debug_id) while maintaining backward compatibility for deserialization.
Key changes:
- Introduced a new
DebugIdFieldstruct with custom deserialization logic that accepts bothdebugIdanddebug_id(with camelCase taking precedence), but always serializes asdebugId - Simplified encoder and decoder implementations by consolidating debug ID handling into the new field type
- Added comprehensive tests to verify camelCase serialization for both
SourceMapandSourceMapIndex
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/jsontypes.rs | Implements new DebugIdField struct with custom serde logic for backward-compatible deserialization and standardized camelCase serialization |
| src/encoder.rs | Updates SourceMap and SourceMapIndex encoders to use the new DebugIdField type, simplifying the code |
| src/decoder.rs | Simplifies debug ID extraction logic by using the new DebugIdField's Into conversion, and removes redundant test case |
| src/types.rs | Adjusts test data to swap order of debug_id and debugId fields to verify camelCase precedence behavior |
| tests/test_index.rs | Adds test ensuring SourceMapIndex serializes debug IDs using camelCase |
| tests/test_encoder.rs | Adds test ensuring SourceMap serializes debug IDs using camelCase |
| cli/Cargo.toml | Bumps version to 9.3.0 |
| CHANGELOG.md | Documents the new feature and other changes in version 9.3.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| /// This struct represents a `RawSourceMap`'s debug ID fields. | ||
| /// | ||
| /// The reason this exists as a seperate struct is so that we can have custom deserialization |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error: "seperate" should be "separate".
| /// The reason this exists as a seperate struct is so that we can have custom deserialization | |
| /// The reason this exists as a separate struct is so that we can have custom deserialization |
| /// This struct represents a `RawSourceMap`'s debug ID fields. | ||
| /// | ||
| /// The reason this exists as a seperate struct is so that we can have custom deserialization | ||
| /// logic, which can read both the legacy snake_case debug_id and the new camelCase debugId |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra whitespace: There are two spaces between "the" and "legacy" in the comment. Should be: "which can read both the legacy snake_case debug_id".
| /// logic, which can read both the legacy snake_case debug_id and the new camelCase debugId | |
| /// logic, which can read both the legacy snake_case debug_id and the new camelCase debugId |
No description provided.