@tsrs/wasm 0.18.0-ts7.1.0-dev.20260929 → 0.20.0-ts7.1.0-beta

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
@@ -29,6 +29,11 @@ The command reads and writes the real file system, prints the compiler's output
29
29
  or trap (such as a stack overflow or running out of memory) exits with 5 and a message on stderr; ordinary compiler
30
30
  statuses are 0-4. Unsupported modes can also exit with 5.
31
31
 
32
+ The unreleased source build supports `--fast` and `TSRS_FAST=1`, with the same
33
+ [diagnostic, counter and incremental-cache side effects](https://github.com/oxc-project/tsrs/blob/main/README.md#fast-mode)
34
+ as native tsrs. WebAssembly remains single-threaded in both modes. The CLI inherits the shell environment;
35
+ `--fast false` overrides the environment preset.
36
+
32
37
  ## API
33
38
 
34
39
  ```js
@@ -57,7 +62,8 @@ Options:
57
62
  - `cwd`: defaults to the process's current directory on Node's real file system, or `/` with in-memory files.
58
63
  - `files`: absolute paths to contents (`string` or `Uint8Array`), replacing access to the real file system.
59
64
  - `diagnostics`: `"text"` (default) or `"json"` (the TypeScript API's diagnostic shape, with UTF-16 positions).
60
- - `env`: environment variables visible to the compiler; none are passed by default.
65
+ - `env`: environment variables visible to the compiler; none are passed by default. For example,
66
+ `env: { TSRS_FAST: "1" }` enables the fast preset in source builds, or pass `"--fast"` in the argument array.
61
67
  - `tty`, `caseInsensitive`: control terminal formatting and file-system case sensitivity.
62
68
  - Node: `stdout` / `stderr` can be `"inherit"` to write to the process's fds; output is collected otherwise.
63
69
  `stackSizeMb` sets the worker's stack size (default 256 MB).
package/core.js CHANGED
@@ -50,7 +50,7 @@ function prepare(module, request, host, io) {
50
50
  let instance;
51
51
  let memory;
52
52
  const view = () => new DataView(memory.buffer);
53
- const bytes = () => new Uint8Array(memory.buffer);
53
+ const bytes = (ptr = 0, len) => new Uint8Array(memory.buffer, ptr >>> 0, len);
54
54
  const env = Object.entries(io.env ?? {}).map(([k, v]) => encoder.encode(`${k}=${v}\0`));
55
55
  const stdout = io.stdout ?? (() => {});
56
56
  const stderr = io.stderr ?? (() => {});
@@ -141,11 +141,12 @@ function prepare(module, request, host, io) {
141
141
  },
142
142
  };
143
143
 
144
- const text = (ptr, len) => decoder.decode(bytes().subarray(ptr, ptr + len));
144
+ // Workers can reject subarray's species construction above 128 MiB; direct views work at those offsets.
145
+ const text = (ptr, len) => decoder.decode(bytes(ptr, len));
145
146
  const splitNul = (ptr, len) => {
146
- const b = bytes().subarray(ptr, ptr + len);
147
+ const b = bytes(ptr, len);
147
148
  const i = b.indexOf(0);
148
- return [decoder.decode(b.subarray(0, i < 0 ? len : i)), b.slice(i < 0 ? len : i + 1)];
149
+ return [decoder.decode(bytes(ptr, i < 0 ? len : i)), b.slice(i < 0 ? len : i + 1)];
149
150
  };
150
151
  const stage = (data) => {
151
152
  staged = typeof data === "string" ? encoder.encode(data) : data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsrs/wasm",
3
- "version": "0.18.0-ts7.1.0-dev.20260929",
3
+ "version": "0.20.0-ts7.1.0-beta",
4
4
  "license": "Apache-2.0",
5
5
  "description": "tsrs (a Rust port of the TypeScript 7 compiler) as a WebAssembly module: tsc for Node and browsers, single-threaded",
6
6
  "keywords": [
@@ -52,8 +52,8 @@
52
52
  "NOTICE.txt"
53
53
  ],
54
54
  "tsrs": {
55
- "typescriptVersion": "7.1.0-dev.20260929",
56
- "typescriptCommit": "b85298b6a81f772d080b0455de0ca9d744cd6fd6"
55
+ "typescriptVersion": "7.1.0-beta",
56
+ "typescriptCommit": "3e9236361fa97a9e6c685f4833ac457ae2d8c50a"
57
57
  },
58
58
  "scripts": {
59
59
  "test": "node --test test/*.test.mjs"
package/tsrs.wasm CHANGED
Binary file