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

Optimize Babel output a little bit #1656

Merged
merged 11 commits into from
Jan 5, 2020
Next Next commit
Optimize Babel output a little bit
  • Loading branch information
Andarist committed Jan 1, 2020
commit 547c6a18da7426139d2dfa68d350626e5187eb0e
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ import { css } from 'emotion';
let cls =
/*#__PURE__*/
css(process.env.NODE_ENV === \\"production\\" ? {
name: \\"1rm02zb-CLS_CSS-REQUIRES-OPTIONS\\",
styles: \\"color:hotpink;;label:CLS_CSS-REQUIRES-OPTIONS;\\"
name: \\"3sn2xs\\",
styles: \\"color:hotpink\\"
} : {
name: \\"1rm02zb-CLS_CSS-REQUIRES-OPTIONS\\",
styles: \\"color:hotpink;;label:CLS_CSS-REQUIRES-OPTIONS;\\",
name: \\"kqb7lj\\",
styles: \\"color:hotpink;label:CLS_CSS-REQUIRES-OPTIONS\\",
map: \\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNzcy1yZXF1aXJlcy1vcHRpb25zLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVjIiwiZmlsZSI6ImNzcy1yZXF1aXJlcy1vcHRpb25zLmpzIiwic291cmNlc0NvbnRlbnQiOlsiXG4gICAgaW1wb3J0IHsgY3NzIH0gZnJvbSAnZW1vdGlvbidcbiAgICBsZXQgY2xzID0gY3NzKHtjb2xvcjonaG90cGluayd9KVxuICAgICJdfQ== */\\",
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
});"
Expand All @@ -104,11 +104,11 @@ import { css } from 'emotion';
let cls =
/*#__PURE__*/
css(process.env.NODE_ENV === \\"production\\" ? {
name: \\"mn0r3a-my-css-__tests__-css-requires-options-cls\\",
styles: \\"color:hotpink;;label:my-css-__tests__-css-requires-options-cls;\\"
name: \\"3sn2xs\\",
styles: \\"color:hotpink\\"
} : {
name: \\"mn0r3a-my-css-__tests__-css-requires-options-cls\\",
styles: \\"color:hotpink;;label:my-css-__tests__-css-requires-options-cls;\\",
name: \\"1rdgoa5\\",
styles: \\"color:hotpink;label:my-css-__tests__-css-requires-options-cls\\",
map: \\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNzcy1yZXF1aXJlcy1vcHRpb25zLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVjIiwiZmlsZSI6ImNzcy1yZXF1aXJlcy1vcHRpb25zLmpzIiwic291cmNlc0NvbnRlbnQiOlsiXG4gICAgaW1wb3J0IHsgY3NzIH0gZnJvbSAnZW1vdGlvbidcbiAgICBsZXQgY2xzID0gY3NzKHtjb2xvcjonaG90cGluayd9KVxuICAgICJdfQ== */\\",
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
});"
Expand All @@ -128,11 +128,11 @@ import { css } from 'emotion';
let cls =
/*#__PURE__*/
css(process.env.NODE_ENV === \\"production\\" ? {
name: \\"jnyc7-my-css-css-requires-options-cls\\",
styles: \\"color:hotpink;;label:my-css-css-requires-options-cls;\\"
name: \\"3sn2xs\\",
styles: \\"color:hotpink\\"
} : {
name: \\"jnyc7-my-css-css-requires-options-cls\\",
styles: \\"color:hotpink;;label:my-css-css-requires-options-cls;\\",
name: \\"g15qew\\",
styles: \\"color:hotpink;label:my-css-css-requires-options-cls\\",
map: \\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNzcy1yZXF1aXJlcy1vcHRpb25zLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVjIiwiZmlsZSI6ImNzcy1yZXF1aXJlcy1vcHRpb25zLmpzIiwic291cmNlc0NvbnRlbnQiOlsiXG4gICAgaW1wb3J0IHsgY3NzIH0gZnJvbSAnZW1vdGlvbidcbiAgICBsZXQgY2xzID0gY3NzKHtjb2xvcjonaG90cGluayd9KVxuICAgICJdfQ== */\\",
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
});"
Expand All @@ -152,11 +152,11 @@ import { css } from 'emotion';
let cls =
/*#__PURE__*/
css(process.env.NODE_ENV === \\"production\\" ? {
name: \\"v8qj0c-my-css-some-directory-cls\\",
styles: \\"color:hotpink;;label:my-css-some-directory-cls;\\"
name: \\"3sn2xs\\",
styles: \\"color:hotpink\\"
} : {
name: \\"v8qj0c-my-css-some-directory-cls\\",
styles: \\"color:hotpink;;label:my-css-some-directory-cls;\\",
name: \\"1p1qha0\\",
styles: \\"color:hotpink;label:my-css-some-directory-cls\\",
map: \\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVjIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiXG4gICAgaW1wb3J0IHsgY3NzIH0gZnJvbSAnZW1vdGlvbidcbiAgICBsZXQgY2xzID0gY3NzKHtjb2xvcjonaG90cGluayd9KVxuICAgICJdfQ== */\\",
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
});"
Expand All @@ -176,11 +176,11 @@ import { css } from 'emotion';
let cls =
/*#__PURE__*/
css(process.env.NODE_ENV === \\"production\\" ? {
name: \\"ryhvpw-my-css-cls\\",
styles: \\"color:hotpink;;label:my-css-cls;\\"
name: \\"3sn2xs\\",
styles: \\"color:hotpink\\"
} : {
name: \\"ryhvpw-my-css-cls\\",
styles: \\"color:hotpink;;label:my-css-cls;\\",
name: \\"1pmemk4\\",
Andarist marked this conversation as resolved.
Show resolved Hide resolved
styles: \\"color:hotpink;label:my-css-cls\\",
map: \\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNzcy1yZXF1aXJlcy1vcHRpb25zLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVjIiwiZmlsZSI6ImNzcy1yZXF1aXJlcy1vcHRpb25zLmpzIiwic291cmNlc0NvbnRlbnQiOlsiXG4gICAgaW1wb3J0IHsgY3NzIH0gZnJvbSAnZW1vdGlvbidcbiAgICBsZXQgY2xzID0gY3NzKHtjb2xvcjonaG90cGluayd9KVxuICAgICJdfQ== */\\",
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
});"
Expand Down Expand Up @@ -210,5 +210,5 @@ import { css } from '@emotion/core';
var templateObject_1;
const someVar =
/*#__PURE__*/
css(templateObject_1 || (templateObject_1 = __makeTemplateObject([\\"\\\\n color: hotpink;\\\\n;label:someVar;\\"], [\\"\\\\n color: hotpink;\\\\n;label:someVar;\\"])));"
css(templateObject_1 || (templateObject_1 = __makeTemplateObject(['\\\\n color: hotpink;\\\\n' + (process.env.NODE_ENV === \\"production\\" ? \\"\\" : \\";label:someVar\\")], ['\\\\n color: hotpink;\\\\n' + (process.env.NODE_ENV === \\"production\\" ? \\"\\" : \\";label:someVar\\")])));"
`;
166 changes: 83 additions & 83 deletions packages/babel-plugin-emotion/__tests__/__snapshots__/css.js.snap

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export default () => <Global styles={{ color: 'hotpink' }} />
import * as React from 'react';
import { Global } from '@emotion/core';
var _ref = {
name: \\"1lrxbo5\\",
styles: \\"color:hotpink;\\"
name: \\"3sn2xs\\",
styles: \\"color:hotpink\\"
};
export default (() => <Global styles={_ref} />);"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import * as React from 'react';
import { Global } from '@emotion/core';

var _ref = process.env.NODE_ENV === \\"production\\" ? {
name: \\"9n87fw\\",
styles: \\"color:hotpink;background-color:#fff;\\"
name: \\"9aoaei\\",
styles: \\"color:hotpink;background-color:#fff\\"
} : {
name: \\"9n87fw\\",
styles: \\"color:hotpink;background-color:#fff;\\",
name: \\"9aoaei\\",
styles: \\"color:hotpink;background-color:#fff\\",
map: \\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLWFycmF5LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUlVIiwiZmlsZSI6ImJhc2ljLWFycmF5LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0ICogYXMgUmVhY3QgZnJvbSAncmVhY3QnXG5pbXBvcnQgeyBHbG9iYWwgfSBmcm9tICdAZW1vdGlvbi9jb3JlJ1xuXG5leHBvcnQgZGVmYXVsdCAoKSA9PiAoXG4gIDxHbG9iYWwgc3R5bGVzPXtbeyBjb2xvcjogJ2hvdHBpbmsnIH0sIHsgYmFja2dyb3VuZENvbG9yOiAnI2ZmZicgfV19IC8+XG4pXG4iXX0= */\\",
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
};
Expand All @@ -44,11 +44,11 @@ import * as React from 'react';
import { Global } from '@emotion/core';

var _ref = process.env.NODE_ENV === \\"production\\" ? {
name: \\"1lrxbo5\\",
styles: \\"color:hotpink;\\"
name: \\"3sn2xs\\",
styles: \\"color:hotpink\\"
} : {
name: \\"1lrxbo5\\",
styles: \\"color:hotpink;\\",
name: \\"3sn2xs\\",
styles: \\"color:hotpink\\",
map: \\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2ljLW9iai5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHNkIiLCJmaWxlIjoiYmFzaWMtb2JqLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0ICogYXMgUmVhY3QgZnJvbSAncmVhY3QnXG5pbXBvcnQgeyBHbG9iYWwgfSBmcm9tICdAZW1vdGlvbi9jb3JlJ1xuXG5leHBvcnQgZGVmYXVsdCAoKSA9PiA8R2xvYmFsIHN0eWxlcz17eyBjb2xvcjogJ2hvdHBpbmsnIH19IC8+XG4iXX0= */\\",
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
};
Expand Down Expand Up @@ -120,11 +120,11 @@ import * as React from 'react';
import { Global, css } from '@emotion/core'; // this gets ignored by Global macro, but it tests that this combination doesn't crash or something

var _ref = process.env.NODE_ENV === \\"production\\" ? {
name: \\"1lrxbo5\\",
styles: \\"color:hotpink;\\"
name: \\"3sn2xs\\",
styles: \\"color:hotpink\\"
} : {
name: \\"1lrxbo5\\",
styles: \\"color:hotpink;\\",
name: \\"3sn2xs\\",
styles: \\"color:hotpink\\",
map: \\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNzcy11c2VkLWFzLXZhbHVlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUlxQyIsImZpbGUiOiJjc3MtdXNlZC1hcy12YWx1ZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCAqIGFzIFJlYWN0IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHsgR2xvYmFsLCBjc3MgfSBmcm9tICdAZW1vdGlvbi9jb3JlJ1xuXG4vLyB0aGlzIGdldHMgaWdub3JlZCBieSBHbG9iYWwgbWFjcm8sIGJ1dCBpdCB0ZXN0cyB0aGF0IHRoaXMgY29tYmluYXRpb24gZG9lc24ndCBjcmFzaCBvciBzb21ldGhpbmdcbmV4cG9ydCBkZWZhdWx0ICgpID0+IDxHbG9iYWwgc3R5bGVzPXtjc3MoeyBjb2xvcjogJ2hvdHBpbmsnIH0pfSAvPlxuIl19 */\\",
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
};
Expand Down Expand Up @@ -194,11 +194,11 @@ import * as React from 'react';
import { Global } from '@emotion/core'; // prettier-ignore

var _ref = process.env.NODE_ENV === \\"production\\" ? {
name: \\"1lrxbo5\\",
styles: \\"color:hotpink;\\"
name: \\"3sn2xs\\",
styles: \\"color:hotpink\\"
} : {
name: \\"1lrxbo5\\",
styles: \\"color:hotpink;\\",
name: \\"3sn2xs\\",
styles: \\"color:hotpink\\",
map: \\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndpdGgtY2xvc2luZy1lbGVtZW50LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUs2QiIsImZpbGUiOiJ3aXRoLWNsb3NpbmctZWxlbWVudC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlICovXG5pbXBvcnQgKiBhcyBSZWFjdCBmcm9tICdyZWFjdCdcbmltcG9ydCB7IEdsb2JhbCB9IGZyb20gJ0BlbW90aW9uL2NvcmUnXG5cbi8vIHByZXR0aWVyLWlnbm9yZVxuZXhwb3J0IGRlZmF1bHQgKCkgPT4gPEdsb2JhbCBzdHlsZXM9e3sgY29sb3I6ICdob3RwaW5rJyB9fT48L0dsb2JhbD5cbiJdfQ== */\\",
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
};
Expand Down
Loading