diff --git a/package.json b/package.json index 548f9bea4..5652f61c9 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "babel-eslint": "^7.2.3", "babel-flow-types": "^1.2.2", "babel-jest": "^20.0.3", - "babel-macros": "^1.2.0", + "babel-plugin-macros": "^2.0.0", "babel-plugin-closure-elimination": "^1.3.0", "babel-plugin-codegen": "^1.2.0", "babel-plugin-external-helpers": "^6.22.0", diff --git a/packages/babel-plugin-emotion/README.md b/packages/babel-plugin-emotion/README.md index 1af93e902..b094e3c4d 100644 --- a/packages/babel-plugin-emotion/README.md +++ b/packages/babel-plugin-emotion/README.md @@ -306,7 +306,7 @@ from `createEmotion`, ## Babel Macros -Instead of using `babel-plugin-emotion`, you can use emotion with [`babel-macros`](https://github.com/kentcdodds/babel-macros). Add `babel-macros` to your babel config and import whatever you want from emotion but add `/macro` to the end. Currently every API except for the css prop is supported by the macro. +Instead of using `babel-plugin-emotion`, you can use emotion with [`babel-plugin-macros`](https://github.com/kentcdodds/babel-plugin-macros). Add `babel-plugin-macros` to your babel config and import whatever you want from emotion but add `/macro` to the end. Currently every API except for the css prop is supported by the macro. ```jsx import styled from 'react-emotion/macro' diff --git a/packages/babel-plugin-emotion/package.json b/packages/babel-plugin-emotion/package.json index e9433531b..33571534e 100644 --- a/packages/babel-plugin-emotion/package.json +++ b/packages/babel-plugin-emotion/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@babel/helper-module-imports": "7.0.0-beta.32", - "babel-macros": "^1.2.0", + "babel-plugin-macros": "^2.0.0", "babel-plugin-syntax-jsx": "^6.18.0", "convert-source-map": "^1.5.0", "emotion-utils": "^9.0.0-0", diff --git a/packages/babel-plugin-emotion/src/macro-styled.js b/packages/babel-plugin-emotion/src/macro-styled.js index fc26a2548..1bb8b1e02 100644 --- a/packages/babel-plugin-emotion/src/macro-styled.js +++ b/packages/babel-plugin-emotion/src/macro-styled.js @@ -5,7 +5,7 @@ import { } from './index' import { buildMacroRuntimeNode, omit } from './babel-utils' import emotionMacro from './macro' -import { createMacro } from 'babel-macros' +import { createMacro } from 'babel-plugin-macros' module.exports = createMacro(macro) diff --git a/packages/babel-plugin-emotion/src/macro.js b/packages/babel-plugin-emotion/src/macro.js index 7f8dfb8e2..c98b370c5 100644 --- a/packages/babel-plugin-emotion/src/macro.js +++ b/packages/babel-plugin-emotion/src/macro.js @@ -1,7 +1,7 @@ // @flow import { replaceCssWithCallExpression } from './index' import { buildMacroRuntimeNode, addRuntimeImports } from './babel-utils' -import { createMacro } from 'babel-macros' +import { createMacro } from 'babel-plugin-macros' module.exports = createMacro(macro) diff --git a/packages/babel-plugin-emotion/test/macro/.babelrc b/packages/babel-plugin-emotion/test/macro/.babelrc index 7d38c8f68..28db31f5c 100644 --- a/packages/babel-plugin-emotion/test/macro/.babelrc +++ b/packages/babel-plugin-emotion/test/macro/.babelrc @@ -4,7 +4,7 @@ "env", { "loose": true, - "exclude": ["transform-es2015-typeof-symbol"] + "exclude": ["transform-es2015-typeof-symbol"] } ], "stage-0", diff --git a/packages/babel-plugin-emotion/test/macro/babel-macros-register.js b/packages/babel-plugin-emotion/test/macro/babel-macros-register.js index 7392bae3f..7d9f2a998 100644 --- a/packages/babel-plugin-emotion/test/macro/babel-macros-register.js +++ b/packages/babel-plugin-emotion/test/macro/babel-macros-register.js @@ -6,4 +6,4 @@ require('module-alias').addAliases({ 'emotion/macro': path.join(__dirname, '../../src/macro') }) -module.exports = require('babel-macros') +module.exports = require('babel-plugin-macros') diff --git a/packages/babel-plugin-emotion/test/util.js b/packages/babel-plugin-emotion/test/util.js index 169cbcec6..9219503c6 100644 --- a/packages/babel-plugin-emotion/test/util.js +++ b/packages/babel-plugin-emotion/test/util.js @@ -97,7 +97,7 @@ const createMacroTester = transform => opts => { transform(opts.code, { plugins: [ [ - require('babel-macros'), + require('babel-plugin-macros'), { ...opts.opts } diff --git a/packages/benchmarks/package.json b/packages/benchmarks/package.json index 38225004d..21d3a7c27 100755 --- a/packages/benchmarks/package.json +++ b/packages/benchmarks/package.json @@ -17,7 +17,7 @@ }, "devDependencies": { "babel-loader": "^7.1.1", - "babel-macros": "^1.0.2", + "babel-plugin-macros": "^2.0.0", "babel-polyfill": "^6.26.0", "cli-chart": "^0.3.1", "cli-table": "^0.3.1", diff --git a/packages/benchmarks/webpack.config.js b/packages/benchmarks/webpack.config.js index 5ad6ebcf1..8ad8ef524 100755 --- a/packages/benchmarks/webpack.config.js +++ b/packages/benchmarks/webpack.config.js @@ -36,7 +36,7 @@ module.exports = { 'react', 'stage-0' ], - plugins: ['babel-macros'], + plugins: ['babel-plugin-macros'], cacheDirectory: true } } diff --git a/packages/emotion/README.md b/packages/emotion/README.md index e8d0cdca6..7f3f3b8eb 100644 --- a/packages/emotion/README.md +++ b/packages/emotion/README.md @@ -51,7 +51,7 @@ minimizes the runtime cost of css-in-js dramatically by parsing your styles with - [fontFace](https://github.com/emotion-js/emotion/tree/master/docs/font-face.md) - [injectGlobal](https://github.com/emotion-js/emotion/tree/master/docs/inject-global.md) -- [Usage with babel-macros](https://github.com/emotion-js/emotion/tree/master/docs/babel.md#usage-with-babel-macros) +- [Usage with babel-plugin-macros](https://github.com/emotion-js/emotion/tree/master/docs/babel.md#usage-with-babel-macros) - [Usage with Preact](https://github.com/emotion-js/emotion/tree/master/docs/preact.md) - Ecosystem diff --git a/yarn.lock b/yarn.lock index 246c13fb7..5ef26e842 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1378,7 +1378,7 @@ babel-loader@^7.1.1: loader-utils "^1.0.2" mkdirp "^0.5.1" -babel-macros@^1.0.0, babel-macros@^1.0.2: +babel-macros@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/babel-macros/-/babel-macros-1.0.2.tgz#04475889990243cc58a0afb5ea3308ec6b89e797" @@ -1453,6 +1453,12 @@ babel-plugin-jest-hoist@^21.2.0: version "21.2.0" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-21.2.0.tgz#2cef637259bd4b628a6cace039de5fcd14dbb006" +babel-plugin-macros@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.0.0.tgz#fd3aee135f7dec0b82898b7c8f1aed6fa75f9af9" + dependencies: + cosmiconfig "3.1.0" + babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95"