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

upgraded eslint-config-standard-react and introduced @babel/preset-react #265

Merged
merged 1 commit into from
Feb 18, 2021

Conversation

bmleight
Copy link
Contributor

Does some stuff:

  • upgrades eslint-config-standard-react and introduces @babel/preset-react to play nice with React 17's new JSX transform
  • Removes now unneeded const React = require('react'); statements just used for JSX (see article linked in ☝️)
  • Destructure items being required from react, as per their recommendation in the article:

Change all default React imports (i.e. import React from "react") to destructured named imports (ex. import { useState } from "react") which is the preferred style going into the future. This codemod will not affect the existing namespace imports (i.e. import * as React from "react") which is also a valid style. The default imports will keep working in React 17, but in the longer term we encourage moving away from them.

There are still the following dependencies to update:
Screen Shot 2021-02-12 at 4 25 30 PM

error-overlay-webpack-plugin upgrading to webpack 5 is still holding up upgrading the three webpack libraries.

Upgrading history to v5 comes with the following breaking changes:

  • Removed support for browsers that do not support the HTML5 history API (no pushState)
  • Removed relative pathname support in hash history and memory history
  • Removed getUserConfirmation, keyLength, and hashType APIs

It looks like the browser support could be the biggest concern, but according to caniuse and mozilla, the history api is widely supported (I am spoiled on my current project and only have to worry about chrome and am a bit out of date on browser support). It seems like we could try updating it in the next round.

Screen Shot 2021-02-12 at 4 58 07 PM

Screen Shot 2021-02-12 at 4 55 36 PM

@wswoodruff
Copy link
Contributor

Dude thanks for an awesome writeup on this!

Copy link
Contributor

@wswoodruff wswoodruff left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for slogging thru the eslint woes

const Layout = require('../components/Layout');
const NotFoundPage = require('../components/NotFoundPage');
const NotFoundHelpers = require('./helpers/not-found');
const HomePage = require('./home/components/HomePage');

const CounterPage = React.lazy(() => import('./counter/containers/CounterPage'));
Copy link
Contributor

Choose a reason for hiding this comment

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

It didn't really bug me as-written, but this is cool too!

Copy link
Contributor

@devinivy devinivy left a comment

Choose a reason for hiding this comment

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

Lovely

@bmleight bmleight merged commit 1d83c11 into strangeluv Feb 18, 2021
@zemccartney zemccartney mentioned this pull request Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants