What problem does it solve?
Building the xberg document extraction library for wasm32 targets fails or produces oversized binaries when developers use tokio-based async internals, skip the crate-private SyncExtractor trait, or ignore the 2 MB HTML stack limit and size-optimized build profile.
Core Features & Use Cases
- Feature Flag Guidance: Documents the wasm-target feature set (no-ort-target, excel-wasm, ocr-wasm, layout-tract, auto-rotate-tract, ner-candle-wasm) and explains why tree-sitter is excluded to stay under jsDelivr's 50 MB cap.
- Sync-Only Internal API Rules: Requires every WASM-compatible in-crate extractor to implement the pub(crate) SyncExtractor trait, with no tokio runtime anywhere in the call path.
- Build Configuration: Specifies opt-level = "z" on the xberg-wasm package profile, cdylib crate type, and the async wasm-bindgen wrapper over synchronous internals pattern.
- Use Case: When adding a new extractor that must work in the browser, load this Skill to correctly gate code with #[cfg(target_arch = "wasm32")], implement SyncExtractor, and respect the 2 MB HTML limit.
Quick Start
Load the wasm-constraints skill before adding a new WASM-compatible extractor to crates/xberg so the implementation follows the sync-only and size constraints.