Add in-docs web parser page powered by browser WASM#697
Conversation
Adds a /parser page on the VitePress site that decodes BLE advertisements locally in the browser via a new BUILD_WASM_WEB Emscripten target (ENVIRONMENT=web,worker, EXPORT_ES6, SINGLE_FILE), built fresh by the docs publish workflow on each release. The Node.js WASM build shipped to npm is untouched. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@mhaberler feel free to share your comments |
|
how can I preview this? ping @1technophile |
|
Try this @mhaberler :
|
|
LGTM - got it to work as outlined if you merge this just close my PR do you see any downside in one module for both use cases? |
|
Going to update this PR to have one unified esm module |
529e4af to
738c119
Compare
Replace the separate BUILD_WASM (node, UMD) and BUILD_WASM_WEB (browser, ES6) Emscripten targets with a single BUILD_WASM target that emits one ES module running in the browser, web workers and Node.js (ENVIRONMENT=web,worker,node, EXPORT_ES6, SINGLE_FILE). The output is now theengs_decoder_wasm.mjs so Node loads it as an ES module even though the npm package stays CommonJS; index.js loads it via dynamic import() internally, leaving the public API unchanged. The same artifact is shipped to npm (dist/) and to the docs site (public/wasm/), so there is a single build to maintain and one tested binary everywhere.
738c119 to
fdfff6c
Compare
Description:
Adds a /parser page on the VitePress site that decodes BLE advertisements locally in the browser via a new BUILD_WASM_WEB Emscripten target (ENVIRONMENT=web,worker, EXPORT_ES6, SINGLE_FILE), built fresh by the docs publish workflow on each release. The Node.js WASM build shipped to npm is untouched.
Checklist: