-
Notifications
You must be signed in to change notification settings - Fork 10
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
Version Packages (beta) #185
Conversation
Caution Review failedThe pull request is closed. WalkthroughThis pull request introduces a major version update (2.0.0-beta.0) for the zxing-wasm package, involving significant refactoring of Embind APIs and barcode processing functions. The changes consolidate multiple reader and writer functions, update default options, rename some fields, and modify the module initialization process. The update aims to streamline the library's API while maintaining backward compatibility through deprecated function markers. Changes
Sequence DiagramsequenceDiagram
participant User
participant ZXingModule
participant BarcodeReader
participant BarcodeWriter
User->>ZXingModule: prepareZXingModule(...)
User->>BarcodeReader: readBarcodes(input)
BarcodeReader-->>User: ReadResult
User->>BarcodeWriter: writeBarcode(...)
BarcodeWriter-->>User: Encoded Barcode
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
commit: |
1a799aa
to
35f9f75
Compare
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
main
is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, runchangeset pre exit
onmain
.Releases
[email protected]
Major Changes
1a77296: # V2: Breaking Release - Next Major Version
This release introduces a major refactoring of the underlying Embind APIs and read / write functions. Key changes include transitioning away from Embind Enums toward numeric encoding and decoding, a new set of default reader options, enhanced writer capabilities backed by
zint
, and updated APIs for reading and writing barcodes. These changes break backward compatibility, so we are upgrading to the next major version.Breaking Changes
Renamed & Consolidated Reader Function
readBarcodes(...)
replaces bothreadBarcodesFromImageFile(...)
andreadBarcodesFromImageData(...)
. The new function unifies code paths forBlob
andImageData
inputs.Updated Reader Options
A few reader options have changed their default values. This change is to align with the latest ZXing C++ library and provide a more consistent experience across different platforms:
tryCode39ExtendedMode
is nowtrue
by default. It was previouslyfalse
.eanAddOnSymbol
is now"Ignore"
by default. It was previously"Read"
.textMode
is now"HRI"
by default. It was previously"Plain"
.Some deprecated options have been removed, see zxing-cpp#704 for more details:
validateCode39CheckSum
is now removed. The Code39 symbol has a valid checksum if the third character of thesymbologyIdentifier
is an odd digit.validateITFCheckSum
is now removed. The ITF symbol has a valid checksum if the third character of thesymbologyIdentifier
is a'1'
.returnCodabarStartEnd
is now removed. The detected results of Codabar symbols now always include the start and end characters.eccLevel
in Read Result Renamed toecLevel
In
ReadResult
, theeccLevel
field has been renamed toecLevel
. It now holds strings like"L"
,"M"
,"Q"
, or"H"
or stringified numeric values for error correction levels. An empty string indicates that the error correction level is not applicable.Renamed & Enhanced Writer Function
writeBarcode(...)
replaceswriteBarcodeToImageFile(...)
. The new function is powered by the newzint
writer, which supports more barcode formats, supports bothstring
andUint8Array
inputs for generating barcodes from text or binary data, and provides new output formats (e.g. SVG, UTF-8) in addition to the binary image file output.The
WriterOptions
object has also been updated completely.Module Initialization / Caching Overhaul
prepareZXingModule(...)
replaces bothsetZXingModuleOverrides(...)
andgetZXingModuleOverrides(...)
. The new function provides a more flexible way to initialize the ZXing module with custom options.purgeZXingModule
now only clears the relevant module cache from where it is imported. It no longer resets the global module cache.New Features & Enhancements
More Barcode Formats Supported in Writer
The new
writeBarcode
function supports more barcode formats than the previouswriteBarcodeToImageFile
. All barcode formats supported by the reader except forDXFilmEdge
are now supported by the writer.New
tryDenoise
Option for Reading BarcodesThe new
tryDenoise
option inReaderOptions
allows you to enable or disable the denoising algorithm when reading barcodes. This is an experimental feature and by default, it is set tofalse
.Summary by CodeRabbit
New Features
2.0.0-beta.0
with significant updates to barcode read/write functionalities.tryDenoise
option.Bug Fixes
Documentation
Chores
1.3.4
to2.0.0-beta.0
.