add sourceUrl content to source infos for parsed source maps #195
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.
While
sourceContent
is an optional source map field, it is required for certain behaviors since it's the only field that is used to populate#sourceInfos
/#sourceInfoByURL
that serves as a source-map-to-source-content mapping for source maps.This creates issues with legitimate source maps that omit
sourceContent
and providesource
urls instead. e.g. see the description for this bug that I've just fixed on React Native's Metro Hot Reload where the code that checks if source maps are compatible with each other fails to recognize they are not compatible, unlesssourceContent
is provided, thus adding source maps for files instead of replacing them for files with different source code.I don't have the context on what's the full correct solution, but essentially, I think
#sourceInfos
/#sourceInfoByURL
should be populated with the contents of source files fetched fromsources
ifsourceContent
is missing.