Skip to content

Commit 9e3671c

Browse files
Andaristemmatown
andauthored
Remove the runtime option from @emotion/babel-preset-css-prop (emotion-js#2076)
* Remove `runtime` option from `@emotion/babel-preset-css-prop` * Update .changeset/weak-pears-design.md * Update packages/babel-preset-css-prop/src/index.js Co-authored-by: Mitchell Hamilton <mitchell@hamil.town>
1 parent 30ddee1 commit 9e3671c

15 files changed

+34
-830
lines changed

.changeset/weak-pears-design.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/babel-preset-css-prop': major
3+
---
4+
5+
Removed `runtime` option that was introduced to this preset and deprecated shortly after that. If you want to configure `runtime: "automatic"`, replace `@emotion/babel-preset-css-prop` with `@babel/preset-react` and `@emotion/babel-plugin`. You can find out how to configure things properly here: https://emotion.sh/docs/css-prop#babel-preset

babel.config.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,20 @@ module.exports = api => {
3434
filename &&
3535
isTestFile(filename) &&
3636
filename.includes('automatic-runtime'),
37-
presets: [[emotionDevPreset, { runtime: 'automatic' }]]
37+
presets: [
38+
[emotionDevPreset, { runtime: 'automatic', useEmotionPlugin: true }]
39+
]
3840
},
3941
{
4042
test: filename =>
4143
filename &&
4244
isTestFile(filename) &&
4345
filename.includes('automatic-dev-runtime'),
4446
presets: [
45-
[emotionDevPreset, { runtime: 'automatic', development: true }]
47+
[
48+
emotionDevPreset,
49+
{ runtime: 'automatic', development: true, useEmotionPlugin: true }
50+
]
4651
]
4752
}
4853
]

packages/babel-preset-css-prop/__tests__/__fixtures__/fragment.js

-8
This file was deleted.

packages/babel-preset-css-prop/__tests__/__fixtures__/key-after-spread.js

-17
This file was deleted.

packages/babel-preset-css-prop/__tests__/__fixtures__/no-static-children.js

-10
This file was deleted.

packages/babel-preset-css-prop/__tests__/__fixtures__/static-children.js

-11
This file was deleted.

packages/babel-preset-css-prop/__tests__/__snapshots__/automatic-runtime-dev.js.snap

-233
This file was deleted.

0 commit comments

Comments
 (0)