-
Notifications
You must be signed in to change notification settings - Fork 187
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
Ft/upgrade react version #22
Draft
taivueh
wants to merge
95
commits into
blackjk3:master
Choose a base branch
from
Thinkei:ft/upgrade-react-version
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- No other elements are rendered by this component other than a canvas (as it should be for a library) - Styling is not _necessary_ but can be added to surrounding elements or by passing a `canvasProps` object prop, which can define `style` or `className` and is directly passed to underlying canvas element - Use PropTypes and ES6 function binding instead of calling .bind() - clear() no longer takes an event as a prop as it's not attached to a button anymore - Also use ev var instead of event to prevent confusion with event objects - remove toDataURL() and create getCanvas() instead - create getTrimmedCanvas() to return a trimmed copy of the canvas, removing any whitespace of the canvas - Align closer to standard style where code was changed - 2 space, no semicolon. - Use ES6 let + import as well - Move example code to its own directory - Configure webpack-dev-server to property use this directory - Remove lib and don't push compiled artifacts to the repo - Users can use npmcdn if they really need to - gitignore the build/ directory - Add better documentation for all Props + API methods - Bump version to 0.1.0 + add .npmignore
- copyCanvas depended on createCanvas, which uses node-gyp and other dependencies to create, which is wildly unnecessary for this - added 4 lines of code to do this instead - also have example's css make the trimmed image have a white background color so it's more noticeable (and resembles the drawing canvas) - didn't know you could use both a background-image and a background-color on the same element o.o
- Previously, in react-signature-pad MIT was listed in package.json and nowhere else - Prefer Apache over MIT as well (due to patent countersuit ability)
- the previous behavior of automatically editing the width and height resulted in multiple unintended problems - particularly, it would cause the width/height to be 0 if the canvas were under a display: none element, and therefore unusable until the window were resized - now it conditionally sets width/height only if canvasProps' did not have a width/height inside of it - push v0.1.3
- fixes the React.PropTypes deprecation warning
- show downloads, etc as well - publish as v0.1.5
- if height and width are calculated the background color didn't get set on initial render previously, this fixes that
- `img` needs an `src` which can replace `background` inline CSS
- if `clearOnResize` is `false`, then a window resize will no longer cause the canvas to clear itself - defaults to `true` for backward compatibility
- Add the `clearOnResize` definition - Move `backgroundColor` in the component's prop list to match the docs - nb: `backgroundColor` is still not perfectly defined as a prop - Change introductory language from "differences" to "new, documented" as "differences" could imply good and bad changes (e.g. new opinions), while "new" has a very different connotation and most API/props changes were backward compatible
- minor bump due to new prop - add `pub` script (not `publish` as that's a keyword to run after publish) - add lockfile
- typo / copy-paste error in last release accidentally changed it to `addEventListener` - publish as v0.2.1
- this fixes an error that occurred when drawing a single dot that would result in the canvas looking empty and the state of the component containing a blank image - this error was introduced in the v0.1.6 release that made dotSize a static function instead of defined in the constructor - (props to @kgram for catching this in #11)
- seems to work flawlessly with React 16 and React DOM 16 but the `package.json` needed to be updated so as not to throw warnings when using 16 during installation
- strokeBegin called reset(), which set isEmpty = true , which is a bug - moved isEmpty = true logic outside of reset() as the only place it actually needs to be set to true is in clear()
- does the opposite of `off` - replace internal usage with new `on` functionality as well
- `on` was recently added - `off` never had documentation, but should
- minor bump due to new API method
- some github badges that show releases etc - some NPM badges that show downloads because the nodei one isn't showing dls for some reason and because there's surprisingly a lot of dls!
- 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?
- this release is technically "fully backward compatible" because it only adds to the API and doesn't change anything - well besides the continually fixed dotSize function (see v0.2.2) - every SignaturePad change has been minor so far - including v2.0.0 since it only broke distribution, not the API - buuuut, throttle and minDistance actually would make for subtle behavior changes since they change the internal functionality - the way props are updated now may also cause minor timing changes - this release does change the internal structures of the library, so if those were being used, they might no longer work - this release also marks a significant shift in how the library will be maintained moving forward, since it now relies on the upstream signature_pad library - also update keywords
- been up for several months without issues, so more than ready!
- before it would always turn white on resize - no need to clear on componentDidMount anymore since resize clears now
- clearOnResize and fixed/unfixed width & height should affect resizing as expected - also yea the tests run in parallel, but readability-wise it makes more sense I think(?) - add a window.resizeTo polyfill as jsdom doesn't implement it o.o - and there doesn't seem to be an NPM package for this(?)
- noun / verb of describe and it for better readability - export it from Jest ES Module as well
- 100% statement coverage now woooooot!
- when false, canvas won't resize on window resize necessarily - was set false in previous test - this was found when branch coverage was lacking a bit on resizing, now we're at ~93% and missing just one branch! - the tests didn't error out though because without input size the canvas size is 0 in these tests regardless of resize - not a perfect test in that sense :/ :/
- demo, codesandbox, and test coverage are somewhat meaningful to note and pointing them out at the top means more people will see and use them as well
- similar to how some libraries do it as well as to the centered logo pattern - was considering centering the header and badges too, but I think that made it harder to read and feel more messy / not as clean - also considered leaving the buttons of the example in the gif to display some features like trimming, but that seemed to add confusion to the fact that there are no other elements besides the canvas in this fork - also change "React Signature Canvas" to "react-signature-canvas" as that's the package's name - this is an old artifact from react-signature-pad that I hadn't changed since the fork - remove a newline after the nodeico badge so the whole intro still fits on mobile without needing to click into the README
- no actual API surface changes!! - add CHANGELOG.md that points to GH Releases page for now - slight changes to docs, including: - add a CodeSandbox playground - add a GIF to the README - LOTS of internal stability and automation upgrades, including: - add tests and 100% code coverage!! - add Travis CI support - officially add Standard linting to devDeps (not just global) - and lint, test, and changelog scripts - auto-update outdated package-lock and audit devDeps now that we're past the v1.0.0 boundary, really focusing on stability, automation, and quality!! :)
Ft/update upstream and fix dirty
[IDX-1358] Upgrade webpack and jest
Add gitleaks schedule workflow and precommit configuration files
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.