Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: implement Rust/WebAssembly-based decoder
Reimplement the image decoder, previously implemented in handwritten Asm.js, into Rust/WebAssembly. Since Asm.js is effectively a "done" technology and is unsupported by esbuild, moving to WebAssembly is a sensible choice. The new implementation is almost as fast as the previous one in Chrome. At build time, the WebAssembly binary is inlined into the bundle as a base64-encoded string. This allows downstream users to use regular bundlers. Due to how WebAssembly works, however, the library's signature has changed. Now, the library exports a `Promise` object named `init`. This promise is created when the library is imported, and is resolved asynchronously. Before using symbols exported by the library (including the default export), users must wait for the promise to resolve. example: import PSD, {init} from '@webtoon/psd' async fun() => { await init; PSD.parse(/* ... */) }
- Loading branch information