Skip to content

Commit

Permalink
Remove usage of JSX pragma (/** @jsx jsx */) + add babel config + upd…
Browse files Browse the repository at this point in the history
…ate React 16.13.1 > 17.0.1 + massive reformatting
  • Loading branch information
Vadorequest committed Oct 29, 2020
1 parent a5c140e commit a9df25e
Show file tree
Hide file tree
Showing 81 changed files with 136 additions and 270 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 @@ -128,9 +128,9 @@
"next-cookies": "2.0.3",
"prop-types": "15.7.2",
"rc-tooltip": "5.0.0",
"react": "16.13.1",
"react": "17.0.1",
"react-code-blocks": "0.0.8",
"react-dom": "16.13.1",
"react-dom": "17.0.1",
"react-i18next": "11.7.2",
"reactstrap": "8.5.1",
"recompose": "0.30.0",
Expand All @@ -139,6 +139,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
6 changes: 2 additions & 4 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 All @@ -17,7 +15,7 @@ const AllProducts: React.FunctionComponent<Props> = (props) => {
const productsDraft: AirtableRecord<Product>[] = filter(products, { fields: { status: 'DRAFT' } });

return (
<>
<React.Fragment>
<h2>Published products</h2>

<Products
Expand All @@ -31,7 +29,7 @@ const AllProducts: React.FunctionComponent<Props> = (props) => {
<Products
products={productsDraft}
/>
</>
</React.Fragment>
);
};

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
18 changes: 7 additions & 11 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 Expand Up @@ -71,32 +67,32 @@ const SidebarFooter: React.FunctionComponent<Props> = (props): JSX.Element => {
>
{
previousSectionHref && nextSectionHref && (
<>
<React.Fragment>
<PreviousSectionLink previousSectionHref={previousSectionHref} />
{' - '}
<NextSectionLink nextSectionHref={nextSectionHref} />
<HomePageLink />
</>
</React.Fragment>
)
}

{
!previousSectionHref && nextSectionHref && (
<>
<React.Fragment>
<HomePageLink />
{' - '}
<NextSectionLink nextSectionHref={nextSectionHref} />
</>
</React.Fragment>
)
}

{
previousSectionHref && !nextSectionHref && (
<>
<React.Fragment>
<PreviousSectionLink previousSectionHref={previousSectionHref} />
{' - '}
<HomePageLink />
</>
</React.Fragment>
)
}
</div>
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
10 changes: 3 additions & 7 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 Expand Up @@ -63,11 +59,11 @@ const ErrorDebug = (props: Props): JSX.Element => {

{
context && (
<>
<React.Fragment>
<b>Error additional context</b>:<br />
<code>{stringifiedContext}</code>
<hr />
</>
</React.Fragment>
)
}

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
10 changes: 3 additions & 7 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 Expand Up @@ -132,13 +128,13 @@ const DefaultPageContainer: React.FunctionComponent<Props> = (props): JSX.Elemen
<div className={classnames('sidebar-container')}>
{
isSidebarOpen ? (
<>
<React.Fragment>
<SidebarToggle
isSidebarOpen={isSidebarOpen}
setIsSidebarOpen={setIsSidebarOpen}
/>
<Sidebar className={'sidebar'} />
</>
</React.Fragment>
) : (
<SidebarToggle
isSidebarOpen={isSidebarOpen}
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 { useTheme } from 'emotion-theming';
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/pageLayouts/QuickPreviewLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
/** @jsx jsx */
import {
Amplitude,
LogOnMount,
} from '@amplitude/react-amplitude';
import {
css,
jsx,
} from '@emotion/core';
import { css } from '@emotion/core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { createLogger } from '@unly/utils-simple-logger';
import React from 'react';
Expand Down
4 changes: 2 additions & 2 deletions src/components/rehydration/DisplayOnBrowserMount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ const DisplayOnBrowserMount: React.FunctionComponent<Props> = (props) => {
}

return (
<>
<React.Fragment>
{children}
</>
</React.Fragment>
);
};

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
Loading

1 comment on commit a9df25e

@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.