|
1 | 1 | /**
|
2 |
| - * Port of `iroha_crypto` Rust crate via WebAssembly. |
| 2 | + * Port of `iroha_crypto` into WebAssembly. |
3 | 3 | *
|
4 | 4 | * ## Compatibility
|
5 | 5 | *
|
6 |
| - * This package uses native `.wasm` ES Module imports, **which isn't widely supported yet**. |
7 |
| - * However, there are some tricks in play to increase the compatibility. |
| 6 | + * Compatible with all runtimes. |
8 | 7 | *
|
9 |
| - * | Platform | Support | Version | Notes | |
10 |
| - * | - | - | - | - | |
11 |
| - * | Deno | ✅ | 2.1+ or 2.1.5+ | See [notes in `@deno/wasmbuild`](https://github.com/denoland/wasmbuild?tab=readme-ov-file#browser-nodejs-or-older-deno-support). | |
12 |
| - * | Node.js | ✅ | v24.0+, v22.0+, v20.0+ | Uses `import('node:fs')` to make it work. | |
13 |
| - * | Bun | ✅ ❓ | v1.2.2 | Checked only with `v1.2.2` | |
14 |
| - * | Bundlers | ✅ 🚧 | | Requires plugins to support importing `.wasm` (e.g. [`vite-plugin-wasm`](https://github.com/Menci/vite-plugin-wasm)). | |
15 |
| - * | Natively in the browser | ✅ | | Checked with https://esm.sh | |
16 |
| - * | Cloudflare Workers | ❓ | | Not checked | |
| 8 | + * Since `0.3.0`, the `.wasm` blob __is inlined__. Therefore, it is compatible with any |
| 9 | + * runtime that supports {@linkcode WebAssembly} (e.g. see |
| 10 | + * [compatibility on MDN](https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript_interface/Instance/Instance#browser_compatibility)). |
17 | 11 | *
|
18 |
| - * An example of how this could be used in browser: |
19 |
| - * |
20 |
| - * ```html |
21 |
| - * <script type="module"> |
22 |
| - * import * as types from 'https://esm.sh/jsr/@iroha/[email protected]/data-model' |
23 |
| - * console.log(types.KeyPair.random().publicKey().multihash()) |
24 |
| - * </script> |
25 |
| - * ``` |
26 |
| - * |
27 |
| - * Useful links: |
28 |
| - * |
29 |
| - * - [Proposal - WebAssembly/ES Module Integration](https://github.com/WebAssembly/esm-integration/tree/main/proposals/esm-integration?rgh-link-date=2025-02-17T23%3A57%3A24.000Z) |
30 |
| - * - [Vite - WebAssembly](https://vite.dev/guide/features#webassembly) |
| 12 | + * This wasn't the case for `0.2.0`: it relied on `.wasm` ES Module Imports, which isn't widely supported (yet). |
31 | 13 | *
|
32 | 14 | * @example Deriving a KeyPair from seed
|
33 | 15 | * ```ts
|
|
0 commit comments