gruhn / vue-qrcode-reader

A set of Vue.js components for detecting and decoding QR codes.
https://gruhn.github.io/vue-qrcode-reader
MIT License
2.03k stars 330 forks source link

feat: re-export setZXingModuleOverrides #355

Closed gruhn closed 10 months ago

gruhn commented 10 months ago

The BarcodeDetector polyfill fetches a WASM file at runtime from a CDN. That's a problem for offline applications or applications that run in a network with strict CSP policy. As a workaround the polyfill exports a function to configure the WASM file URL. So we re-export the function here.

Also, by default the BarcodeDetector polyfill installs itself by setting globalThis.BarcodeDetector but only if there is no native support. This is likely not SSR compatible. Also, native support BarcodeDetector is inconsistent. For example, Chrome on MacOS does support BarcodeDetector but does not support Blob inputs, violating the specification. To have a more consistent support we simply always use the polyfill on all platforms. That likely comes as at a performance cost in raw scanning speed on supporting platforms but the download penalty is paid either way.

TODO

See #354 #353

netlify[bot] commented 10 months ago

Deploy Preview for vue-qrcode-reader ready!

Name Link
Latest commit 099a8d921a00126a80b704899dd5db631a874896
Latest deploy log https://app.netlify.com/sites/vue-qrcode-reader/deploys/64d2af7ca18fed00088d159b
Deploy Preview https://deploy-preview-355--vue-qrcode-reader.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

github-actions[bot] commented 10 months ago

:tada: This PR is included in version 5.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: