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

v3 #169

Closed
4 tasks done
zpao opened this issue Dec 28, 2021 · 3 comments
Closed
4 tasks done

v3 #169

zpao opened this issue Dec 28, 2021 · 3 comments

Comments

@zpao
Copy link
Owner

zpao commented Dec 28, 2021

v2 v3 needs to happen. There are a number of things that I'd like to be a part of this, some of which have been attempted in the past, or are long standing issues.

TODO:

  • Rewrite in TypeScript. This will help avoid issues of types being out date. We can export types directly and not rely on community maintained types.
  • Replace qr.js dependency. As noted in qr.js has been hijacked  #168 the original repo was taken over. While this isn't an active issue (that wasn't even the original author of qr.js, npm has not been taken over), it would still be good to find a more stable/modern dependency (potentially vendored to make this a zero dependency install). This may also enable some additional functionality that is impossible - for example: feature-request/add-custom-color-to-squares #157
  • Use React Hooks. The current class approach is outdated and while it allows us to support a wider range of React versions, it also makes it harder to support modern features that could further enable other functionality.
  • Support ES Modules. Obviously we can't drop CJS entirely but we can shift primary use to modern module practices. Revamped build setup - provide module build #49 started going there but had issues. We can probably get away with just doing this with Typescript builds directly now. Part of this may also end up being splitting SVG and Canvas renderers out BUT part of the argument for ES Modules is direct support for tree shaking anyway.

Open Questions:

  • Should we support the general QRCode component or just expose QRCodeSVG and QRCodeCanvas? There's not a whole lot of harm, though currently I'd do this as a default export (which isn't great).

Things I do not want to support in v2:

  • Direct support for download functionality. I'm hopeful that refs can enable this in user space.
  • Different QR Code design features (colors, rounded shapes, etc). While some parts of that may become easier as noted above, I think at least 2.0.0 should just support that same QR Code features.
@mifi
Copy link

mifi commented Jan 11, 2022

an alternative to qr.js could be https://github.com/soldair/node-qrcode

@zpao
Copy link
Owner Author

zpao commented Feb 23, 2022

Most of this is happening in https://github.com/zpao/qrcode.react/tree/typescript, should be ready soon(ish)

@zpao
Copy link
Owner Author

zpao commented Mar 26, 2022

Shipped!

@zpao zpao closed this as completed Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants