Packages

create-react-app

5.1.0 · 15 Feb 2025MIT34.4k / weekRepositoryHomepagenpmAtom feed

Your version

4.0.0

major23 Oct 2020Where it was published

4.0.3 is the newest release of 4.x.

In short

17 breaking23 new16 fixed29 changed15 internal

  • Breaking

    Like any major release, react-scripts@4.0.0 contains a number of breaking changes.

  • Breaking

    Node 8 reached End-of-Life at the end of 2019 and is no longer supported.

  • Breaking

    eslint-config-react-app, react-error-overlay, react-scripts: feat(eslint-config-react-app): Add jest & testing-library rules (@MichaelDeBoey)

  • Breaking

    create-react-app: feat: exit on outdated create-react-app version (@mrmckeb)

  • Breaking

    cra-template-typescript, cra-template, react-scripts: Switch to the Workbox InjectManifest plugin (@jeffposnick)

  • Breaking

    eslint-config-react-app, react-error-overlay, react-scripts: Support ESLint 7.x (@MichaelDeBoey)

  • Breaking

    cra-template-typescript, cra-template, eslint-config-react-app, react-error-overlay, react-scripts: Remove EXTEND_ESLINT and add Jest rules (@mrmckeb)

  • Breaking

    eslint-config-react-app: fix: remove deprecated rule (@ljosberinn)

Release note

Create React App 4.0 is a major release with several new features, including support for Fast Refresh!

Thanks to all the maintainers and contributors who worked so hard on this release! :raised_hands:

Highlights

  • Fast Refresh #8582

  • React 17 support

  • TypeScript 4 support #9734

  • ESLint 7 #8978

    • New Jest and React Testing Library rules #8963

  • Jest 26 #8955

  • PWA/workbox improvements

    • Switch to the Workbox InjectManifest plugin #9205

    • Now its own template so it can be released independently

  • Web Vitals support #9116

Migrating from 3.4.x to 4.0.0

Inside any created project that has not been ejected, run:

npm install --save --save-exact react-scripts@4.0.0

or

yarn add --exact react-scripts@4.0.0

NOTE: You may need to delete your node_modules folder and reinstall your dependencies by running yarn (or npm install) if you encounter errors after upgrading.

If you previously ejected but now want to upgrade, one common solution is to find the commits where you ejected (and any subsequent commits changing the configuration), revert them, upgrade, and later optionally eject again. It’s also possible that the feature you ejected for is now supported out of the box.

Breaking Changes

Like any major release, react-scripts@4.0.0 contains a number of breaking changes. We expect that they won't affect every user, but we recommend you look over this section to see if something is relevant to you. If we missed something, please file a new issue.

ESLint

We've upgraded to ESLint 7 and added many new rules including some for Jest and React Testing Library as well as the import/no-anonymous-default-export rule. We've also upgraded eslint-plugin-hooks to version 4.0.0 and removed the EXTEND_ESLINT flag as it is no longer required to customize the ESLint config.

Jest

We've upgraded to Jest 26 and now set resetMocks to true by default in the Jest config.

Service workers

We've switched to the Workbox InjectManifest plugin and moved the PWA templates into their own repository.

Removed typescript flag and NODE_PATH support

We've removed the deprecated typescript flag when creating a new app. Use --template typescript instead. We've also dropped deprecated NODE_PATH flag as this has been replaced by setting the base path in jsconfig.json.

Fix dotenv file loading order

We've changed the loading order of env files to match the dotenv specification. See #9037 for more details.

Dropped Node 8 support

Node 8 reached End-of-Life at the end of 2019 and is no longer supported.

Detailed Changelog

:rocket: New Feature

  • eslint-config-react-app, react-error-overlay, react-scripts: feat(eslint-config-react-app): Add jest & testing-library rules (@MichaelDeBoey)

  • react-scripts: Add AVIF image support (@Hongbo-Miao)

  • react-scripts: Allow testMatch for jest config (@Favna)

  • react-scripts: Add back in --stats output from webpack. (@samccone)

  • react-scripts: Support devDependencies in templates (@mrmckeb)

  • create-react-app: feat: exit on outdated create-react-app version (@mrmckeb)

  • cra-template-typescript, cra-template, react-scripts: Switch to the Workbox InjectManifest plugin (@jeffposnick)

  • react-dev-utils, react-scripts: Add experimental react-refresh support (@charrondev)

