Skip to content

Commit 5b99a84

Browse files
authored
Fixed an issue with the lack of /*#__PURE__*/ annotations before styled calls transformed from tagged template expressions (emotion-js#2799)
* Upgrade Babel-related dependencies * Fixed an issue with lack of PURE annotations on some styled nodes * Add changeset * add additional ignore line to flowconfig * try ignoring other package in flowconfig * Remove redundant code * reuse named variable in one of the calls
1 parent 1c32b04 commit 5b99a84

File tree

28 files changed

+1086
-2175
lines changed

28 files changed

+1086
-2175
lines changed

.changeset/eighty-bulldogs-ring.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@emotion/babel-plugin': patch
3+
---
4+
5+
Fixed an issue with the lack of `/*#__PURE__*/` annotations before styled calls transformed from tagged template expressions.

.flowconfig

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
.*/node_modules/graphql/.*
88
.*/node_modules/metro.*
99
.*/node_modules/@parcel/.*
10+
.*/node_modules/resolve/.*
1011

1112
[untyped]
1213
.*/node_modules/polished/.*

.flowconfig-ci

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
.*/node_modules/graphql/.*
88
.*/node_modules/metro.*
99
.*/node_modules/@parcel/.*
10-
10+
.*/node_modules/resolve/.*
1111

1212
[untyped]
1313
.*/node_modules/polished/.*
@@ -20,7 +20,6 @@
2020
[declarations]
2121
.*/node_modules/react-native/.*
2222

23-
2423
[options]
2524
server.max_workers=1
2625
sharedmemory.hash_table_pow=21

package.json

+12-15
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,17 @@
169169
}
170170
},
171171
"dependencies": {
172-
"@babel/core": "^7.13.10",
173-
"@babel/helper-module-imports": "^7.12.13",
174-
"@babel/plugin-proposal-class-properties": "^7.13.0",
175-
"@babel/plugin-syntax-jsx": "^7.12.13",
176-
"@babel/plugin-transform-flow-strip-types": "^7.13.0",
177-
"@babel/plugin-transform-react-jsx": "^7.12.17",
178-
"@babel/preset-env": "^7.13.10",
179-
"@babel/preset-flow": "^7.12.13",
180-
"@babel/preset-react": "^7.12.13",
181-
"@babel/register": "^7.13.8",
182-
"@babel/runtime": "^7.13.10",
172+
"@babel/core": "^7.18.5",
173+
"@babel/helper-module-imports": "^7.16.7",
174+
"@babel/plugin-proposal-class-properties": "^7.17.12",
175+
"@babel/plugin-syntax-jsx": "^7.17.12",
176+
"@babel/plugin-transform-flow-strip-types": "^7.17.12",
177+
"@babel/plugin-transform-react-jsx": "^7.17.12",
178+
"@babel/preset-env": "^7.18.2",
179+
"@babel/preset-flow": "^7.17.12",
180+
"@babel/preset-react": "^7.17.12",
181+
"@babel/register": "^7.17.7",
182+
"@babel/runtime": "^7.18.3",
183183
"@changesets/changelog-github": "^0.4.0",
184184
"@changesets/cli": "^2.16.0",
185185
"@manypkg/cli": "^0.19.1",
@@ -192,11 +192,8 @@
192192
"babel-eslint": "^10.1.0",
193193
"babel-flow-types": "^1.2.3",
194194
"babel-jest": "^27.4.5",
195-
"babel-plugin-add-basic-constructor-for-react-components": "^0.1.0",
196-
"babel-plugin-codegen": "^3.0.0",
197-
"babel-plugin-fix-dce-for-classes-with-statics": "^0.1.0",
195+
"babel-plugin-codegen": "^4.1.5",
198196
"babel-plugin-jsx-pragmatic": "^1.0.2",
199-
"babel-plugin-transform-define": "^1.3.0",
200197
"benchmark": "^2.1.4",
201198
"bolt-check": "^0.3.0",
202199
"bundlesize": "^0.13.2",

packages/babel-plugin-jsx-pragmatic/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"test:typescript": "exit 0"
1111
},
1212
"dependencies": {
13-
"@babel/plugin-syntax-jsx": "^7.12.13"
13+
"@babel/plugin-syntax-jsx": "^7.17.12"
1414
},
1515
"peerDependencies": {
1616
"@babel/core": "^7.0.0"
@@ -23,6 +23,6 @@
2323
"access": "public"
2424
},
2525
"devDependencies": {
26-
"@babel/core": "^7.13.10"
26+
"@babel/core": "^7.18.5"
2727
}
2828
}

packages/babel-plugin/__tests__/__snapshots__/index.js.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ import _styled from "@emotion/styled/base";
7171
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."; }
7272
7373
// @flow
74-
const MyComponent = _styled("div", process.env.NODE_ENV === "production" ? {
74+
const MyComponent = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
7575
target: "eck06en0"
7676
} : {
7777
target: "eck06en0",
@@ -327,7 +327,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
327327
import * as React from 'react';
328328
import { jsx } from '@emotion/react';
329329
const MyObject = {
330-
MyProperty: _styled("div", process.env.NODE_ENV === "production" ? {
330+
MyProperty: /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
331331
target: "erl9uiw0"
332332
} : {
333333
target: "erl9uiw0",

packages/babel-plugin/__tests__/__snapshots__/styled-requires-options.js.snap

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import _styled from "@emotion/styled/base";
1212
1313
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."; }
1414
15-
const Foo = _styled("h1", {
15+
const Foo = /*#__PURE__*/_styled("h1", {
1616
target: "eoxfmb00"
1717
})(process.env.NODE_ENV === "production" ? {
1818
name: "3sn2xs",
@@ -37,6 +37,7 @@ import _styled from "@emotion/styled/base";
3737
3838
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."; }
3939
40+
/*#__PURE__*/
4041
_styled("h1", {
4142
target: "e8evh370"
4243
})(process.env.NODE_ENV === "production" ? {

packages/babel-plugin/__tests__/__snapshots__/styled.js.snap

+25-24
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import _styled from "@emotion/styled/base";
5959
6060
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."; }
6161
62-
const SomeComponent = _styled("div", process.env.NODE_ENV === "production" ? {
62+
const SomeComponent = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
6363
target: "el9tp5g0"
6464
} : {
6565
target: "el9tp5g0",
@@ -125,6 +125,7 @@ import _styled from "@emotion/styled/base";
125125
126126
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."; }
127127
128+
/*#__PURE__*/
128129
_styled("div", {
129130
target: "e1jqiiye0"
130131
})(process.env.NODE_ENV === "production" ? {
@@ -172,7 +173,7 @@ import _styled from "@emotion/styled/base";
172173
173174
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."; }
174175
175-
const SomeComponent = _styled("div", process.env.NODE_ENV === "production" ? {
176+
const SomeComponent = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
176177
target: "e1i93zq73"
177178
} : {
178179
target: "e1i93zq73",
@@ -187,7 +188,7 @@ const SomeComponent = _styled("div", process.env.NODE_ENV === "production" ? {
187188
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
188189
});
189190
190-
let SomeOtherComponent = _styled("div", process.env.NODE_ENV === "production" ? {
191+
let SomeOtherComponent = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
191192
target: "e1i93zq72"
192193
} : {
193194
target: "e1i93zq72",
@@ -202,14 +203,14 @@ let SomeOtherComponent = _styled("div", process.env.NODE_ENV === "production" ?
202203
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
203204
});
204205
205-
let AnotherComponent = _styled("div", process.env.NODE_ENV === "production" ? {
206+
let AnotherComponent = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
206207
target: "e1i93zq71"
207208
} : {
208209
target: "e1i93zq71",
209210
label: "AnotherComponent"
210211
})(SomeComponent, "{color:green;}", SomeOtherComponent, "{color:green;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbXBvbmVudC1zZWxlY3Rvci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFRaUMiLCJmaWxlIjoiY29tcG9uZW50LXNlbGVjdG9yLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnXG5cbmNvbnN0IFNvbWVDb21wb25lbnQgPSBzdHlsZWQuZGl2YFxuICBjb2xvcjogaG90cGluaztcbmBcblxubGV0IFNvbWVPdGhlckNvbXBvbmVudCA9IHN0eWxlZC5kaXYoeyBjb2xvcjogJ2hvdHBpbmsnIH0pXG5cbmxldCBBbm90aGVyQ29tcG9uZW50ID0gc3R5bGVkLmRpdmBcbiAgJHtTb21lQ29tcG9uZW50fSB7XG4gICAgY29sb3I6IGdyZWVuO1xuICB9XG4gICR7U29tZU90aGVyQ29tcG9uZW50fSB7XG4gICAgY29sb3I6IGdyZWVuO1xuICB9XG5gXG5cbmxldCBPbmVMYXN0Q29tcG9uZW50ID0gc3R5bGVkLmRpdih7XG4gIFtTb21lQ29tcG9uZW50XToge1xuICAgIGNvbG9yOiAnZ3JlZW4nXG4gIH0sXG4gIFtTb21lT3RoZXJDb21wb25lbnRdOiB7XG4gICAgY29sb3I6ICdncmVlbidcbiAgfVxufSlcbiJdfQ== */"));
211212
212-
let OneLastComponent = _styled("div", process.env.NODE_ENV === "production" ? {
213+
let OneLastComponent = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
213214
target: "e1i93zq70"
214215
} : {
215216
target: "e1i93zq70",
@@ -251,7 +252,7 @@ styled('button', cfg)({})
251252
252253
import _styled from "@emotion/styled/base";
253254
254-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
255+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
255256
256257
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."; }
257258
@@ -312,7 +313,7 @@ let Avatar = styled.img\`
312313
313314
import _styled from "@emotion/styled/base";
314315
315-
let Avatar = _styled("img", process.env.NODE_ENV === "production" ? {
316+
let Avatar = /*#__PURE__*/_styled("img", process.env.NODE_ENV === "production" ? {
316317
target: "e9o8e9e0"
317318
} : {
318319
target: "e9o8e9e0",
@@ -340,7 +341,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
340341
/* eslint-disable react/jsx-pascal-case */
341342
import { jsx } from '@emotion/react';
342343
343-
let SomeComp = _styled("div", process.env.NODE_ENV === "production" ? {
344+
let SomeComp = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
344345
target: "e2dh5500"
345346
} : {
346347
target: "e2dh5500",
@@ -372,7 +373,7 @@ import _styled from "@emotion/styled/base";
372373
/** @jsx jsx */
373374
import { jsx } from '@emotion/react';
374375
let Comp;
375-
Comp = _styled("div", process.env.NODE_ENV === "production" ? {
376+
Comp = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
376377
target: "e16lswdj0"
377378
} : {
378379
target: "e16lswdj0",
@@ -405,7 +406,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
405406
import { jsx } from '@emotion/react';
406407
407408
class Thing {
408-
static SomeComponent = _styled("div", process.env.NODE_ENV === "production" ? {
409+
static SomeComponent = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
409410
target: "e1s9kmbj1"
410411
} : {
411412
target: "e1s9kmbj1",
@@ -419,7 +420,7 @@ class Thing {
419420
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxhYmVsLWNsYXNzLWZpZWxkcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLbUMiLCJmaWxlIjoibGFiZWwtY2xhc3MtZmllbGRzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqIEBqc3gganN4ICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcbmltcG9ydCB7IGpzeCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0J1xuXG5jbGFzcyBUaGluZyB7XG4gIHN0YXRpYyBTb21lQ29tcG9uZW50ID0gc3R5bGVkLmRpdmBcbiAgICBjb2xvcjogaG90cGluaztcbiAgYFxuICBCYWRJZGVhQ29tcG9uZW50ID0gc3R5bGVkLmRpdmBcbiAgICBiYWNrZ3JvdW5kOiBob3RwaW5rO1xuICBgXG59XG4iXX0= */",
420421
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
421422
});
422-
BadIdeaComponent = _styled("div", process.env.NODE_ENV === "production" ? {
423+
BadIdeaComponent = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
423424
target: "e1s9kmbj0"
424425
} : {
425426
target: "e1s9kmbj0",
@@ -453,20 +454,20 @@ import _styled from "@emotion/styled/base";
453454
/** @jsx jsx */
454455
import { jsx } from '@emotion/react';
455456
456-
const Timeline = _styled("ul", process.env.NODE_ENV === "production" ? {
457+
const Timeline = /*#__PURE__*/_styled("ul", process.env.NODE_ENV === "production" ? {
457458
target: "e1djkynu2"
458459
} : {
459460
target: "e1djkynu2",
460461
label: "Timeline"
461462
})(process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxhYmVsLW1lbWJlci1leHByZXNzaW9uLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUkwQiIsImZpbGUiOiJsYWJlbC1tZW1iZXItZXhwcmVzc2lvbi5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnXG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcblxuY29uc3QgVGltZWxpbmUgPSBzdHlsZWQudWxgYFxuVGltZWxpbmUuSXRlbSA9IHN0eWxlZC5saWBgXG5UaW1lbGluZS5JdGVtLkFuY2hvciA9IHN0eWxlZC5hYGBcbiJdfQ== */");
462463
463-
Timeline.Item = _styled("li", process.env.NODE_ENV === "production" ? {
464+
Timeline.Item = /*#__PURE__*/_styled("li", process.env.NODE_ENV === "production" ? {
464465
target: "e1djkynu1"
465466
} : {
466467
target: "e1djkynu1",
467468
label: "Timeline-Item"
468469
})(process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxhYmVsLW1lbWJlci1leHByZXNzaW9uLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUt5QiIsImZpbGUiOiJsYWJlbC1tZW1iZXItZXhwcmVzc2lvbi5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnXG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcblxuY29uc3QgVGltZWxpbmUgPSBzdHlsZWQudWxgYFxuVGltZWxpbmUuSXRlbSA9IHN0eWxlZC5saWBgXG5UaW1lbGluZS5JdGVtLkFuY2hvciA9IHN0eWxlZC5hYGBcbiJdfQ== */");
469-
Timeline.Item.Anchor = _styled("a", process.env.NODE_ENV === "production" ? {
470+
Timeline.Item.Anchor = /*#__PURE__*/_styled("a", process.env.NODE_ENV === "production" ? {
470471
target: "e1djkynu0"
471472
} : {
472473
target: "e1djkynu0",
@@ -497,7 +498,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
497498
/* eslint-disable react/jsx-pascal-case */
498499
import { jsx } from '@emotion/react';
499500
500-
const MiniCalWrap$ = _styled("div", process.env.NODE_ENV === "production" ? {
501+
const MiniCalWrap$ = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
501502
target: "elww2rn0"
502503
} : {
503504
target: "elww2rn0",
@@ -540,7 +541,7 @@ const H1 = styled.h1\`
540541
import _styled from "@emotion/styled/base";
541542
542543
// yes, this was actually a bug at one point
543-
const H1 = _styled("h1", process.env.NODE_ENV === "production" ? {
544+
const H1 = /*#__PURE__*/_styled("h1", process.env.NODE_ENV === "production" ? {
544545
target: "e1nqrpma0"
545546
} : {
546547
target: "e1nqrpma0",
@@ -566,7 +567,7 @@ import _styled from "@emotion/styled/base";
566567
567568
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."; }
568569
569-
const SomeComponent = _styled("div", process.env.NODE_ENV === "production" ? {
570+
const SomeComponent = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
570571
target: "eqhyoqt1"
571572
} : {
572573
target: "eqhyoqt1",
@@ -581,7 +582,7 @@ const SomeComponent = _styled("div", process.env.NODE_ENV === "production" ? {
581582
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
582583
});
583584
584-
const SomeOtherComponent = _styled("button", process.env.NODE_ENV === "production" ? {
585+
const SomeOtherComponent = /*#__PURE__*/_styled("button", process.env.NODE_ENV === "production" ? {
585586
target: "eqhyoqt0"
586587
} : {
587588
target: "eqhyoqt0",
@@ -656,7 +657,7 @@ import _styled from "@emotion/styled/base";
656657
657658
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."; }
658659
659-
const SomeComponent = _styled("div", process.env.NODE_ENV === "production" ? {
660+
const SomeComponent = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
660661
target: "eyr3fbm0"
661662
} : {
662663
target: "eyr3fbm0",
@@ -710,7 +711,7 @@ const SomeComponent = styled.div(props => ({ color: props.color }))
710711
711712
import _styled from "@emotion/styled/base";
712713
713-
const SomeComponent = _styled("div", process.env.NODE_ENV === "production" ? {
714+
const SomeComponent = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
714715
target: "e14okpby0"
715716
} : {
716717
target: "e14okpby0",
@@ -812,7 +813,7 @@ import _styled from "@emotion/styled/base";
812813
813814
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."; }
814815
815-
export const Comp = _styled("div", process.env.NODE_ENV === "production" ? {
816+
export const Comp = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
816817
target: "e1dl4grl0"
817818
} : {
818819
target: "e1dl4grl0",
@@ -841,7 +842,7 @@ const H1 = styled.h1({ fontSize })
841842
import _styled from "@emotion/styled/base";
842843
let fontSize = window.whatever;
843844
844-
const H1 = _styled("h1", process.env.NODE_ENV === "production" ? {
845+
const H1 = /*#__PURE__*/_styled("h1", process.env.NODE_ENV === "production" ? {
845846
target: "e4pkhyn0"
846847
} : {
847848
target: "e4pkhyn0",
@@ -896,7 +897,7 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
896897
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
897898
};
898899
899-
const H1 = _styled("h1", process.env.NODE_ENV === "production" ? {
900+
const H1 = /*#__PURE__*/_styled("h1", process.env.NODE_ENV === "production" ? {
900901
target: "e45grep0"
901902
} : {
902903
target: "e45grep0",
@@ -914,7 +915,7 @@ const H1 = styled.h1({ ...window.whatever })
914915
915916
import _styled from "@emotion/styled/base";
916917
917-
const H1 = _styled("h1", process.env.NODE_ENV === "production" ? {
918+
const H1 = /*#__PURE__*/_styled("h1", process.env.NODE_ENV === "production" ? {
918919
target: "e49hde00"
919920
} : {
920921
target: "e49hde00",

packages/babel-plugin/__tests__/disable-source-map/__snapshots__/index.js.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import _styled from "@emotion/styled/base";
3333
3434
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."; }
3535
36-
let Comp = _styled("div", process.env.NODE_ENV === "production" ? {
36+
let Comp = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
3737
target: "eggnygh0"
3838
} : {
3939
target: "eggnygh0",

packages/babel-plugin/__tests__/import-mapping/__snapshots__/import-mapping.js.snap

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ let SomeComp = nonDefaultStyled.div({ color: 'hotpink' })
8484
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."; }
8585
8686
import { nonDefaultStyled } from 'package-one';
87-
let SomeComp = nonDefaultStyled("div", process.env.NODE_ENV === "production" ? {
87+
let SomeComp = /*#__PURE__*/nonDefaultStyled("div", process.env.NODE_ENV === "production" ? {
8888
target: "e1dq5q4a0"
8989
} : {
9090
target: "e1dq5q4a0",
@@ -111,7 +111,7 @@ let SomeComp = someAlias.div({ color: 'hotpink' })
111111
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."; }
112112
113113
import { nonDefaultStyled as someAlias } from 'package-one';
114-
let SomeComp = someAlias("div", process.env.NODE_ENV === "production" ? {
114+
let SomeComp = /*#__PURE__*/someAlias("div", process.env.NODE_ENV === "production" ? {
115115
target: "erjjkeh0"
116116
} : {
117117
target: "erjjkeh0",
@@ -139,7 +139,7 @@ import { something as _styled } from "package-four/base";
139139
140140
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from \`css\` function. It isn't supposed to be used directly (e.g. as value of the \`className\` prop), but rather handed to emotion so it can handle it (e.g. as value of \`css\` prop)."; }
141141
142-
let SomeComp = _styled("div", process.env.NODE_ENV === "production" ? {
142+
let SomeComp = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
143143
target: "e16az05m0"
144144
} : {
145145
target: "e16az05m0",

0 commit comments

Comments
 (0)