papnkukn / qrcode-svg

A simple QR Code generator in pure JavaScript / node.js library
MIT License
451 stars 93 forks source link

Remove minified code blob #28

Open leMaik opened 2 years ago

leMaik commented 2 years ago

TL;DR If you want to get rid of the minified code blob, use @lemaik/qrcode-svg


Especially in a server application, running a blob of mangled JavaScript might scare some people (especially since recent npm package malware incidents), eg. this resolves #26

Following my observations in https://github.com/papnkukn/qrcode-svg/issues/26#issuecomment-1159805781, I restored the proper code by performing these steps:

  1. Pretty-print the code so that the following diffs make sense (either trust me or run prettier yourself to get the same result)
  2. Replace the now pretty-printed blob with the latest version from jeromeetienne/jquery-qrcode, and pretty-printed it again.
    Notably, this version contains https://github.com/kazuhikoarase/qrcode-generator/pull/41 and thus can determine the type automatically
  3. Restore the utf8 fix that was previously in this version, ie. apply https://github.com/davidshimjs/qrcodejs/commit/8247821f4a6336c8b7dd908a80f4e5c54e09fa1d
  4. Remove the type detection that got added in step 2, because that's implemented already here
VanessaHenderson commented 1 year ago

@papnkukn has this project been abandoned? Is there anychance you can merge this PR to remove the obfuscated code?