:boom: Breaking Change

  • Breaking

    eslint-config-react-app, react-error-overlay, react-scripts: feat(eslint-config-react-app): Add jest & testing-library rules (@MichaelDeBoey)

  • Breaking

    eslint-config-react-app, react-error-overlay, react-scripts: Support ESLint 7.x (@MichaelDeBoey)

  • Breaking

    cra-template-typescript, cra-template, eslint-config-react-app, react-error-overlay, react-scripts: Remove EXTEND_ESLINT and add Jest rules (@mrmckeb)

  • Breaking

    eslint-config-react-app: fix: remove deprecated rule (@ljosberinn)

  • Breaking

    create-react-app: feat: exit on outdated create-react-app version (@mrmckeb)

  • Breaking

    cra-template-typescript, cra-template, react-scripts: Switch to the Workbox InjectManifest plugin (@jeffposnick)

  • Breaking

    babel-plugin-named-asset-import, confusing-browser-globals, create-react-app, react-dev-utils, react-error-overlay, react-scripts: Upgrade to Jest 26 (@ianschmitz)

  • Breaking

    create-react-app, react-scripts: feat: remove typescript flag and NODE_PATH support (@mrmckeb)

  • Breaking

    react-scripts: Fix dotenv file loading order (@Timer)

  • Breaking

    react-scripts: Set resetMocks to true by default in jest config (@alexkrolick)

  • Breaking

    babel-plugin-named-asset-import, babel-preset-react-app, create-react-app, react-app-polyfill, react-dev-utils, react-error-overlay, react-scripts: Dependency major version upgrades (@ianschmitz)

  • Breaking

    eslint-config-react-app, react-scripts: Add import/no-anonymous-default-export lint rule (@shakib609)

  • Breaking

    eslint-config-react-app, react-scripts: Bump React Hooks ESLint plugin to 4.0.0 (@gaearon)

  • Breaking

    cra-template-typescript, cra-template, create-react-app, react-app-polyfill, react-dev-utils, react-scripts: Drop Node 8 support (@ianschmitz)

  • Breaking

    babel-plugin-named-asset-import, babel-preset-react-app, confusing-browser-globals, cra-template-typescript, react-dev-utils, react-error-overlay, react-scripts: Upgrade to Jest 25 (@skovhus)

:bug: Bug Fix

  • react-scripts: Fix refreshOverlayInterop module scope error (@ianschmitz)

  • react-scripts: Fix dotenv file loading order (@Timer)

  • react-scripts: Skip stdin resuming to support lerna parallel (@hieuxlu)

  • react-scripts: Do not check for interactive session to shut down dev server (@jeremywadsack)

  • react-scripts: Add .cjs and .mjs files support to test runner (@ai)

  • babel-preset-react-app, eslint-config-react-app, react-scripts: fix: resolve new JSX transform issues (@mrmckeb)

  • eslint-config-react-app, react-scripts: fix: resolve ESLint config from appPath (@mrmckeb)

  • create-react-app: Fix template name handling (@iansu)

  • babel-preset-react-app: fix: use default modules option from preset-env (@JLHwung)

  • react-dev-utils: Publish refreshOverlayInterop with react-dev-utils (@klinem)

  • react-dev-utils: Replace period in CSS Module classnames (@evankennedy)

  • react-dev-utils, react-scripts: Use process.execPath to spawn node subprocess (@anuraaga)

  • cra-template-typescript, cra-template, react-scripts: fix: handle templates without main package field (@mrmckeb)

:nail_care: Enhancement

  • react-scripts: Use new JSX setting with TypeScript 4.1.0 (@iansu)

  • react-scripts: Support source maps for scss in dev environments (@MKorostoff)

  • react-scripts: Don't use webpack multi entry unnecessarily (@sebmarkbage)

  • babel-preset-react-app, eslint-config-react-app, react-scripts: New JSX Transform opt out (@iansu)

  • cra-template: feat: remove unused React imports (@mrmckeb)

  • babel-preset-react-app, react-scripts: Use new JSX transform with React 17 (@iansu)

  • react-dev-utils, react-scripts: Add Fast Refresh warning when using React < 16.10 (@iansu)

  • react-dev-utils, react-error-overlay, react-scripts: feat: better refresh plugin integration (@pmmmwh)

  • cra-template-typescript, cra-template: Add performance relayer + documentation (web-vitals) (@housseindjirdeh)

  • cra-template-typescript, cra-template: Update template tests (@MichaelDeBoey)

  • create-react-app: Fix --use-pnp for Yarn 2 (@nickmccurdy)

:memo: Documentation

  • Other

  • react-dev-utils: Fixes in the /packages/react-devs-utils/README.md file (@caspero-62)

  • react-dev-utils: Update build script deployment URL (@StenAL)

  • cra-template-typescript, cra-template: Updated README.md Templates to Follow ESLint Markdown Rules (@firehawk09)

  • cra-template-typescript, cra-template: Upgrade testing-library packages (@gnapse)

  • react-scripts: Explain how to uninstall create-react-app globally (@nickmccurdy)

  • react-scripts: Support devDependencies in templates (@mrmckeb)

  • cra-template-typescript, cra-template, react-dev-utils, react-scripts: Move shortlinks to cra.link (@iansu)

  • babel-preset-react-app: Include absoluteRuntime in babel preset docs (@iddan)

