Skip to content
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

feat: Support debug ids #66

Merged
merged 5 commits into from
Jul 19, 2023
Merged

feat: Support debug ids #66

merged 5 commits into from
Jul 19, 2023

Conversation

loewenheim
Copy link
Contributor

This adds support for reading and writing debug ids in sourcemaps.

Question: Do we also want SourceMapIndex to be able to have a debug id?

Copy link
Member

@Swatinem Swatinem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also want SourceMapIndex to be able to have a debug id?

Probably not I would say.

@@ -49,6 +50,8 @@ pub struct RawSourceMap {
pub x_metro_module_paths: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub x_facebook_sources: FacebookSources,
#[serde(skip_serializing_if = "Option::is_none")]
pub debug_id: Option<DebugId>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the type is not #[non_exhaustive], but I believe it is not public so this should be fine.

src/types.rs Outdated Show resolved Hide resolved
@loewenheim loewenheim merged commit 70c51e4 into master Jul 19, 2023
4 checks passed
@loewenheim loewenheim deleted the feat/debugid branch July 19, 2023 11:16
Boshen pushed a commit to oxc-project/oxc that referenced this pull request Oct 7, 2024
The sourcemap [`debugId`
proposal](https://github.com/tc39/source-map/blob/main/proposals/debug-id.md)
adds globally unique build or debug IDs to source maps and generated
code, making build artifacts self-identifying.

Support for debug IDs was added to
[`rust-sourcemap`](getsentry/rust-sourcemap#66)
in 2023 and Sentry have made use of this to aid in matching up source
and sourcemap files without having to worry about path mismatches or
release versions.

I want to add debug ID support to Rolldown but it uses `oxc::sourcemap`
so it looks like I need to start here first!
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.

3 participants