{{ message }}
Repository navigation
fix(ngcc): handle missing sources and out of range mappings when flattening source-maps - #35718
Closed
petebacondarwin wants to merge 4 commits into
Closed
petebacondarwin wants to merge 4 commits into
petebacondarwin wants to merge 4 commits into
Conversation
petebacondarwin
force-pushed
the
ngcc-source-map-regression
branch
from
February 27, 2020 13:11
5eda8d1 to
fc0e704
Compare
petebacondarwin
marked this pull request as ready for review
February 27, 2020 14:15
Contributor
Author
JoostK
reviewed
Feb 27, 2020
alxhub
approved these changes
Feb 27, 2020
Member
|
BTW, it would be a good idea to run this against angular/ngcc-validation before merging to make sure there are no other regressions. |
If a package has a source-map but it does not provide the actual content of the sources, then the source-map flattening was crashing. Now we ignore such mappings that have no source since we are not able to compute the merged mapping if there is no source file. Fixes angular#35709
…-maps Previously when rendering flattened source-maps, it was assumed that no mapping would come from a line that is outside the lines of the actual source content. It turns out this is not a valid assumption. Now the code that renders flattened source-maps will handle such mappings, with the additional benefit that the rendered source-map will only contain mapping lines up to the last mapping, rather than a mapping line for every content line. Fixes angular#35709
petebacondarwin
force-pushed
the
ngcc-source-map-regression
branch
from
February 27, 2020 19:50
ef877a2 to
9ae9237
Compare
Contributor
Author
|
Addressed the feedback. Now checking it against ngcc-validation repo. ngcc-vaildation repo test was green: https://app.circleci.com/github/angular/ngcc-validation/pipelines?branch=pull%2F943 |
JoostK
reviewed
Feb 27, 2020
Source-maps in the wild could be badly formatted, causing the source-map flattening processing to fail unexpectedly. Rather than causing the whole of ngcc to crash, we gracefully fallback to just returning the generated source-map instead.
petebacondarwin
force-pushed
the
ngcc-source-map-regression
branch
from
February 27, 2020 20:38
9ae9237 to
b60e604
Compare
JoostK
approved these changes
Feb 27, 2020
matsko
pushed a commit
that referenced
this pull request
Feb 27, 2020
…-maps (#35718) Previously when rendering flattened source-maps, it was assumed that no mapping would come from a line that is outside the lines of the actual source content. It turns out this is not a valid assumption. Now the code that renders flattened source-maps will handle such mappings, with the additional benefit that the rendered source-map will only contain mapping lines up to the last mapping, rather than a mapping line for every content line. Fixes #35709 PR Close #35718
matsko
pushed a commit
that referenced
this pull request
Feb 27, 2020
…-maps (#35718) Previously when rendering flattened source-maps, it was assumed that no mapping would come from a line that is outside the lines of the actual source content. It turns out this is not a valid assumption. Now the code that renders flattened source-maps will handle such mappings, with the additional benefit that the rendered source-map will only contain mapping lines up to the last mapping, rather than a mapping line for every content line. Fixes #35709 PR Close #35718
2 of 15 tasks
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

This PR has two commits that fix issues with source-maps that are badly formatted.
If a package has a source-map but it does not provide the actual content of the sources, then the source-map flattening was crashing.
Now we ignore such mappings that have no source since we are not able to compute the merged mapping if there is no source file.
Previously when rendering flattened source-maps, it was assumed that no mapping would come from a line that is outside the lines of the actual source content. It turns out this is not a valid assumption.
Now the code that renders flattened source-maps will handle such mappings, with the additional benefit that the rendered source-map will only contain mapping lines up to the last mapping, rather than a mapping line for every content line.
Fixes #35709