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

upgrade to babel-macros 1.0.0 #298

Merged
merged 3 commits into from Sep 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/babel-plugin-emotion/package.json
Expand Up @@ -15,6 +15,7 @@
"dependencies": {
"autoprefixer": "^7.1.2",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-macros": "^1.0.1",
"emotion-utils": "^7.2.2",
"postcss": "^6.0.9",
"postcss-js": "^1.0.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/babel-plugin-emotion/src/macro-styled.js
Expand Up @@ -5,8 +5,11 @@ import {
import { buildMacroRuntimeNode } from './babel-utils'
import emotionMacro from './macro'
import { omit } from 'emotion-utils'
import { createMacro } from 'babel-macros'

module.exports = function macro(options) {
module.exports = createMacro(macro)

function macro(options) {
const { references, state, babel: { types: t } } = options
if (!state.inline) state.inline = true
let referencesWithoutDefault = references
Expand Down
5 changes: 4 additions & 1 deletion packages/babel-plugin-emotion/src/macro.js
Expand Up @@ -4,8 +4,11 @@ import {
} from './index'
import { buildMacroRuntimeNode, addRuntimeImports } from './babel-utils'
import { forEach, keys } from 'emotion-utils'
import { createMacro } from 'babel-macros'

module.exports = function macro({ references, state, babel: { types: t } }) {
module.exports = createMacro(macro)

function macro({ references, state, babel: { types: t } }) {
if (!state.inline) state.inline = true
forEach(keys(references), referenceKey => {
if (referenceKey === 'injectGlobal') {
Expand Down