Packages

create-react-app

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

Your version

3.0.0

major22 Apr 2019Where it was published

3.4.1 is the newest release of 3.x.

In short

12 breaking1 removed22 new5 fixed18 changed15 internal

  • Breaking

    Like any major release, react-scripts@3.0.0 contains a few breaking changes.

  • Breaking

    babel-plugin-named-asset-import, confusing-browser-globals, react-dev-utils, react-error-overlay, react-scripts: Update to Jest 24 (@loryman)

  • Breaking

    eslint-config-react-app, react-scripts: Add TypeScript linting support (@ianschmitz)

  • Breaking

    babel-preset-react-app, eslint-config-react-app, react-scripts: Support React Hooks (#5602) (@eivind88)

  • Breaking

    babel-preset-react-app, react-dev-utils, react-scripts: Support browserslist in @babel/preset-env (@ianschmitz)

  • Breaking

    react-scripts: Remove no-watch flag in favor of watchAll=false (@bugzpodder)

  • Breaking

    react-scripts: Add custom function to generate asset manifest (@iansu)

  • Breaking

    react-scripts: change NODE_ENV and PUBLIC_URL into readonly (@xiaoxiangmoe)

Release note

Create React App 3.0 brings some exciting new features including support for Hooks!

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

Highlights

  • Jest 24

  • Hooks support

  • TypeScript linting

  • browserslist support in @babel/preset-env

  • Absolute imports using jsconfig.json/tsconfig.json

Migrating from 2.1.x to 3.0.0

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

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

or

yarn add --exact react-scripts@3.0.0

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@3.0.0 contains a few 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.

Jest 24

We've updated from Jest 23 to get the latest improvements in Jest 24. We've noticed some differences in snapshot serialization in Jest 24, so you may need to adjust your tests slightly once you update. You can read more about what's changed in the Jest 24 blog post.

Hooks support

We now enforce Rules of Hooks with eslint-plugin-react-hooks. If you are breaking any of the rules of Hooks this will cause your build to fail.

TypeScript linting

We now lint TypeScript files. You can see the list of rules we enforce to check if your project is compatible. If you're using Visual Studio Code you can follow our guide to setup up your editor to display lint warnings.

browserslist support in @babel/preset-env

The browserslist config in your package.json is now used to control the output of your JavaScript files. You can use separate configuration for development and production. See here for a good starting point which gives a good development experience, especially when using language features such as async/await, but still provides high compatibility with many browsers in production

Remove --no-watch flag

We've removed the --no-watch flag from the start script in favor of Jest's own --watchAll=false.

New structure in asset-manifest.json

All asset paths have been moved under the files key in asset-manifest.json.

New Features

using jsconfig.json/tsconfig.json

We now support setting baseUrl in jsconfig.json and tsconfig.json. To configure baseUrl to point to the src directory in your JavaScript project, create a jsconfig.json file in your project root:

```json
{
  "compilerOptions": {
    "baseUrl": "src"
  },
  "include": ["src"]
}
```

If you have a TypeScript project you can configure baseUrl the same way in your tsconfig.json.

Currently the only supported options for baseUrl are node_modules (the default) and src.

PostCSS Normalize

You can now include a version of Normalize.css in your project that will use your browserslist setting to generate the appropriate styles for your target browsers. To include it simply add @import-normalize at the top of one of your CSS files.

Detailed Changelog

:rocket: New Feature

  • react-scripts: Set baseUrl from jsconfig.json/tsconfig.json (@rovansteen)

  • react-scripts: Adds PostCSS Normalize (@mrchief)

  • babel-plugin-named-asset-import, confusing-browser-globals, react-dev-utils, react-error-overlay, react-scripts: Update to Jest 24 (@loryman)

  • eslint-config-react-app, react-scripts: Add TypeScript linting support (@ianschmitz)

  • babel-preset-react-app, eslint-config-react-app, react-scripts: Support React Hooks (#5602) (@eivind88)

  • babel-preset-react-app, react-dev-utils, react-scripts: Support browserslist in @babel/preset-env (@ianschmitz)

:boom: Breaking Change

  • Breaking

    react-scripts: Remove no-watch flag in favor of watchAll=false (@bugzpodder)

  • Breaking

    react-scripts: Add custom function to generate asset manifest (@iansu)

  • Breaking

    react-scripts: change NODE_ENV and PUBLIC_URL into readonly (@xiaoxiangmoe)

  • Breaking

    react-scripts: Remove --coverage + --watch workaround for the test command (@stipsan)

  • Breaking

    react-scripts: Allow .json type checking (@ianschmitz)

  • Breaking

    react-scripts: Add custom function to generate asset manifest (@iansu)

  • Breaking

    babel-preset-react-app, react-app-polyfill: Update to core-js@3 (@ianschmitz)

  • Breaking

    babel-plugin-named-asset-import, confusing-browser-globals, react-dev-utils, react-error-overlay, react-scripts: Update to Jest 24 (@loryman)

  • Breaking

    eslint-config-react-app, react-scripts: Add TypeScript linting support (@ianschmitz)

  • Breaking

    babel-preset-react-app, eslint-config-react-app, react-scripts: Support React Hooks (#5602) (@eivind88)

  • Breaking

    babel-preset-react-app, react-dev-utils, react-scripts: Support browserslist in @babel/preset-env (@ianschmitz)

:bug: Bug Fix

  • react-dev-utils: InlineChunkHtmlPlugin works with empty publicPath (@ItalyPaleAle)

  • react-scripts: fix: terser-webpack-plugin hanging on WSL (@endiliey)

  • react-scripts: Convert JSON.stringify \n to os.EOL (@MikeBeaton)

  • create-react-app: Fix unlogged yarn pnp message (@heyimalex)

:nail_care: Enhancement

  • react-scripts: Change CRA version in react-scripts eject warning. (@lffg)

  • react-scripts: Add custom function to generate asset manifest (@iansu)

  • react-scripts: Fix react-scripts peer-deps link local issue (@transitive-bullshit)

  • react-scripts: Replace deprecated SFC with FunctionComponent in react-app.d.ts (@iamandrewluca)

  • react-scripts: Suggests that tsconfig.json is incorrect only when SyntaxError is caught (@Andarist)

  • react-scripts: Enable futureEmitAssets in webpack config (@iansu)

  • react-scripts: Remove unnecessary shrink-to-fit=no meta data (@abdelrahmanrifai)

  • react-scripts: Add empty mock for http2 (@kjin)

  • react-scripts: add command to add files to staging after eject (@clickclickonsal)

  • react-scripts: Allow .json type checking (@ianschmitz)

  • react-scripts: change class component to function component (@xiaoxiangmoe)

  • babel-plugin-named-asset-import, babel-preset-react-app, confusing-browser-globals, create-react-app, eslint-config-react-app, react-app-polyfill, react-dev-utils, react-error-overlay, react-scripts: Add directory details to packages/* package.json (@feelepxyz)

  • babel-preset-react-app, react-app-polyfill: Update to core-js@3 (@ianschmitz)

  • create-react-app: Warn when using react-scripts-ts (@ianschmitz)

  • react-dev-utils: Add wait: false to options object for opn (@evalexpr)

  • react-dev-utils: Enable click to go to error in console part 2! (@johnnyreilly)

:memo: Documentation

  • Other

    • Add baseUrl documentation (@ianschmitz)

    • Copy fixes in adding Bootstrap docs (@panckreous)

    • Fix docs about minimum React version for SVG component support (@iansu)

    • Add link to TypeScript page in Getting Started (@ianschmitz)

    • Clarify production build output files documentation (@bakuzan)

    • Add SVG support dependency note (@pnarielwala)

    • Update link to React Testing Library docs (@fjoshuajr)

    • Add Render deployment section (@anurag)

    • Add explanation for adding everything as dependencies to docs (@mikeattara)

    • Document .graphql and .gql file loading with graphql.macro (@petetnt)

    • Update advanced-configuration.md (@stephengodderidge)

    • Add deployment instructions with AWS Amplify (@swaminator)

    • Add note about npx caching and link to #6119 (@TaylorBriggs)

    • Revert removal of newlines from html in docs (@JBallin)

  • Removed

    react-scripts: Remove no-watch flag in favor of watchAll=false (@bugzpodder)

:house: Internal

  • Other

    • Upgrade to Lerna v3 (@iansu)

    • Add temporary workaround for Babel dependency issues in kitchensink-eject test suite (@iansu)

    • Add temporary workaround for Babel dependency issues in installs test suite (@iansu)

    • Kill verdaccio in CI tasks cleanup (@santoshyadav198613)

    • Remove duplicate url key in siteConfig (@charpeni)

  • react-scripts: Update testMatch to also be compatible with Jest 24 (@ngbrown)

  • react-scripts: Remove --coverage + --watch workaround for the test command (@stipsan)

  • react-scripts: Change app component declaration from arrow function to regular function (@iansu)

  • react-scripts: change named import into default import (@xiaoxiangmoe)

  • react-scripts: make compiler a const not a let (@Primajin)

  • babel-plugin-named-asset-import, confusing-browser-globals, react-dev-utils, react-error-overlay, react-scripts: Cleanup Jest config (@ianschmitz)

  • react-dev-utils: Remove unused eslint comment (@mohitsinghs)

  • eslint-config-react-app: Sync version of babel-eslint in eslint-config-react-app for react-scripts V3 (@dalcib)

:hammer: Underlying Tools

  • react-scripts: Update fsevents dependency version (@FrancoisRmn)

  • react-scripts: Update to workbox-webpack-plugin v4 (@r0ughnex)

  • react-scripts: Updating html-webpack-plugin dep (@Aftabnack)

  • react-scripts: Update webpack-dev-server to 3.2.1 (@ThePrez)

  • babel-plugin-named-asset-import, babel-preset-react-app, confusing-browser-globals, create-react-app, eslint-config-react-app, react-app-polyfill, react-dev-utils, react-error-overlay, react-scripts: Relax ESLint version range (@ianschmitz)

  • babel-preset-react-app: Remove unused babel-loader from babel-preset-react-app (@tlrobinson)

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

  • react-dev-utils: Update fork-ts-checker-webpack-plugin out of alpha (@pelotom)

  • Removed

    eslint-config-react-app: Remove project property from @typescript-eslint/parser options (@jackwilsdon)

  • eslint-config-react-app, react-scripts: Unpin eslint-config-react-hooks dependency (@iansu)

  • babel-preset-react-app, eslint-config-react-app, react-scripts: Support React Hooks (#5602) (@eivind88)

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

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.