-
Notifications
You must be signed in to change notification settings - Fork 42
feat(core): Add hook to customize source map file resolution #732
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
Merged
andreiborza
merged 3 commits into
getsentry:main
from
thecodewarrior:feature/resolve-source-map-hook
May 13, 2025
Merged
feat(core): Add hook to customize source map file resolution #732
andreiborza
merged 3 commits into
getsentry:main
from
thecodewarrior:feature/resolve-source-map-hook
May 13, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BoomchainLabs
approved these changes
May 2, 2025
andreiborza
reviewed
May 8, 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.
Hi, thanks so much for contributing this and the nice test suite!
lforst
reviewed
May 8, 2025
lforst
reviewed
May 8, 2025
lforst
reviewed
May 8, 2025
1. Added better debug logging around the `resolveSourceMap` hook invocation 2. Expanded the `resolveSourceMap` doc comment to include more detail and an example use case 3. Added `resolveSourceMap` documentation to `generate-documentation-table.ts` 4. Removed the feature-specific playground test previously added
andreiborza
approved these changes
May 13, 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.
Looking good, thanks for contributing this!
renovate bot
added a commit
to andrei-picus-tink/auto-renovate
that referenced
this pull request
May 24, 2025
| datasource | package | from | to | | ---------- | ------------------- | ----- | ----- | | npm | @sentry/vite-plugin | 3.4.0 | 3.5.0 | ## [v3.5.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#350) - feat(core): Add hook to customize source map file resolution ([#732](getsentry/sentry-javascript-bundler-plugins#732)) - fix(core): Avoid console output and telemetry init when plugins are disabled ([#741](getsentry/sentry-javascript-bundler-plugins#741)) Work in this release was contributed by [@thecodewarrior](https://github.com/thecodewarrior). Thank you for your contribution!
renovate bot
added a commit
to andrei-picus-tink/auto-renovate
that referenced
this pull request
May 24, 2025
| datasource | package | from | to | | ---------- | ------------------- | ----- | ----- | | npm | @sentry/vite-plugin | 3.4.0 | 3.5.0 | ## [v3.5.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#350) - feat(core): Add hook to customize source map file resolution ([#732](getsentry/sentry-javascript-bundler-plugins#732)) - fix(core): Avoid console output and telemetry init when plugins are disabled ([#741](getsentry/sentry-javascript-bundler-plugins#741)) Work in this release was contributed by [@thecodewarrior](https://github.com/thecodewarrior). Thank you for your contribution!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wasn't able to implement full integration tests for the sourcemap changes, but there's a smoke test in the playground and I added full unit tests for the function that performs the file resolution.
One of the only changes I made to the existing behavior is using
url.fileUrlToPath()
when thesourceMappingURL
is afile://
url. I added some additional debug logging to that method as well. Now when it fails to locate a sourcemap it prints all the locations it tried, and when it succeeds it prints out the source map it chose.Fixes #731