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

deps: add React 19 to peerDep range, remove React devDeps -- needs to update devDeps, lockfile, typings, tests, etc #111

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 15 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@
},
"peerDependencies": {
"prop-types": "^15.5.8",
"react": "0.14 - 18",
"react-dom": "0.14 - 18"
"react": "0.14 - 19",
"react-dom": "0.14 - 19"
},
"dependencies": {
"@babel/runtime": "^7.17.9",
"@types/prop-types": "^15.7.3",
"@types/react": "^18.0.12",
"@types/react": "^19.0.2",
"@types/signature_pad": "^2.3.0",
"signature_pad": "^2.3.2",
"trim-canvas": "^0.1.0"
Expand All @@ -96,8 +96,6 @@
"jest-config": "^27.5.1",
"package-json-type": "^1.0.3",
"parcel": "^2.4.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Comment on lines -99 to -100
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

"rollup": "^2.70.2",
"rollup-plugin-node-externals": "^4.0.0",
"rollup-plugin-terser": "^7.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface SignatureCanvasProps extends SignaturePad.SignaturePadOptions {
}

export class SignatureCanvas extends Component<SignatureCanvasProps> {
static propTypes = {
static override propTypes = {
// signature_pad's props
velocityFilterWeight: PropTypes.number,
minWidth: PropTypes.number,
Expand Down
2 changes: 1 addition & 1 deletion test/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React from 'react'
import { SignatureCanvas, SignatureCanvasProps } from '../src/index'
import { propsF, dotF } from './fixtures'

function renderSCWithRef (props?: SignatureCanvasProps): { wrapper: RenderResult, instance: SignatureCanvas, ref: React.RefObject<SignatureCanvas> } {
function renderSCWithRef (props?: SignatureCanvasProps): { wrapper: RenderResult, instance: SignatureCanvas, ref: React.RefObject<SignatureCanvas | null> } {
const ref = React.createRef<SignatureCanvas>()
const wrapper = render(<SignatureCanvas {...props} ref={ref} />)
const instance = ref.current! // eslint-disable-line @typescript-eslint/no-non-null-assertion -- this simplifies the code; it does exist immediately after render. it won't exist after unmount, but we literally test for that separately
Expand Down
Loading