Skip to content

Comments

feat(sourcemap): Add support for injecting Debug IDs #2516

Merged
hyf0 merged 5 commits intorolldown:mainfrom
timfish:feat/debug-ids
Oct 31, 2024
Merged

feat(sourcemap): Add support for injecting Debug IDs #2516
hyf0 merged 5 commits intorolldown:mainfrom
timfish:feat/debug-ids

Conversation

@timfish
Copy link
Contributor

@timfish timfish commented Oct 28, 2024

Adds support for injecting debug IDs into source files and sourcemaps as per the TC39 proposal.

@IWANABETHATGUY
Copy link
Member

Cool, but it seems the proposal only reached stage one, we would like to merge it once the proposal is stable.

@hyf0
Copy link
Member

hyf0 commented Oct 29, 2024

Is this feature supported in practice already? Does the maintain toolchain support this feature? If so, it's ok to merge it.

@timfish
Copy link
Contributor Author

timfish commented Oct 29, 2024

Is this feature supported in practice already?

  • Sentry users have been relying on debug ids in production for a number of years. Sentry process hundreds of millions of files per month containing debug ids
  • Bun added debug id injection to it's bundler when they added sourcemap support
  • A Github search suggests they are also used by Backtrace and Expo

Does the maintain toolchain support this feature?

I recently added the required support to oxc::sourcemap.

We've published bundler plugins and polyfills but in the long run it's more efficient to implement directly in each bundler since most already have an internal hashing mechanism that can be used. There's no point hashing every source file twice!

This PR still requires tests but I just wanted to confirm this would likely be merged before spending the extra time!

@yyx990803
Copy link
Member

@timfish thanks for the PR and the context - I think this is good to have, assuming debug IDs will just be ignored by tools that don't support them.

@netlify
Copy link

netlify bot commented Oct 29, 2024

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 956cf60
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/67210b2adbdacf0008127bbe

@timfish timfish marked this pull request as ready for review October 30, 2024 14:35
@hyf0 hyf0 enabled auto-merge October 31, 2024 06:56
@hyf0 hyf0 disabled auto-merge October 31, 2024 06:56
@hyf0 hyf0 changed the title feat: Add support for injecting Debug IDs feat(sourcemap): Add support for injecting Debug IDs Oct 31, 2024
Copy link
Member

@hyf0 hyf0 left a comment

Choose a reason for hiding this comment

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

Thanks

@hyf0 hyf0 added this pull request to the merge queue Oct 31, 2024
Merged via the queue into rolldown:main with commit 0f1e936 Oct 31, 2024
@timfish timfish deleted the feat/debug-ids branch January 6, 2025 16:01
github-merge-queue bot pushed a commit that referenced this pull request Mar 1, 2025
<!-- Thank you for contributing! -->

### Description

#2516 implemented sourcemap debug IDs but it's not exposed to the CLI or
`OutputOptions`. This PR fixes this.

By the way, it seems like
`packages/rollup-tests/test/misc/optionList.js` is not used, do you want
me to delete it?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants