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

Export Babel's environment #5448

merged 1 commit into from Mar 14, 2017


None yet
3 participants

xtuc commented Mar 11, 2017

Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature? y
Spec Compliancy?
Tests Added/Pass? n/y
Fixed Tickets
License MIT
Doc PR
Dependency Changes

I think it could be interesseting to expose Babel's environment. Also avoids duplicated code. See comment in #5411 (comment)

Note that we need a function to avoid caching the value since tests mutate the process.env.BABEL_ENV.

Babel's core version is also exported.


This comment has been minimized.

mention-bot commented Mar 11, 2017

@xtuc, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jamestalmage, @hzoo and @existentialism to be potential reviewers.


This comment has been minimized.

codecov bot commented Mar 11, 2017

Codecov Report

Merging #5448 into 7.0 will decrease coverage by 0.02%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##              7.0    #5448      +/-   ##
- Coverage   85.41%   85.39%   -0.03%     
  Files         203      204       +1     
  Lines        9525     9529       +4     
  Branches     2703     2705       +2     
+ Hits         8136     8137       +1     
- Misses        902      905       +3     
  Partials      487      487
Impacted Files Coverage Δ
packages/babel-core/src/index.js 58.82% <ø> (ø)
.../transformation/file/options/build-config-chain.js 93.87% <100%> (ø)
packages/babel-core/src/helpers/environment.js 100% <100%> (ø)
packages/babel-register/src/node.js 76.56% <100%> (ø)
packages/babel-helper-call-delegate/src/index.js 64% <0%> (-4%)
packages/babel-traverse/src/path/modification.js 73.78% <0%> (-0.98%)
packages/babel-traverse/src/path/context.js 85.34% <0%> (-0.87%)
...bel-plugin-transform-es2015-classes/src/vanilla.js 90.17% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 01b250a...d328af0. Read the comment docs.


This comment has been minimized.


loganfsmyth commented Mar 12, 2017

I'm fine with this to help that PR, though with #5372 I'd honestly love to internalize more of the caching into babel-core, so we could avoid exposing implementation details like this.


This comment has been minimized.


xtuc commented Mar 14, 2017

I'm merging this since it hasn't a big impact (tests passed). It just avoids duplicated code for now.

@xtuc xtuc merged commit 0bc802c into babel:7.0 Mar 14, 2017

3 checks passed

codecov/patch 100% of diff hit (target 85.41%)
codecov/project Absolute coverage decreased by -0.02% but relative coverage increased by +14.58% compared to 01b250a
continuous-integration/travis-ci/pr The Travis CI build passed

@xtuc xtuc deleted the xtuc:feat-expose-env-core branch Mar 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment