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

Deprecate Create React App officially by changing the README, and adding a message on init #17003

Merged
merged 4 commits into from
Jan 28, 2025

Conversation

orta
Copy link
Contributor

@orta orta commented Jan 24, 2025

It's probably time to make this project document its status as being deprecated and not recommended for production usage.

To change it:

  • I opted to add a header to the README saying its over and you should go look at https://react.dev/learn/start-a-new-react-project

  • I left a note saying that if you are following, it is maybe worth carrying on. While I hear react 19 doesn't work with CRA, I wouldn't be surprised that a good chunk of tutorials would still work. Open to being a bit more hard-lined there but there was a lot of great resources for learning react in that era and it seems like a waste to be making people stop early?

  • I added a message inside the CLI, it shows once and says "don't use this, use the stuff in https://react.dev/learn/start-a-new-react-project"

@orta
Copy link
Contributor Author

orta commented Jan 24, 2025

The deprecation message itself is 👍🏻 but the fail on CI is a react 19 issue

Screenshot 2025-01-24 at 11 50 14

Perhaps it could be locked to 18?

Installing template dependencies using npm...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^19.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^18.0.0" from @testing-library/[email protected]
npm ERR! node_modules/@testing-library/react
npm ERR!   @testing-library/react@"^13.0.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/runner/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2025-01-24T11_48_43_485Z-debug-0.log
`npm install --no-audit --save @testing-library/jest-dom@^5.14.1 @testing-library/react@^13.0.0 @testing-library/user-event@^13.2.1 web-vitals@^2.1.0` failed

Merging this PR could come with #13725 and it should get green and give CRA a bit of a longer run

@markerikson
Copy link

Yeah, the overall problem is that the CLI has always installed react@latest, but the current templates include a React Testing Library version that wants react@18 as a peer dep. Now that React 19 is latest, NPM has its usual hardline "peer dep mismatches are full breaking errors" behavior, so we end up with an error every time you try to create a project with one of the standard templates.

Copy link
Member

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

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

thanks!

@rickhanlonii rickhanlonii merged commit b532a58 into facebook:main Jan 28, 2025
9 checks passed
@jt3k
Copy link

jt3k commented Jan 29, 2025

God, I've been waiting for this moment for so long. this should have been done 10 years ago, because cra is not suitable for production, it is only useful for learning React and if you want to try React when you need to save time to the detriment of the technology stack inside. I've been waiting for this for so long because over the years I've found cra inside large and small projects in the places where I worked, and I've always deprecated and rewrote them on a webpack, parcel, or vite.

@bmuenzenmeyer
Copy link
Contributor

bmuenzenmeyer commented Jan 31, 2025

I hope this doesn't alarm anyone paying attention. Overall, it's good for clarity to the community at large. There's been plenty, plenty of hints to this over the years. I often cite this one, from 2021.

but overall, starting with 2.0, it's mostly in maintenance mode and does not strive to be the best tool for production React apps. It is a tool to get started and get something running fast. Perhaps, it's not even best at that anymore.

karlhorky pushed a commit to upleveled/create-react-app that referenced this pull request Mar 20, 2025
…ing a message on init (facebook#17003)

It's probably time to make this project document its status as being
deprecated and not recommended for production usage.

To change it:

- I opted to add a header to the README saying its over and you should
go look at https://react.dev/learn/start-a-new-react-project

- I left a note saying that if you are following, it is maybe worth
carrying on. While I hear react 19 doesn't work with CRA, I wouldn't be
surprised that a good chunk of tutorials would still work. Open to being
a bit more hard-lined there but there was a lot of great resources for
learning react in that era and it seems like a waste to be making people
stop early?

- I added a message inside the CLI, it shows once and says "don't use
this, use the stuff in
https://react.dev/learn/start-a-new-react-project"

---------

Co-authored-by: Ricky <[email protected]>
Co-authored-by: Rick Hanlon <[email protected]>
karlhorky added a commit to upleveled/create-react-app that referenced this pull request Mar 20, 2025
* fix(babel-preset-react-app): add missing dependency (facebook#12364)

In facebook#11318 a change was made to `babel-preset-react-app` to require `@babel/plugin-proposal-private-property-in-object`, but no such dependency was added to `package.json`. This fixes that mistake by adding the dependency.

* Migrate from Azure Pipelines to GitHub Actions (facebook#13222)

Beyond just a pure migration, this also:

- Drops Node 14 usage from CI (which also removes the need for explicit
  npm 8 installs)
- Removes the "old node" test, which just checked that installing on old
  node failed. We shouldn't need to test that
- Consolidates the build & test workflows so we don't end up with
  a proliferation of workflows.

* Update running-tests.md

Update running-tests

* chore: upgrade RTL version to avoid peer-deps mismatch

* Update types from facebook#13725

Co-authored-by: Rajhans Jadhao <[email protected]>

* Fix tests

* Fix e2e tests

* Add act

* try this instead

* update react-scripts react devDep

* idk

* Update tests

* skip svg component test

* Deprecate Create React App officially by changing the README, and adding a message on init (facebook#17003)

It's probably time to make this project document its status as being
deprecated and not recommended for production usage.

To change it:

- I opted to add a header to the README saying its over and you should
go look at https://react.dev/learn/start-a-new-react-project

- I left a note saying that if you are following, it is maybe worth
carrying on. While I hear react 19 doesn't work with CRA, I wouldn't be
surprised that a good chunk of tutorials would still work. Open to being
a bit more hard-lined there but there was a lot of great resources for
learning react in that era and it seems like a waste to be making people
stop early?

- I added a message inside the CLI, it shows once and says "don't use
this, use the stuff in
https://react.dev/learn/start-a-new-react-project"

---------

Co-authored-by: Ricky <[email protected]>
Co-authored-by: Rick Hanlon <[email protected]>

* Update deprecation link (facebook#17015)

Updates to a shortlink that we can redirect as needed for old versions.
Currently 404

* Add deprecation to website (facebook#17008)

- Adds a banner with deprecation notice
- Adds a noindex meta tag to home page to remove from search
- Add og meta info for when noindex is ignored

* Publish

 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]

* Migrate from Azure Pipelines to GitHub Actions (facebook#13222)

Beyond just a pure migration, this also:

- Drops Node 14 usage from CI (which also removes the need for explicit
  npm 8 installs)
- Removes the "old node" test, which just checked that installing on old
  node failed. We shouldn't need to test that
- Consolidates the build & test workflows so we don't end up with
  a proliferation of workflows.

* Update running-tests.md

Update running-tests

* chore: upgrade RTL version to avoid peer-deps mismatch

* Update types from facebook#13725

Co-authored-by: Rajhans Jadhao <[email protected]>

* Fix tests

* Fix e2e tests

* Add act

* try this instead

* update react-scripts react devDep

* idk

* Update tests

* skip svg component test

* Deprecate Create React App officially by changing the README, and adding a message on init (facebook#17003)

It's probably time to make this project document its status as being
deprecated and not recommended for production usage.

To change it:

- I opted to add a header to the README saying its over and you should
go look at https://react.dev/learn/start-a-new-react-project

- I left a note saying that if you are following, it is maybe worth
carrying on. While I hear react 19 doesn't work with CRA, I wouldn't be
surprised that a good chunk of tutorials would still work. Open to being
a bit more hard-lined there but there was a lot of great resources for
learning react in that era and it seems like a waste to be making people
stop early?

- I added a message inside the CLI, it shows once and says "don't use
this, use the stuff in
https://react.dev/learn/start-a-new-react-project"

---------

Co-authored-by: Ricky <[email protected]>
Co-authored-by: Rick Hanlon <[email protected]>

* Update deprecation link (facebook#17015)

Updates to a shortlink that we can redirect as needed for old versions.
Currently 404

* Add deprecation to website (facebook#17008)

- Adds a banner with deprecation notice
- Adds a noindex meta tag to home page to remove from search
- Add og meta info for when noindex is ignored

* Publish

 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]

* Disable deprecation warning and version check

* Bump version

* Disable deleting folder after error

* Fix babel-plugin-named-asset-import version number

* Bump @upleveled/create-react-app to 5.1.2

* Bump version of @upleveled/react-scripts to 5.1.1

* Add back call to createApp()

* Bump version of @upleveled/create-react-app to 5.1.3

* Revert to published versions of react-scripts dependencies

* Bump version of @upleveled/react-scripts to 5.1.2

* Allow pnpm to build @parcel/watcher, ignore core-js builds

* Bump version of @upleveled/cra-template to 1.3.1

* Remove pnpm config from package.json, bump to @upleveled/[email protected]

* Add pnpm built packages configuration in `package.json`

* Bump @upleveled/create-react-app to 5.1.4

---------

Co-authored-by: Brian Donovan <[email protected]>
Co-authored-by: Paul O’Shannessy <[email protected]>
Co-authored-by: Olexandr Radovenchyk <[email protected]>
Co-authored-by: Edgardo Avilés-López <[email protected]>
Co-authored-by: Matan Borenkraout <[email protected]>
Co-authored-by: Rick Hanlon <[email protected]>
Co-authored-by: Rajhans Jadhao <[email protected]>
Co-authored-by: Ricky <[email protected]>
Co-authored-by: Orta Therox <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants