docs(web): add WASM version compatibility section

Add documentation about version compatibility requirements between
web-tree-sitter parser ABIs for WASM file generation.

This helps users understand why Language.load() might fail when using
pre-built WASM files from third-party packages that were built with
incompatible tree-sitter-cli versions.

Co-authored-by: Will Lillis <will.lillis24@gmail.com>
This commit is contained in:
Kyuhwan Lee 2025-12-26 19:51:01 +09:00 committed by Will Lillis
parent 82639170a7
commit 8933cb7b40

View file

@ -193,6 +193,19 @@ npx tree-sitter build --wasm node_modules/tree-sitter-javascript
If everything is fine, file `tree-sitter-javascript.wasm` should be generated in current directory.
### Wasm compatibility
`web-tree-sitter` supports the same parser ABI versions as the corresponding tree-sitter library:
| web-tree-sitter version | Min parser ABI version | Max parser ABI version |
|-------------------------|------------------------|------------------------|
| 0.24.x | 13 | 14 |
| >= 0.25.0 | 13 | 15 |
> [!WARNING]
> Some prebuilt `.wasm` files use an older dynamic-linking format that newer versions of `web-tree-sitter` cannot
> load, even if their parser ABI is supported. Rebuild these files using a current tree-sitter CLI.
### Running .wasm in Node.js
Notice that executing `.wasm` files in Node.js is considerably slower than running [Node.js bindings][node bindings].