@willbooster/web-tree-sitter 2.0.32 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -158,8 +158,7 @@ npm install @willbooster/tree-sitter-javascript
158
158
  ```
159
159
 
160
160
  Then you can find `tree-sitter-javascript.wasm` in the `node_modules/@willbooster/tree-sitter-javascript` directory.
161
- Take a release of the grammar package that was generated for this package's major version: the releases generated for
162
- `@willbooster/web-tree-sitter` 1 are rejected (see [Wasm compatibility](#wasm-compatibility)).
161
+ Choose a grammar release generated for this package's language ABI (see [Wasm compatibility](#wasm-compatibility)).
163
162
 
164
163
  #### Generating `.wasm` files
165
164
 
@@ -173,7 +172,7 @@ JavaScript grammar:
173
172
 
174
173
  ```sh
175
174
  platform=macos-arm64 # or linux-x64, linux-arm64, macos-x64
176
- tag=v2.0.0 # a release from v2.0.0 on that lists tree-sitter-cli-$platform.tar.gz among its assets
175
+ tag=vX.Y.Z # replace with the release matching your installed @willbooster/web-tree-sitter version
177
176
  curl -fsSL "https://github.com/WillBooster/tree-sitter/releases/download/$tag/tree-sitter-cli-$platform.tar.gz" | tar -xz
178
177
  npm install tree-sitter-javascript
179
178
  (cd node_modules/tree-sitter-javascript && ../../tree-sitter generate src/grammar.json)
@@ -184,12 +183,9 @@ If everything is fine, file `tree-sitter-javascript.wasm` should be generated in
184
183
 
185
184
  ### Wasm compatibility
186
185
 
187
- `@willbooster/web-tree-sitter` loads only parsers generated by the CLI of this repository, which marks them with the
188
- language ABI number `0x57420001`. It rejects every other `.wasm` file: the ones built from parsers that upstream's
189
- Tree-sitter CLI generated, such as those upstream grammar packages and releases ship, and the ones built by the CLI
190
- releases of this repository before v2.0.0, such as those in the `@willbooster/tree-sitter-*` releases generated for
191
- `@willbooster/web-tree-sitter` 1. Upstream's `web-tree-sitter` rejects the files built here. Upgrade this package and
192
- the grammar `.wasm` files together.
186
+ `@willbooster/web-tree-sitter` accepts language ABI `0x57420002`. Generate parsers with the CLI from the same release
187
+ as the runtime, then rebuild their `.wasm` files. Parsers generated for other ABI versions are rejected, including
188
+ those generated by upstream's CLI. Upgrade the runtime and grammar `.wasm` files together.
193
189
 
194
190
  ### Running .wasm in Node.js
195
191
 
@@ -913,7 +913,7 @@ var require_web_tree_sitter = __commonJS({
913
913
  }, "convertJsFunctionToWasm");
914
914
  var wasmTableMirror = [];
915
915
  var wasmTable = new WebAssembly.Table({
916
- "initial": 31,
916
+ "initial": 33,
917
917
  "element": "anyfunc"
918
918
  });
919
919
  var getWasmTableEntry = /* @__PURE__ */ __name((funcPtr) => {