:house: Internal

  • eslint-config-react-app: fix(eslint-config-react-app): Make eslint-plugin-jest an optional peerDependency (@MichaelDeBoey)

  • Other

    • fix: Fix azure-pipelines' endOfLine (@MichaelDeBoey)

    • Replace Spectrum links with GitHub Discussions (@iansu)

    • Bump acorn from 6.4.0 to 6.4.1 in /docusaurus/website (@dependabot[bot])

    • Specify what files are served form a bare local copy (@challet)

  • cra-template-typescript, cra-template: feat: Update testing-library dependencies to latest (@MichaelDeBoey)

  • react-dev-utils: clean formatMessage usage (@chenxsan)

  • cra-template: Bump version of Verdaccio (@ianschmitz)

  • babel-preset-react-app: Remove outdated comment (@availchet)

  • react-scripts: fix react-refresh babel plugin not applied (@tanhauhau)

:hammer: Underlying Tools

  • react-scripts: Pass JSX runtime setting to Babel preset in Jest config (@iansu)

  • react-scripts: Bump resolve-url-loader version (@johannespfeiffer)

  • react-scripts: Upgrade refresh plugin (@ianschmitz)

  • react-scripts: Bump style-loader to 1.2.1 (@chybisov)

  • react-error-overlay, react-scripts: Upgrade to React 17 (@iansu)

  • react-error-overlay, react-scripts: feat: Update ESLint dependencies (@MichaelDeBoey)

  • babel-plugin-named-asset-import, babel-preset-react-app, confusing-browser-globals, cra-template-typescript, cra-template, create-react-app, eslint-config-react-app, react-app-polyfill, react-error-overlay, react-scripts: feat: Update all dependencies (@MichaelDeBoey)

  • eslint-config-react-app, react-dev-utils, react-scripts: Replace deprecated eslint-loader by eslint-webpack-plugin (@tooppaaa)

  • babel-plugin-named-asset-import, babel-preset-react-app, confusing-browser-globals, cra-template-typescript, cra-template, create-react-app, eslint-config-react-app, react-dev-utils, react-error-overlay, react-scripts: Upgrade dependencies (@ianschmitz)

  • eslint-config-react-app, react-error-overlay, react-scripts: feat: Update ESLint dependencies (@MichaelDeBoey)

  • eslint-config-react-app, react-error-overlay, react-scripts: feat: Update ESLint dependencies (@MichaelDeBoey)

  • eslint-config-react-app, react-error-overlay, react-scripts: Support ESLint 7.x (@MichaelDeBoey)

  • cra-template-typescript, cra-template: Update template dependencies to latest version (@MichaelDeBoey)

  • cra-template-typescript, cra-template: Upgrade testing-library packages (@gnapse)

  • react-app-polyfill: Upgrade whatwg-fetch (@Lapz)

  • react-dev-utils: Bump immer version (@staff0rd)

  • babel-plugin-named-asset-import, babel-preset-react-app, confusing-browser-globals, create-react-app, react-dev-utils, react-error-overlay, react-scripts: Upgrade dependencies (@ianschmitz)

  • babel-preset-react-app, cra-template-typescript, cra-template, create-react-app, react-dev-utils, react-error-overlay, react-scripts: Upgrade dependencies (@ianschmitz)

  • babel-preset-react-app, cra-template-typescript, cra-template, create-react-app, react-dev-utils, react-error-overlay, react-scripts: Upgrade dependencies (@ianschmitz)

  • babel-plugin-named-asset-import, confusing-browser-globals, create-react-app, react-dev-utils, react-error-overlay, react-scripts: Upgrade to Jest 26 (@ianschmitz)

  • babel-preset-react-app, create-react-app, react-dev-utils, react-error-overlay, react-scripts: Update packages (@ianschmitz)

  • babel-preset-react-app, create-react-app, react-dev-utils, react-error-overlay, react-scripts: Minor/patch dependency upgrades (@ianschmitz)

  • babel-plugin-named-asset-import, babel-preset-react-app, create-react-app, react-app-polyfill, react-dev-utils, react-error-overlay, react-scripts: Dependency major version upgrades (@ianschmitz)

  • eslint-config-react-app, react-scripts: Bump React Hooks ESLint plugin to 4.0.0 (@gaearon)

  • babel-plugin-named-asset-import, babel-preset-react-app, confusing-browser-globals, cra-template-typescript, react-dev-utils, react-error-overlay, react-scripts: Upgrade to Jest 25 (@skovhus)

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.