diff --git a/Cargo.toml b/Cargo.toml index 04e692f..f550f6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rxing-wasm" -version = "0.3.1" +version = "0.3.2" edition = "2021" description = "wasm bindings for rxing to provide commong barcode operations (decode/encode)" repository = "https://github.com/rxing-core/rxing-wasm" @@ -17,8 +17,8 @@ decode_hints = [] [dependencies] wasm-bindgen = "0.2.92" -js-sys = "0.3.69" -web-sys = {version = "0.3.69", features = ["CanvasRenderingContext2d", "HtmlCanvasElement", "ImageData"]} +js-sys = "0.3.76" +web-sys = {version = "0.3.76", features = ["CanvasRenderingContext2d", "HtmlCanvasElement", "ImageData"]} # The `console_error_panic_hook` crate provides better debugging of panics by # logging them with `console.error`. This is great for development, but requires @@ -26,7 +26,7 @@ web-sys = {version = "0.3.69", features = ["CanvasRenderingContext2d", "HtmlCan # code size when deploying. console_error_panic_hook = { version = "0.1.7", optional = true } -rxing = {version = "~0.6.1", default-features = false, features = ["wasm_support"]} +rxing = {version = "~0.6.3", default-features = false, features = ["wasm_support"]} #rxing = {path="../rxing", version = "~0.2.23", default-features = false, features = ["wasm_support"]} [dev-dependencies] @@ -36,3 +36,6 @@ wasm-bindgen-test = "0.3.34" # Tell `rustc` to optimize for small code size. opt-level = "s" lto = "fat" + +[package.metadata.wasm-pack.profile.release] +wasm-opt = false diff --git a/build-wasm.sh b/build-wasm.sh new file mode 100755 index 0000000..777b874 --- /dev/null +++ b/build-wasm.sh @@ -0,0 +1,5 @@ +#! /bin/sh + +wasm-pack build --release +wasm-opt pkg/rxing_wasm_bg.wasm -o pkg/rxing_wasm_bg-opt.wasm --enable-bulk-memory -O1 --inlining-optimizing --heap-store-optimization --optimize-casts -O4 +mv pkg/rxing_wasm_bg-opt.wasm pkg/rxing_wasm_bg.wasm diff --git a/examples/webpack+js/index.html b/examples/webpack+js/index.html index 516fcd9..f4e77a9 100644 --- a/examples/webpack+js/index.html +++ b/examples/webpack+js/index.html @@ -106,4 +106,4 @@

RXing - Decode Barcodes

- \ No newline at end of file + diff --git a/examples/webpack+js/package-lock.json b/examples/webpack+js/package-lock.json index 7280cb6..c69517c 100644 --- a/examples/webpack+js/package-lock.json +++ b/examples/webpack+js/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.0", "license": "(MIT OR Apache-2.0)", "dependencies": { - "rxing-wasm": "0.3.0" + "rxing-wasm": "0.3.1" }, "bin": { "create-wasm-app": ".bin/create-wasm-app.js" @@ -20,13 +20,11 @@ "webpack": "^5.93.0", "webpack-cli": "^5.1.4", "webpack-dev-server": "^5.0.4" + }, + "engines": { + "node": ">=18.0.0" } }, - "../../pkg": { - "name": "rxing-wasm", - "version": "0.3.0", - "license": "Apache 2.0" - }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", @@ -3005,8 +3003,10 @@ } }, "node_modules/rxing-wasm": { - "resolved": "../../pkg", - "link": true + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/rxing-wasm/-/rxing-wasm-0.3.1.tgz", + "integrity": "sha512-ubeVPOp0ahIfanZHt6743GQ4FDJijhoskEea6jDbHR+Pd3373+vUQv5HvALA88gYwNMsWWJ0qcWoVBVnXXZRew==", + "license": "Apache 2.0" }, "node_modules/safe-buffer": { "version": "5.2.1", @@ -6458,7 +6458,9 @@ } }, "rxing-wasm": { - "version": "file:../../pkg" + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/rxing-wasm/-/rxing-wasm-0.3.1.tgz", + "integrity": "sha512-ubeVPOp0ahIfanZHt6743GQ4FDJijhoskEea6jDbHR+Pd3373+vUQv5HvALA88gYwNMsWWJ0qcWoVBVnXXZRew==" }, "safe-buffer": { "version": "5.2.1", diff --git a/examples/webpack+js/package.json b/examples/webpack+js/package.json index 9bc8173..7e51262 100644 --- a/examples/webpack+js/package.json +++ b/examples/webpack+js/package.json @@ -23,6 +23,6 @@ "node" : ">=18.0.0" }, "dependencies": { - "rxing-wasm": "0.3.1" + "rxing-wasm": "0.3.2" } }