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

Upgrading to babel 7 - Take II #5151

Merged
merged 6 commits into from
Sep 25, 2018
Merged

Upgrading to babel 7 - Take II #5151

merged 6 commits into from
Sep 25, 2018

Conversation

dennisoelkers
Copy link
Member

Description

Motivation and Context

This change is upgrading Babel to the most recent version. It involves bumping dependency versions and changing preset/plugin names. Due to stricter import checking, a minor issue with an import in the OutputList was noticed and fixed.

Additionally to the changes in #5129 (which were reverted in #5146), this PR also includes:

  • A rename of .babelrc to babel.config.js to enable running tests in plugins while importing modules from core (9ec6c86)
  • Configuring env preset to emit cjs modules, to allow add-module-exports to add default-less exports for CommonJS-imports (using require())

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Due to a change in Babel 7 that affects resolution of babel configs[1]
(`.babelrc` is now a hierarchical config, while `babel.config.js` is
not), source files outside of the source root of jest will not be
transpiled. That means, plugins running tests were not able to
require/import source files of core.

With this change, `.babelrc` will be renamed to `babel.config.js`, so it
is still used when a plugin imports a file from core.

[1]: jestjs/jest#6053 (comment)
@dennisoelkers dennisoelkers added this to the 3.0.0 milestone Sep 25, 2018
@dennisoelkers dennisoelkers requested a review from kmerz September 25, 2018 08:27
@dennisoelkers dennisoelkers changed the title Upgrading to babel 7 take 2 Upgrading to babel 7 - Take II Sep 25, 2018
@kmerz kmerz merged commit fce7366 into master Sep 25, 2018
@kmerz kmerz deleted the upgrading-to-babel-7-take-2 branch September 25, 2018 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants