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

Accept source map input for the visitor #75

Merged
merged 2 commits into from
Dec 27, 2016

Conversation

jwbay
Copy link
Collaborator

@jwbay jwbay commented Dec 14, 2016

If a source map is explicitly passed, prefer that, otherwise try and pluck an inline source map that babel may have already parsed from the file content.

Counterpart to - https://github.com/istanbuljs/istanbul-lib-instrument/pull/23/files#diff-c07343828715f64179d26d4c237cb63c
Ref - istanbuljs-archived-repos/istanbul-lib-source-maps#4

Context - upstream PR for jestjs/jest#2290. Jest provides instrumentation using babel-plugin-istanbul, and currently there's disparity with source map support between createInstrumenter().instrumentSync() and this babel plugin. This PR resolves that so both approaches can thread a source map through and have it attached to coverage.

…ect.

If a source map is explicitly passed, prefer that, otherwise try and pluck an inline source map that babel may have already parsed from the file content.
@jwbay jwbay force-pushed the accept-source-map branch 2 times, most recently from 492c325 to a5efe28 Compare December 17, 2016 03:35
@coveralls
Copy link

coveralls commented Dec 17, 2016

Coverage Status

Coverage increased (+0.4%) to 95.652% when pulling a5efe28 on jwbay:accept-source-map into 7bd4eb8 on istanbuljs:master.

These can take up a lot of memory for large projects, especially if the original source is inlined into the source map.
@bcoe
Copy link
Member

bcoe commented Dec 27, 2016

@jwbay thanks a ton for the awesome contributions, I'm exited to see this make it upstream.

@bcoe bcoe merged commit 437e90b into istanbuljs:master Dec 27, 2016
@bcoe
Copy link
Member

bcoe commented Dec 27, 2016

@jwbay please take this for a spin:

npm cache clear; npm i babel-plugin-istanbul@next it pulls in your source-map work; let me know if testing goes well, and I'll promote it to the latest release.

@jwbay
Copy link
Collaborator Author

jwbay commented Dec 28, 2016

Tested and everything looks good 👍

@jwbay jwbay deleted the accept-source-map branch December 28, 2016 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants