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: update signature_pad to v4 #98

Closed

Conversation

aiden-jeffrey
Copy link

Also remove the @types dependency as it appears signature_pad declares it's own types now.

Also remove the @types dependency as it appears signature_pad declares
it's own types now.
@aiden-jeffrey aiden-jeffrey force-pushed the aiden/update-signature-pad branch from 6241262 to 25920f2 Compare June 19, 2023 18:04
@agilgur5 agilgur5 added this to the `signature_pad` v4 milestone Jun 23, 2023
@agilgur5 agilgur5 added scope: dependencies Pull requests that update a dependency file version: major Upgrade major version when merged labels Jun 23, 2023
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.

Thanks for making the PR, but unfortunately this does not address all the breaking changes in signature_pad v4. This effectively duplicates #68 as a result. Please see the detailed comments there for how this is a breaking change and what additional changes would need to be made to make react-signature-canvas compatible with it (which may require a major release).

So far, no contributor has made those changes, and actual feature requests for v4 have been very few and far in between.

@agilgur5 agilgur5 changed the title deps: Update signature_pad to latest release deps: update signature_pad to v4 Jun 23, 2023
@@ -7,5 +7,7 @@
"compilerOptions": {
// output to dist/ dir
"outDir": "dist/",
"jsx": "react-jsx",
Copy link
Owner

@agilgur5 agilgur5 Jun 23, 2023

Choose a reason for hiding this comment

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

so this is not compatible with older React versions, which is why I have yet to use it and why I still have import React (among other things). you might notice that in the peerDeps here, react-signature-canvas is backward compatible with at least React v14.

this would require changing the peerDeps version. it looks like the React team did backport this all the way to React v14, but the range would need to be changed to only those versions and above, i.e. ^16.14.0, ^15.7.0, ^0.14.10 (and 17+ ofc)

@@ -7,5 +7,7 @@
"compilerOptions": {
// output to dist/ dir
"outDir": "dist/",
"jsx": "react-jsx",
"importsNotUsedAsValues": "preserve"
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think this is needed as all of the imports are still used even when the types are removed. Is there a reason you added this?

Comment on lines +3 to 4
import { Options as SignaturePadOptions } from 'signature_pad'
import SignaturePad from 'signature_pad'
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
import { Options as SignaturePadOptions } from 'signature_pad'
import SignaturePad from 'signature_pad'
import SignaturePad, { Options as SignaturePadOptions } from 'signature_pad'

I would prefer to keep imports of the same library on the same line (and generally avoid stylistic changes)

@@ -158,7 +159,7 @@ export class SignatureCanvas extends Component<SignatureCanvasProps> {
}

toDataURL: SignaturePad['toDataURL'] = (type, encoderOptions) => {
return this.getSignaturePad().toDataURL(type, encoderOptions)
return this.getSignaturePad().toDataURL(type as string, encoderOptions as number)
Copy link
Owner

Choose a reason for hiding this comment

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

why was this type-cast necessary? we should have the exact same types and not force any subset

@agilgur5 agilgur5 added the problem: stale Issue author has not responded label Jul 2, 2023
@agilgur5
Copy link
Owner

agilgur5 commented Jul 7, 2023

Closing as stale with no response in 2 weeks. Can re-open if this is picked back up

@agilgur5 agilgur5 closed this Jul 7, 2023
Repository owner locked as resolved and limited conversation to collaborators Sep 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
problem: stale Issue author has not responded scope: dependencies Pull requests that update a dependency file solution: duplicate version: major Upgrade major version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants