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

Add support for sourcemap debug IDs #3989

Open
timfish opened this issue Nov 26, 2024 · 2 comments
Open

Add support for sourcemap debug IDs #3989

timfish opened this issue Nov 26, 2024 · 2 comments

Comments

@timfish
Copy link

timfish commented Nov 26, 2024

Debug IDs are detailed in the TC39 proposal.

Debug IDs are unique IDs generated from a deterministic hash of the source code which are then injected/included in both source and sourcemap. They can be used to easily identify the correct sourcemaps in production.

I've recently added support for injecting debug IDs to webpack, Rollup, and Rolldown and wanted to get them working in esbuild too but I don't really know Go yet!

@evanw
Copy link
Owner

evanw commented Dec 19, 2024

Thanks for the heads up. However, it looks like it's only at stage 2, which is defined as "There is a very high risk of incompatible changes, so they should not be exposed to production users." So it sounds like it's not ready to implement yet.

@timfish
Copy link
Author

timfish commented Dec 22, 2024

Thanks for the response, totally understand.

It's worth noting that the proposal is in two parts:

  • Debug ID in magic comment in source linked with debugId key in sourcemap json
  • JavaScript API to allow access to debug ID magic comment at runtime

While the runtime JavaScript API still has a high risk of changes, the source comments and linked with sourcemap key are not likely to change and are already used in millions of production deployments and have been implemented in other bundlers.

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

No branches or pull requests

2 participants