Ngx-scanner: Updated to new ngx-scanner 3.1.0 with error

Created on 27 Oct 2020  路  4Comments  路  Source: zxing-js/ngx-scanner

ERROR in The target entry-point "@zxing/ngx-scanner" has missing dependencies:
 - @zxing/browser
 - @zxing/library

Now we should install this packages manually?

invalid

Most helpful comment

Long answer: it should be that way long ago, it just wasn't because the dependencies of the package were set wrong, this way (using peer dependencies instead of dependencies) users have more control over their own dependencies and can use the underlying packages directly if they want to, without conflicting or experiencing annoying behaviours. You can also benefit from patches from both packages where you couldn't before, having to wait until the next ngx-scanner release to get a patch already done, for example, in zxing/library.

It's good you pointed this out, our README should be updated to inform this "change" as well. Also, please update to v3.1.1, it contains some important bug fixes.

All 4 comments

Yes.

Long answer: it should be that way long ago, it just wasn't because the dependencies of the package were set wrong, this way (using peer dependencies instead of dependencies) users have more control over their own dependencies and can use the underlying packages directly if they want to, without conflicting or experiencing annoying behaviours. You can also benefit from patches from both packages where you couldn't before, having to wait until the next ngx-scanner release to get a patch already done, for example, in zxing/library.

It's good you pointed this out, our README should be updated to inform this "change" as well. Also, please update to v3.1.1, it contains some important bug fixes.

A update on readme should be made as pointed out by core maintainer but I would like to also point out that it should inform which one should be installed depending on the use case, I assume @zxing/browser is mostly needed for most end users for scanning and all that stuff whereas @zxing/library is the full API for any custom setup (not only browsers), right?

Kind of, the...

  • library is the underlying ZXing library ported from Java code that contains only logical stuff that should run in any JS environment (it does contains a browser layer, but it's deprecated and we consider only the core for now).
  • browser is the layer built over the library and makes use of it's logical stuff plus available browser APIs to extend functionality and help developers start with browser barcode scanning without the need to deep dive into the library.
  • ngx-scanner is basically the browser package being wrapped in an Angular component.
Was this page helpful?
0 / 5 - 0 ratings