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

Use the real sourcemap API and handle input sourcemaps - fixes T7259 #3456

Merged
merged 1 commit into from Sep 20, 2016

Conversation

loganfsmyth
Copy link
Member

This does two things:

  1. Use the public .addMappingAPI instead manually accessing ._mappings
  2. Pass sourceFileName to set the source value on the sourcemaps generated by Babel, rather than overriding the values.

2 here is a behavior change / new feature depending on how you look at it. It means input sourcemaps will actually work. Before, if you had an input sourcemap, we would basically use the mappings from it, but then discard them and pretend the mapping was actually for the JS file given to Babel to compile, which would produce incorrect final sourcemaps.

The dramatic size reduction in the test output file in this example is actually because of our use of result.actual, because it contained an input sourcemap, and at this stage it was not stripped out. By relying on Babel to set the source name and content, we allow Babel's internal logic to strip off the input sourcemap properly.

@codecov-io
Copy link

codecov-io commented Apr 8, 2016

Current coverage is 85.79%

Merging #3456 into master will decrease coverage by 1.90%

  1. 8 files (not in diff) in ...ypes/lib/definitions were modified. more
    • Misses -4
    • Partials +13
    • Hits +8
  2. 7 files (not in diff) in ...ages/babel-types/lib were modified. more
    • Misses -41
    • Partials +40
    • Hits -134
  3. 3 files (not in diff) in ...l-traverse/lib/scope were modified. more
    • Misses +88
    • Partials +26
    • Hits +417
  4. 3 files (not in diff) in ...raverse/lib/path/lib were modified. more
    • Misses -1
    • Partials +11
    • Hits +84
  5. 3 files (not in diff) in ...e/lib/path/inference were modified. more
    • Misses -3
    • Partials +20
    • Hits -21
  6. 11 files (not in diff) in ...el-traverse/lib/path were modified. more
    • Misses -22
    • Partials +80
    • Hits -6
  7. 5 files (not in diff) in ...s/babel-traverse/lib were modified. more
    • Misses -13
    • Partials +17
    • Hits +55
  8. 2 files (not in diff) in ...s/babel-register/lib were modified. more
    • Misses +1
    • Partials +11
    • Hits +2
  9. 7 files (not in diff) in ...form-regenerator/lib were modified. more
    • Misses -17
    • Partials +33
    • Hits -29
  10. 4 files (not in diff) in ...s2015-parameters/lib were modified. more
    • Misses -3
    • Partials +5
    • Hits +39
@@             master   #3456   diff @@
=======================================
  Files           193     197      +4   
  Lines          9384   12171   +2787   
  Methods        1068       0   -1068   
  Branches       2161    2501    +340   
=======================================
+ Hits           8229   10442   +2213   
- Misses         1155    1206     +51   
- Partials          0     523    +523   

Powered by Codecov. Last updated by 85ec783...fd21e7b

@hzoo hzoo added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Apr 16, 2016
@hzoo hzoo added this to the 6.6.x milestone Apr 16, 2016
@hzoo hzoo merged commit 46eb99b into babel:master Sep 20, 2016
@loganfsmyth loganfsmyth deleted the use-sourcemap-api branch November 28, 2016 04:56
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 7, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants