-
-
Notifications
You must be signed in to change notification settings - Fork 222
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(sourcemaps): Check for release or debug ids before upload #1561
Conversation
I would test it in the following way:
|
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.
LGTM
Co-authored-by: Riccardo Busetti <riccardob36@gmail.com>
Locally running this has raised a question: what should happen if a minified file points to a source file that can't be found on the local file system? Should that raise a warning for a missing debug id? |
If you mean that it points to an invalid location for the sourcemap, I would also consider this as an "injection" failure and we could warn the user. |
I know those are fixtures, but what's inside them is mostly irrelevant to us. Can we make them smaller than 50k LoC? 😅 |
Fair point, yes ^^ |
This should take care of #1547.
Unfortunately, it requires a significant refactoring of
SourceMapProcessor
. Parts ofadd_sourcemap_references
andinject_debug_ids
have been extracted into a new methodcollect_sourcemap_references
that collects the sourcemap files referenced from minified sources into a map saved in the processor. This method is called fromflush_pending_sources
. There is still some duplication of the logic inunpack_ram_bundle
which could probably be subsumed into this, but I'm not confident I can do it correctly.I decided to bail with an error if no files have debug ids and use
warn!
if only some of them do. I think these choices and the error messages are still up for debate, though.Also: any idea how we could test this?