Skip to content

Conversation

davecarlson
Copy link

@davecarlson davecarlson commented Dec 25, 2024

Fixes #109. Replaces #110

Per #109 (comment), I removed the main react and react-dom dependencies, and just left the peer ones to help with compatibility

aaronzdavis

This comment was marked as duplicate.

Copy link
Owner

@agilgur5 agilgur5 left a comment

Choose a reason for hiding this comment

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

The devDeps removals are incorrect; they're needed during dev and testing, per in-line comment below. CI also still needs fixing.

Also please use the specific title and description I had edited in for your previous PR #110; generic titles and no description are not good practice.

To the reviewers here, approvals without in-depth reviews are also counter-productive and can be misleading.
If you want something faster, you can contribute with a detailed review, by helping fix CI, by testing out and verifying compatibility in a React 19 app, etc.

Comment on lines -99 to -100
"react": "^18.2.0",
"react-dom": "^18.2.0",
Copy link
Owner

Choose a reason for hiding this comment

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

The react* devDeps should not be removed. They are devDeps and are used during development and testing.
Unless a more recent version of Node changed something, peerDeps don't get installed during development and so this would fail CI (if it ran; it needs fixing per my last comment in the issue)

Copy link
Owner

Choose a reason for hiding this comment

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

See also below comment on the package-lock.json after I added its necessary changes

@agilgur5 agilgur5 changed the title Update package.json deps: add React 19 to peerDep range Dec 31, 2024
@agilgur5 agilgur5 added the scope: dependencies Pull requests that update a dependency file label Dec 31, 2024
Copy link
Owner

@agilgur5 agilgur5 left a comment

Choose a reason for hiding this comment

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

CI is running now (c.f. #112, #113, et al) and fails; package-lock.json also needs updating for the @types/react change

EDIT: I updated the package-lock.json myself in 478dc4f.
EDIT2: Then fixed some typings issues with the new React 19 types in f3e1a78

This comment was marked as resolved.

Comment on lines 12190 to +12193
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
"integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==",
"dev": true,
"peer": true,
Copy link
Owner

@agilgur5 agilgur5 Dec 31, 2024

Choose a reason for hiding this comment

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

this is still using 18.2.0 without a specific devDep afaict, although the "peer": true part seems new (i.e. newer NPM feature).

this means that React 19 is not actually being tested, React 18 is still installed during dev/test

Copy link
Owner

Choose a reason for hiding this comment

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

When installing React 19, you'll also see that v13.3.0 of @testing-library/react is incompatible:

❯ npm install -D react react-dom
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-signature-canvas@1.0.5
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   peer react@"^18.0.0" from @testing-library/react@13.3.0
npm WARN   node_modules/@testing-library/react
npm WARN     dev @testing-library/react@"^13.3.0" from the root project
npm WARN   2 more (react-dom, the root project)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^18.0.0" from @testing-library/react@13.3.0
npm WARN node_modules/@testing-library/react
npm WARN   dev @testing-library/react@"^13.3.0" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-signature-canvas@1.0.5
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   peer react@"^18.0.0" from @testing-library/react@13.3.0
npm WARN   node_modules/@testing-library/react
npm WARN     dev @testing-library/react@"^13.3.0" from the root project
npm WARN   2 more (react-dom, the root project)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^18.2.0" from react-dom@18.2.0
npm WARN node_modules/react-dom
npm WARN   peer react-dom@"^18.0.0" from @testing-library/react@13.3.0
npm WARN   node_modules/@testing-library/react
npm WARN   1 more (the root project)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-signature-canvas@1.0.5
npm WARN Found: react@18.2.0
npm WARN node_modules/react
npm WARN   peer react@"^18.0.0" from @testing-library/react@13.3.0
npm WARN   node_modules/@testing-library/react
npm WARN     dev @testing-library/react@"^13.3.0" from the root project
npm WARN   2 more (react-dom, the root project)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^18.2.0" from react-dom@18.2.0
npm WARN node_modules/react-dom
npm WARN   peer react-dom@"^18.0.0" from @testing-library/react@13.3.0
npm WARN   node_modules/@testing-library/react
npm WARN   1 more (the root project)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-signature-canvas@1.0.5
npm WARN Found: react-dom@18.2.0
npm WARN node_modules/react-dom
npm WARN   peer react-dom@"^18.0.0" from @testing-library/react@13.3.0
npm WARN   node_modules/@testing-library/react
npm WARN     dev @testing-library/react@"^13.3.0" from the root project
npm WARN   1 more (the root project)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react-dom@"^18.0.0" from @testing-library/react@13.3.0
npm WARN node_modules/@testing-library/react
npm WARN   dev @testing-library/react@"^13.3.0" from the root project

So @testing-library/react also needs to be updated through a couple breaking changes to v16.1

@agilgur5 agilgur5 changed the title deps: add React 19 to peerDep range deps: add React 19 to peerDep range, remove React devDeps -- needs devDeps, test, and typings updates Jan 3, 2025
@agilgur5 agilgur5 changed the title deps: add React 19 to peerDep range, remove React devDeps -- needs devDeps, test, and typings updates deps: add React 19 to peerDep range, remove React devDeps -- needs devDeps, lockfile, typings, and test updates Jan 3, 2025
@agilgur5
Copy link
Owner

agilgur5 commented Jan 3, 2025

Given the various issues above, I'll be making a separate PR to fix all of the above.
Please see #89 as an example of everything required during the React 18 upgrade (the React 19 one is a bit different, but similar).

EDIT: Superseded by #116

@agilgur5 agilgur5 closed this Jan 3, 2025
@agilgur5 agilgur5 changed the title deps: add React 19 to peerDep range, remove React devDeps -- needs devDeps, lockfile, typings, and test updates deps: add React 19 to peerDep range, remove React devDeps -- needs to update devDeps, lockfile, typings, tests, etc Jan 3, 2025
@agilgur5 agilgur5 added kind: feature New feature or request solution: invalid labels Jan 3, 2025
Repository owner locked as resolved and limited conversation to collaborators Jan 23, 2025
@agilgur5 agilgur5 added the solution: superseded This issue or PR has been superseded by another one label Mar 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind: feature New feature or request scope: dependencies Pull requests that update a dependency file solution: invalid solution: superseded This issue or PR has been superseded by another one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add React 19 to peerDep range
4 participants