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

(refactor): Wrap upstream signature_pad #20

Closed
wants to merge 3 commits into from
Closed

Conversation

agilgur5
Copy link
Owner

@agilgur5 agilgur5 commented Apr 1, 2018

Fixes #17

- Apparently react-signature-pad (what this repo forked from) just
  copy+pasted most of an older version of signature_pad when it was
  first created
- In order to get all the latest features, fix bugs, and reduce the
  maintenance burden an general surface of this library and its API,
  react-signature-canvas is now a React wrapper around signature_pad
  - It retains the features it added on top of signature_pad, such as
    automatic resizing, a trim feature, and idiomatic React updates
    via props
  - And now has new features like fromDataURL options, toDataURL,
    fromData, and toData! And new props like minDistance and throttle

- Return SignaturePad instance via getSignaturePad
- Use componentDidMount to trigger prop updates via Object.assign on
  the SignaturePad instance

- Move all wrapper methods to below render for better organization

- Update README with new props and API methods
- Add links to signature_pad in the props and API sections
- Change intro to reflect the new changes in this library / repo

- Remove bezier.js and point.js as they are wrapped
- Remove all mouse / click / touch handling and other core calculations
  that are now wrapped
- Remove defaultProps that were for the signature_pad implementation
  - This also once again changes up how the dotSize function works
    - It is now back to how it worked pre-v0.2.0
    - Still debatable if this is a bugfix or a breaking change
      (see v0.2.2)
- Left in propTypes for signature_pad, but maybe those should be
  removed too?
- also update keywords
@agilgur5
Copy link
Owner Author

agilgur5 commented Apr 1, 2018

@lopis @kgram if you get a moment, could you review this? This resolves the RFC. I'll release the alpha version if all looks good so folks can test

@lopis
Copy link

lopis commented Apr 1, 2018

Oh man, great cleanup job. 👍

@lopis
Copy link

lopis commented Apr 1, 2018

Maybe I'm doing something terribly wrong but I couldn't run the example without adding the react preset in a .babelrc file. Otherwise I kept getting Module build failed: Error: Couldn't find preset "react" relative to directory "/home/joao/code"

- perhaps should actually contribute to upstream and have szimek
  change it to the new implementation
  - (minWidth, maxWidth) => (minWidth + maxWidth) / 2 is far more
    intuitive than having to bind to the right this context
@agilgur5
Copy link
Owner Author

agilgur5 commented Apr 1, 2018

@lopis tbh, I hadn't ran the example in almost 2 years (since I made the fork haha), but ran npm start in my local copy and it worked no problem o.o. The react preset is specified in webpack.config.js so that a .babelrc isn't necessary.

Not sure if there might be a dependency conflict with your install (since the webpack and babel versions used here are out-of-date nowadays)

@lopis
Copy link

lopis commented Apr 2, 2018 via email

@agilgur5
Copy link
Owner Author

agilgur5 commented Apr 8, 2018

If this looks good, I'll release the alpha version tonight/tomorrow

@agilgur5
Copy link
Owner Author

Rebased in as a703e22 and 62c3714 and released as v1.0.0-alpha.1. Thanks for the review @lopis !

If anyone can sees this can test the alpha within their own codebase, would be helpful and appreciated!

@agilgur5 agilgur5 closed this Apr 12, 2018
@agilgur5 agilgur5 deleted the wrap-upstream branch April 12, 2018 01:57
@agilgur5 agilgur5 linked an issue Mar 13, 2021 that may be closed by this pull request
Repository owner locked as resolved and limited conversation to collaborators Mar 13, 2021
@agilgur5 agilgur5 added the scope: dependencies Pull requests that update a dependency file label Mar 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope: dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC] Use/wrap upstream signature_pad
2 participants