zxing-js / browser

ZXing for JS's browser layer with decoding implementations for browser.
MIT License
216 stars 43 forks source link

Confusing documentation #42

Closed fydelio closed 3 years ago

fydelio commented 3 years ago

Hi

I love the library, and I somehow managed to get it running following the example here, but I find the documentation very confusing... library / browser repository?!? Which one should now be used. How do they fit together. How do they interact. Just one example here from the documentation with add to the confusion.

Bildschirmfoto 2021-02-19 um 09 38 51

shouldn't it be import { BrowserQRCodeReader } from '@zxing/browser'

The barcode scanning with your mobile phone is such an awesome feature. I'm sure this library would see a huge adoption, if only the documentation were better. I'm sure many people have already tried but failed to implement, and then probably turned to (very expensive) commercial solutions, just because the documentation is so challenging to read and requires a lot of guess work.

jorismak commented 3 years ago

The red lines I don't really get from your screenshot. It shows howto install it by using the package manager of your choice or from a CDN link. What's confusing about that?

Although I do get the confusion about the difference between @zxing/browser and @zxing/library.

For what it's worth, I'm using @zxing/library which has the object 'BrowserMultiFormatReader' so I'm not sure what @zxing/browser would add.

I got up and running from looking at a Vue barcode-reader component. I do admit that I'm looking around for documentation although most of the time you'll have to refer the original ZXing library, and then seem to find the Javascript-implementation-detail of what you're trying to do :).

fydelio commented 3 years ago

Regarding my screenshot and the red & green lines. First it shows how to install zxing-js/browser (red lines), then further down in the documentation you are actually importing from zxing-js/library. Without importing zxing-js/browser, the browser files are not available and it seems, you are actually using the files from the library and not the browser structure

It just feels that it's such a great library, but there are so many undocumented features - which is a real pity. Here are some exampes:

odahcam commented 3 years ago

@fydelio I find it very pertinent, could you open a new issue so we list these topics?