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

Add TypeScript 4.x as peerDependency to react-scripts #9964

Merged
merged 1 commit into from
Nov 26, 2020

Conversation

sheepsteak
Copy link
Contributor

@sheepsteak sheepsteak commented Oct 30, 2020

CRA is supposed to officially support TypeScript 4 as of 4.0.0 but react-scripts is still set at only allowing TypeScript as ^3.2.1. As the CRA TypeScript template comes with TypeScript 4 I think this is causing an install error for users on npm 7 as it now attempts to install peerDependencies by default but the TypeScript versions conflict.

If CRA now supports TypeScript 4 I think this is the correct change to make things right.

Closes #9892
Closes #9764 (not really related to this but it can close after this)
Closes #9995

.gitignore Outdated
@@ -13,3 +13,4 @@ yarn-error.log*
/.changelog
.npm/
yarn.lock
.eslintcache
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you revert? We're going to update this save location in another PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course, I was just trying to figure it out 😄

@neolivz
Copy link

neolivz commented Nov 23, 2020

Can we merge this ASAP?

@pd8
Copy link

pd8 commented Nov 23, 2020

Is there any movement on this PR, CRA team?
Currently have to get around this by doing npm i --legacy-peer-deps, however I don't want to rely on that for too long.

@ianschmitz ianschmitz changed the title Add TypeScript 4 as a valid peerDependency version of react-scripts Add TypeScript 4.x as peerDependency to react-scripts Nov 26, 2020
@ianschmitz ianschmitz merged commit 9b08e3c into facebook:master Nov 26, 2020
@sheepsteak sheepsteak deleted the typescript-4-peer branch November 26, 2020 08:37
@Semigradsky Semigradsky mentioned this pull request Dec 6, 2020
@rati-dzidziguri
Copy link

Any update on this? We are also waiting on it and currently had to use a legacy flag, which is not a thing we want to have as a long-running thing.

@sheepsteak
Copy link
Contributor Author

It's been put in the 4.0.2 milestone but there are 15 other issues to be closed in it 😩

It's frustrating because it's merged and just sat there waiting. This would be a great thing to put out in a patch release by itself as the amount of people moving to npm7 will only be increasing.

I'll started a discussion to try and persuade the team to start making smaller releases - #10489

@rati-dzidziguri
Copy link

Please try to escalate this as Node 15 and NPM7 with workspaces are something that people are switching to, making it almost impossible to properly use the latest LTS software and force us to do the different hack.

@rati-dzidziguri
Copy link

rati-dzidziguri commented Feb 3, 2021

Thank you so much 4.0.2 released 4 hours ago, and I can confirm the issue is fixed there.

blackarctic added a commit to blackarctic/create-react-app that referenced this pull request Apr 29, 2021
* Fix noFallthroughCasesInSwitch/jsx object is not extensible (facebook#9921)

Co-authored-by: Konstantin Simeonov <[email protected]>

* Add logo license to README

* Remove trailing space in reportWebVitals.ts (facebook#10040)

* docs: add React Testing Library as a library requiring jsdom (facebook#10052)

Co-authored-by: Ian Schmitz <[email protected]>

* Increase Workbox's maximumFileSizeToCacheInBytes (facebook#10048)

* Create FUNDING.yml

* replace inquirer with prompts (facebook#10083)

- remove `react-dev-utils/inquirer` public import

* Prepare 4.0.1 release

* Prepare 4.0.1 release

* Publish

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

* chore: bump web-vital dependency version (facebook#10143)

* chore: bump typescript version (facebook#10141)

Co-authored-by: Ian Schmitz <[email protected]>

* Add TypeScript 4.x as peerDependency to react-scripts(facebook#9964)

* remove chalk from formatWebpackMessages (facebook#10198)

* Upgrade @svgr/webpack to fix build error (facebook#10213)

Co-authored-by: Ian Schmitz <[email protected]>

* Improve vendor chunk names in development (facebook#9569)

* Update postcss packages (facebook#10003)

Co-authored-by: Ian Schmitz <[email protected]>

* Recovered some integration tests (facebook#10091)

* Upgrade sass-loader (facebook#9988)

* Move ESLint cache file into node_modules (facebook#9977)

Co-authored-by: Ian Schmitz <[email protected]>

* Revert "Update postcss packages" (facebook#10216)

This reverts commit 580ed5d.

* Remove references to Node 8 (facebook#10214)

* fix(react-scripts): add missing peer dependency react and update react-refresh-webpack-plugin (facebook#9872)

* Update using-the-public-folder.md (facebook#10314)

Some library --> Some libraries

* docs: add missing override options for Jest config (facebook#9473)

* Fix CI tests (facebook#10217)

* appTsConfig immutability handling by immer (facebook#10027)

Co-authored-by: mad-jose <[email protected]>

* Add support for new BUILD_PATH advanced configuration variable (facebook#8986)

* Add opt-out for eslint-webpack-plugin (facebook#10170)

* Prepare 4.0.2 release

* Publish

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

* tests: update test case to match the description (facebook#10384)

* Bump webpack-dev-server 3.11.0 -> 3.11.1 (facebook#10312)

Resolves facebook#10084 security vulnerability in websocket-driver library version 0.5.6, imported transitively by sockjs

* Upgrade eslint-webpack-plugin to fix opt-out flag (facebook#10590)

* update immer to 8.0.1 to address vulnerability (facebook#10412)

Resolves facebook#10411

Bumps immer version to 8.0.1 to address the prototype pollution
vulnerability with the current 7.0.9 version.

* Prepare 4.0.3 release

* Update CHANGELOG

* Publish

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

Co-authored-by: Ryota Murakami <[email protected]>
Co-authored-by: Konstantin Simeonov <[email protected]>
Co-authored-by: Ian Sutherland <[email protected]>
Co-authored-by: sho90 <[email protected]>
Co-authored-by: Anyul Rivas <[email protected]>
Co-authored-by: Ian Schmitz <[email protected]>
Co-authored-by: Jeffrey Posnick <[email protected]>
Co-authored-by: Evan Bacon <[email protected]>
Co-authored-by: Sahil Purav <[email protected]>
Co-authored-by: Hakjoon Sim <[email protected]>
Co-authored-by: Chris Shepherd <[email protected]>
Co-authored-by: Jason Williams <[email protected]>
Co-authored-by: Jabran Rafique⚡️ <[email protected]>
Co-authored-by: John Ruble <[email protected]>
Co-authored-by: Morten N.O. Nørgaard Henriksen <[email protected]>
Co-authored-by: Sergey Makarov <[email protected]>
Co-authored-by: EhsanKhaki <[email protected]>
Co-authored-by: Kristoffer K <[email protected]>
Co-authored-by: Aviv Hadar <[email protected]>
Co-authored-by: Tobias Büschel <[email protected]>
Co-authored-by: mad-jose <[email protected]>
Co-authored-by: mad-jose <[email protected]>
Co-authored-by: Andrew Hyndman <[email protected]>
Co-authored-by: Brody McKee <[email protected]>
Co-authored-by: James George <[email protected]>
Co-authored-by: Dion Woolley <[email protected]>
Co-authored-by: Walker Clem <[email protected]>
wombleton pushed a commit to AurorNZ/create-react-app that referenced this pull request Jun 1, 2021
@davetapley
Copy link

@sheepsteak I presume your assumption was that ^3.2.1 should still be fully supported in CRA 4 (hence the ||)?

I ask because a couple of us are seeing ⬇️ unless we go from ^3.2.1 to ^4, but it's easy to miss during CRA 3 to 4 upgrade because npm doesn't warn about bad peer deps 🤔

@ljharb
Copy link

ljharb commented Jul 21, 2022

@davetapley npm 7+ definitely warns about bad peer deps, fwiw.

@davetapley
Copy link

@ljharb sorry, bad phrasing on my part: npm doesn't warn about bad peer deps because ^3.2.1 is still in the spec ⬇️
(even though #10852 (comment) suggests that it isn't fully supported)

"peerDependencies": {
"typescript": "^3.2.1 || ^4"
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants