Skip to content

Commit

Permalink
Remove usage of JSX pragma (/** @jsx jsx */) + add babel support for …
Browse files Browse the repository at this point in the history
…the Emotion "css" props (@emotion/babel-preset-css-prop) - See vercel/next.js#18461 (comment)
  • Loading branch information
Vadorequest committed Oct 30, 2020
1 parent e39c13a commit f874e94
Show file tree
Hide file tree
Showing 73 changed files with 107 additions and 229 deletions.
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['next/babel', '@emotion/babel-preset-css-prop'],
};
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@
"next-with-apollo": "5.0.1",
"prop-types": "15.7.2",
"rc-tooltip": "5.0.0",
"react": "16.13.1",
"react": "17.0.1",
"react-apollo": "3.1.5",
"react-code-blocks": "0.0.8",
"react-dom": "16.13.1",
"react-dom": "17.0.1",
"react-i18next": "11.7.2",
"react-style-proptype": "3.2.2",
"reactstrap": "8.5.1",
Expand All @@ -147,6 +147,7 @@
"winston": "3.2.1"
},
"devDependencies": {
"@emotion/babel-preset-css-prop": "10.0.27",
"@next/bundle-analyzer": "9.5.3",
"@svgr/cli": "5.4.0",
"@types/amplitude-js": "5.11.0",
Expand Down
6 changes: 1 addition & 5 deletions src/components/ComponentTemplate.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import React from 'react';

import Text from './utils/Text';
Expand Down
6 changes: 1 addition & 5 deletions src/components/animations/Loader.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import React from 'react';

import AnimatedLoader from '../svg/AnimatedLoader';
Expand Down
2 changes: 0 additions & 2 deletions src/components/appBootstrap/BrowserPageBootstrap.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/** @jsx jsx */
import {
Amplitude,
AmplitudeProvider,
} from '@amplitude/react-amplitude';
import { jsx } from '@emotion/core';
import * as Sentry from '@sentry/node';
import { createLogger } from '@unly/utils-simple-logger';
import { AmplitudeClient } from 'amplitude-js';
Expand Down
2 changes: 0 additions & 2 deletions src/components/appBootstrap/MultiversalGlobalStyles.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/** @jsx jsx */
import {
css,
Global,
jsx,
} from '@emotion/core';

import {
Expand Down
2 changes: 0 additions & 2 deletions src/components/appBootstrap/ServerPageBootstrap.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import * as Sentry from '@sentry/node';
import { createLogger } from '@unly/utils-simple-logger';
import React from 'react';
Expand Down
2 changes: 0 additions & 2 deletions src/components/assets/Logo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import styled from '@emotion/styled';
import classnames from 'classnames';
import deepmerge from 'deepmerge';
Expand Down
2 changes: 0 additions & 2 deletions src/components/data/AllProducts.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import filter from 'lodash.filter';
import React from 'react';

Expand Down
6 changes: 1 addition & 5 deletions src/components/data/ProductRow.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import React from 'react';
import {
Col,
Expand Down
6 changes: 1 addition & 5 deletions src/components/data/Products.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import map from 'lodash.map';
import React from 'react';
import { Container } from 'reactstrap';
Expand Down
2 changes: 0 additions & 2 deletions src/components/doc/BuiltInFeaturesSection.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import React from 'react';
import {
Alert,
Expand Down
2 changes: 0 additions & 2 deletions src/components/doc/BuiltInFeaturesSidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import map from 'lodash.map';
import {
NextRouter,
Expand Down
2 changes: 0 additions & 2 deletions src/components/doc/BuiltInUtilitiesSection.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import React from 'react';
import {
Button,
Expand Down
2 changes: 0 additions & 2 deletions src/components/doc/BuiltInUtilitiesSidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import map from 'lodash.map';
import {
NextRouter,
Expand Down
6 changes: 1 addition & 5 deletions src/components/doc/DocPage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import React, { ReactNode } from 'react';

type Props = {
Expand Down
6 changes: 1 addition & 5 deletions src/components/doc/DocSection.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import React, { ReactNode } from 'react';

type Props = {
Expand Down
2 changes: 0 additions & 2 deletions src/components/doc/ExternalFeaturesSection.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import React from 'react';
import {
Alert,
Expand Down
6 changes: 1 addition & 5 deletions src/components/doc/IntroductionSection.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import React from 'react';
import {
Alert,
Expand Down
2 changes: 0 additions & 2 deletions src/components/doc/NativeFeaturesSection.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import React from 'react';
import {
Alert,
Expand Down
2 changes: 0 additions & 2 deletions src/components/doc/NativeFeaturesSidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import map from 'lodash.map';
import {
NextRouter,
Expand Down
6 changes: 1 addition & 5 deletions src/components/doc/SidebarFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import React from 'react';
import { useTranslation } from 'react-i18next';
Expand Down
6 changes: 1 addition & 5 deletions src/components/doc/SidebarToggle.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import React from 'react';

Expand Down
6 changes: 1 addition & 5 deletions src/components/errors/DefaultErrorLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import * as Sentry from '@sentry/node';
import * as React from 'react';
import { Button } from 'reactstrap';
Expand Down
6 changes: 1 addition & 5 deletions src/components/errors/ErrorDebug.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import * as React from 'react';

type Props = {
Expand Down
6 changes: 1 addition & 5 deletions src/components/i18n/I18nBtnChangeLocale.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import { useTheme } from 'emotion-theming';
import startsWith from 'lodash.startswith';
import {
Expand Down
2 changes: 0 additions & 2 deletions src/components/pageLayouts/DefaultLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/** @jsx jsx */
import {
Amplitude,
LogOnMount,
} from '@amplitude/react-amplitude';
import { jsx } from '@emotion/core';
import { createLogger } from '@unly/utils-simple-logger';
import classnames from 'classnames';
import {
Expand Down
6 changes: 1 addition & 5 deletions src/components/pageLayouts/DefaultPageContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import classnames from 'classnames';
import { useTheme } from 'emotion-theming';
import React from 'react';
Expand Down
6 changes: 1 addition & 5 deletions src/components/pageLayouts/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import { useTheme } from 'emotion-theming';
import React from 'react';
import { useTranslation } from 'react-i18next';
Expand Down
6 changes: 1 addition & 5 deletions src/components/pageLayouts/Nav.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
/** @jsx jsx */
import { Amplitude } from '@amplitude/react-amplitude';
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import classnames from 'classnames';
import kebabCase from 'lodash.kebabcase';
Expand Down
6 changes: 1 addition & 5 deletions src/components/pageLayouts/PreviewModeBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import {
NextRouter,
Expand Down
6 changes: 1 addition & 5 deletions src/components/utils/Cards.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import classnames from 'classnames';
import React, { ReactNode } from 'react';
import { CardDeck } from 'reactstrap';
Expand Down
2 changes: 0 additions & 2 deletions src/components/utils/Code.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import React from 'react';
import {
CodeBlock,
Expand Down
2 changes: 0 additions & 2 deletions src/components/utils/ExternalLink.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import React from 'react';

type Props = {
Expand Down
2 changes: 0 additions & 2 deletions src/components/utils/Markdown.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import * as Sentry from '@sentry/node';
import { createLogger } from '@unly/utils-simple-logger';
import deepmerge from 'deepmerge';
Expand Down
2 changes: 0 additions & 2 deletions src/components/utils/SimpleTooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import React from 'react';
import Tooltip from './Tooltip';

Expand Down
2 changes: 0 additions & 2 deletions src/components/utils/Tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import RCTooltip from 'rc-tooltip';
import React from 'react';

Expand Down
6 changes: 1 addition & 5 deletions src/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/** @jsx jsx */
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import { createLogger } from '@unly/utils-simple-logger';
import {
GetStaticProps,
Expand Down
2 changes: 0 additions & 2 deletions src/pages/[locale]/examples/built-in-features/analytics.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/** @jsx jsx */
import { Amplitude } from '@amplitude/react-amplitude';
import { jsx } from '@emotion/core';
import { createLogger } from '@unly/utils-simple-logger';
import {
GetStaticPaths,
Expand Down
2 changes: 0 additions & 2 deletions src/pages/[locale]/examples/built-in-features/animations.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import { createLogger } from '@unly/utils-simple-logger';
import {
GetStaticPaths,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/** @jsx jsx */
import { Amplitude } from '@amplitude/react-amplitude';
import { jsx } from '@emotion/core';
import { createLogger } from '@unly/utils-simple-logger';
import {
GetStaticPaths,
Expand Down
7 changes: 1 addition & 6 deletions src/pages/[locale]/examples/built-in-features/css-in-js.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import { createLogger } from '@unly/utils-simple-logger';
import {
GetStaticPaths,
Expand Down Expand Up @@ -89,8 +87,7 @@ const ExampleCssInJsPage: NextPage<Props> = (props): JSX.Element => {

<Code
text={`
/** @jsx jsx */
import { css, jsx } from '@emotion/core';
import { css } from '@emotion/core';
<div
css={css\`
Expand Down Expand Up @@ -126,8 +123,6 @@ const ExampleCssInJsPage: NextPage<Props> = (props): JSX.Element => {

<Code
text={`
/** @jsx jsx */
import { jsx } from '@emotion/core';
import styled from '@emotion/styled';
const StyledImage = styled.img\`
Expand Down
2 changes: 0 additions & 2 deletions src/pages/[locale]/examples/built-in-features/docs-site.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import { createLogger } from '@unly/utils-simple-logger';
import {
GetStaticPaths,
Expand Down
2 changes: 0 additions & 2 deletions src/pages/[locale]/examples/built-in-features/graphql.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import { createLogger } from '@unly/utils-simple-logger';
import {
GetStaticPaths,
Expand Down
2 changes: 0 additions & 2 deletions src/pages/[locale]/examples/built-in-features/hosting.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import { createLogger } from '@unly/utils-simple-logger';
import {
GetStaticPaths,
Expand Down
2 changes: 0 additions & 2 deletions src/pages/[locale]/examples/built-in-features/icons.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { createLogger } from '@unly/utils-simple-logger';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsx jsx */
import { jsx } from '@emotion/core';
import { createLogger } from '@unly/utils-simple-logger';
import {
GetStaticPaths,
Expand Down
Loading

1 comment on commit f874e94

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.