This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Notable changes: * All official packages have moved under the `@babel/` namespace and in some cases further renamed, so package names adjusted accordingly. * `@babel/preset-env` now includes `@babel/plugin-transform-spread` and `@babel/plugin-transform-classes`, which are the Babel 7 renames of `babel-plugin-transform-object-rest-spread` and `babel-plugin-transform-es2015-classes`. * `@babel/preset-env`'s `useBuiltIns: true` mode has been renamed to `useBuiltIns: 'entry'` - which is equivalent. * `@babel/preset-react` now has `development` and `useBuiltIns` options, which we set appropriately: https://github.com/babel/babel/tree/v7.0.0-beta.46/packages/babel-preset-react#options * `babel-plugin-dynamic-import-node` is no longer required by `@neutrinojs/library` for target `node`, since webpack converts the dynamic import to a require itself. * `@neutrinojs/jest` required more substantial changes since: - the custom transformer used the now removed `canCompile()` from Babel's API. - `babel-preset-jest` is not fully compatible with Babel 7 (jestjs/jest#6126). * Several packages now have a peer dependency on `@babel/core`, so it's been added where necessary. * `babel-loader` has been updated to v8 for Babel 7 compatibility. * `@neutrinojs/vue`'s `babel-preset-vue` dependency doesn't appear to be used, but has been left as is pending #836. Closes #316.
- Loading branch information
Showing
36 changed files
with
841 additions
and
455 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
const babel = require('babel-core'); | ||
const { transform } = require('@babel/core'); | ||
|
||
module.exports = { | ||
// This is inspired by: | ||
// https://github.com/facebook/jest/blob/v22.4.2/packages/babel-jest/src/index.js#L105-L147 | ||
// And is required due to: | ||
// https://github.com/facebook/jest/issues/1468 | ||
// TODO: See if it would be easier to switch to the higher-level babel-jest, | ||
// and wrap that instead. | ||
process(src, filename, config) { | ||
return babel.util.canCompile(filename) ? | ||
babel.transform(src, Object.assign({}, { filename }, config.globals.BABEL_OPTIONS)).code : | ||
src; | ||
// Babel 7 returns null if the file was ignored. | ||
return transform( | ||
src, | ||
Object.assign({}, { filename }, config.globals.BABEL_OPTIONS) | ||
) || src; | ||
} | ||
}; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.