xbintsc 0.6.22 → 0.6.24
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/AGENTS.md +5 -0
- package/dist/src/cli/help.d.ts +1 -1
- package/dist/src/driver/build-key.js +2 -1
- package/dist/src/driver/build-key.js.map +1 -1
- package/dist/src/driver/bundler/concatenate.d.ts +23 -0
- package/dist/src/driver/bundler/concatenate.js +210 -0
- package/dist/src/driver/bundler/concatenate.js.map +1 -0
- package/dist/src/driver/bundler/merge.d.ts +4 -4
- package/dist/src/driver/bundler/merge.js +24 -207
- package/dist/src/driver/bundler/merge.js.map +1 -1
- package/dist/src/driver/bundler/{namespace-import.d.ts → namespace-object.d.ts} +5 -1
- package/dist/src/driver/bundler/{namespace-import.js → namespace-object.js} +6 -2
- package/dist/src/driver/bundler/namespace-object.js.map +1 -0
- package/dist/src/driver/bundler/{reexport-fixup.d.ts → reexport-resolution.d.ts} +9 -3
- package/dist/src/driver/bundler/{reexport-fixup.js → reexport-resolution.js} +16 -6
- package/dist/src/driver/bundler/reexport-resolution.js.map +1 -0
- package/dist/src/driver/fingerprint.d.ts +11 -0
- package/dist/src/driver/fingerprint.js +25 -0
- package/dist/src/driver/fingerprint.js.map +1 -1
- package/dist/src/driver/link-features.js +36 -11
- package/dist/src/driver/link-features.js.map +1 -1
- package/dist/src/driver/modules.d.ts +12 -5
- package/dist/src/driver/modules.js +12 -5
- package/dist/src/driver/modules.js.map +1 -1
- package/dist/src/driver/paths.d.ts +10 -0
- package/dist/src/driver/paths.js +18 -0
- package/dist/src/driver/paths.js.map +1 -1
- package/dist/src/driver/runtime-objects.d.ts +1 -1
- package/dist/src/driver/runtime-objects.js +22 -6
- package/dist/src/driver/runtime-objects.js.map +1 -1
- package/dist/src/driver/toolchain.d.ts +1 -1
- package/dist/src/driver/toolchain.js +10 -1
- package/dist/src/driver/toolchain.js.map +1 -1
- package/dist/src/driver/version.d.ts +1 -1
- package/dist/src/driver/version.js +1 -1
- package/dist/src/extensions/node/http2/feature.d.ts +14 -0
- package/dist/src/extensions/node/http2/feature.js +28 -0
- package/dist/src/extensions/node/http2/feature.js.map +1 -0
- package/dist/src/extensions/node/http2/index.d.ts +5 -1
- package/dist/src/extensions/node/http2/index.js +6 -1
- package/dist/src/extensions/node/http2/index.js.map +1 -1
- package/dist/src/extensions/node/index.js +3 -1
- package/dist/src/extensions/node/index.js.map +1 -1
- package/dist/src/extensions/node/tls/feature.d.ts +12 -0
- package/dist/src/extensions/node/tls/feature.js +24 -0
- package/dist/src/extensions/node/tls/feature.js.map +1 -0
- package/dist/src/extensions/node/tls/index.d.ts +5 -1
- package/dist/src/extensions/node/tls/index.js +5 -1
- package/dist/src/extensions/node/tls/index.js.map +1 -1
- package/dist/src/extensions/node/zlib/compression.js +11 -6
- package/dist/src/extensions/node/zlib/compression.js.map +1 -1
- package/dist/src/extensions/registry.js +2 -1
- package/dist/src/extensions/registry.js.map +1 -1
- package/dist/src/extensions/storage.js +4 -3
- package/dist/src/extensions/storage.js.map +1 -1
- package/dist/src/extensions/tls.d.ts +26 -0
- package/dist/src/extensions/tls.js +46 -0
- package/dist/src/extensions/tls.js.map +1 -0
- package/dist/tests/driver/deferred-reexport.test.js +25 -0
- package/dist/tests/driver/deferred-reexport.test.js.map +1 -1
- package/dist/tests/driver/link-features.test.js +9 -0
- package/dist/tests/driver/link-features.test.js.map +1 -1
- package/dist/tests/e2e/fetch.test.js +3 -1
- package/dist/tests/e2e/fetch.test.js.map +1 -1
- package/dist/tests/e2e/http2.test.d.ts +7 -0
- package/dist/tests/e2e/http2.test.js +201 -0
- package/dist/tests/e2e/http2.test.js.map +1 -0
- package/dist/tests/e2e/net-helpers.d.ts +28 -0
- package/dist/tests/e2e/net-helpers.js +59 -0
- package/dist/tests/e2e/net-helpers.js.map +1 -0
- package/dist/tests/e2e/node-modules.test.js +3 -5
- package/dist/tests/e2e/node-modules.test.js.map +1 -1
- package/dist/tests/e2e/tls.test.d.ts +10 -0
- package/dist/tests/e2e/tls.test.js +197 -0
- package/dist/tests/e2e/tls.test.js.map +1 -0
- package/dist/tests/extensions/storage.test.js +3 -2
- package/dist/tests/extensions/storage.test.js.map +1 -1
- package/doc/ai/contributing.md +14 -0
- package/doc/ai/extensions.md +5 -3
- package/doc/ai/language-support.md +1 -1
- package/doc/ai/zh-CN/contributing.md +12 -0
- package/doc/ai/zh-CN/extensions.md +4 -2
- package/doc/ai/zh-CN/language-support.md +1 -1
- package/doc/gui/api.md +1 -1
- package/doc/gui/build.md +5 -3
- package/doc/gui/rendering.md +1 -1
- package/doc/gui.md +1 -1
- package/doc/implemented/async.md +1 -1
- package/doc/implemented/extensions.md +1 -0
- package/doc/implemented/fetch.md +19 -4
- package/doc/implemented/node/http2.md +51 -0
- package/doc/implemented/node/tls.md +56 -0
- package/doc/implemented/node.md +8 -0
- package/doc/implemented/storage.md +2 -1
- package/doc/implemented.md +2 -2
- package/doc/unimplemented/node/modules.md +6 -6
- package/doc/unimplemented/toolchain.md +1 -1
- package/doc/zh-CN/gui/api.md +1 -1
- package/doc/zh-CN/gui/build.md +4 -2
- package/doc/zh-CN/gui/rendering.md +1 -1
- package/doc/zh-CN/gui.md +1 -1
- package/doc/zh-CN/implemented/async.md +1 -1
- package/doc/zh-CN/implemented/extensions.md +1 -0
- package/doc/zh-CN/implemented/fetch.md +15 -3
- package/doc/zh-CN/implemented/node/http2.md +44 -0
- package/doc/zh-CN/implemented/node/tls.md +47 -0
- package/doc/zh-CN/implemented/node.md +7 -0
- package/doc/zh-CN/implemented/storage.md +2 -1
- package/doc/zh-CN/implemented.md +2 -2
- package/doc/zh-CN/unimplemented/node/modules.md +3 -3
- package/doc/zh-CN/unimplemented/toolchain.md +1 -1
- package/package.json +16 -8
- package/runtime/ext_node/http2/http2.c +25 -11
- package/runtime/ext_node/http2/http2_backend.c +48 -0
- package/runtime/ext_node/http2/http2_bridge.c +25 -0
- package/runtime/ext_node/http2/parts/api.inc +40 -0
- package/runtime/ext_node/http2/parts/client.inc +215 -0
- package/runtime/ext_node/http2/parts/common.inc +330 -0
- package/runtime/ext_node/http2/parts/events.inc +139 -0
- package/runtime/ext_node/http2/parts/server.inc +301 -0
- package/runtime/ext_node/http2/parts/streams.inc +254 -0
- package/runtime/ext_node/tls/parts/api.inc +38 -0
- package/runtime/ext_node/tls/parts/connect.inc +107 -0
- package/runtime/ext_node/tls/parts/helpers.inc +121 -0
- package/runtime/ext_node/tls/parts/server.inc +101 -0
- package/runtime/ext_node/tls/parts/socket.inc +171 -0
- package/runtime/ext_node/tls/tls.c +21 -13
- package/runtime/ext_node/tls/tls_backend.c +50 -0
- package/runtime/ext_node/zlib/{miniz/compression_bridge.c → compression_bridge.c} +1 -1
- package/runtime/xt_fetch/async.inc +19 -12
- package/runtime/xt_fetch/socket.inc +55 -0
- package/runtime/xt_fetch.c +3 -0
- package/runtime/xt_http2/nghttp2_compat.h +19 -0
- package/runtime/xt_http2/nghttp2_static.h +18 -0
- package/runtime/xt_http2_api.h +38 -0
- package/runtime/xt_node_tls_api.h +37 -0
- package/runtime/xt_protocol_registry.c +22 -0
- package/runtime/xt_storage/storage_internal.h +3 -3
- package/runtime/xt_tls/parts/api.inc +21 -0
- package/runtime/xt_tls/parts/client.inc +112 -0
- package/runtime/xt_tls/parts/io.inc +157 -0
- package/runtime/xt_tls/parts/server.inc +102 -0
- package/runtime/xt_tls/parts/setup.inc +146 -0
- package/runtime/xt_tls/tls_bridge.c +27 -0
- package/runtime/xt_tls/tls_core.c +39 -0
- package/runtime/xt_tls/tls_internal.h +73 -0
- package/runtime/xt_tls_api.h +73 -0
- package/scripts/build-gui.ts +8 -7
- package/scripts/build-tls.ts +248 -0
- package/scripts/check-file-length.ts +4 -25
- package/scripts/fetch-vendored.ts +244 -0
- package/scripts/package-release.ts +13 -3
- package/src/driver/build-key.ts +7 -1
- package/src/driver/bundler/README.md +55 -0
- package/src/driver/bundler/concatenate.ts +244 -0
- package/src/driver/bundler/merge.ts +24 -215
- package/src/driver/bundler/{namespace-import.ts → namespace-object.ts} +5 -1
- package/src/driver/bundler/{reexport-fixup.ts → reexport-resolution.ts} +15 -5
- package/src/driver/fingerprint.ts +24 -0
- package/src/driver/link-features.ts +33 -11
- package/src/driver/modules.ts +12 -5
- package/src/driver/paths.ts +20 -0
- package/src/driver/runtime-objects.ts +25 -6
- package/src/driver/toolchain.ts +11 -2
- package/src/driver/version.ts +1 -1
- package/src/extensions/node/http2/feature.ts +33 -0
- package/src/extensions/node/http2/index.ts +6 -1
- package/src/extensions/node/index.ts +3 -1
- package/src/extensions/node/tls/feature.ts +29 -0
- package/src/extensions/node/tls/index.ts +5 -1
- package/src/extensions/node/zlib/compression.ts +11 -6
- package/src/extensions/registry.ts +2 -1
- package/src/extensions/storage.ts +4 -3
- package/src/extensions/tls.ts +52 -0
- package/{runtime/ext_gui → vendor/stb}/stb_image.h +17 -1
- package/dist/src/driver/bundler/namespace-import.js.map +0 -1
- package/dist/src/driver/bundler/reexport-fixup.js.map +0 -1
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz.c +0 -0
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz.h +0 -0
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz_common.h +0 -0
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz_export.h +0 -0
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz_tdef.c +0 -0
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz_tdef.h +0 -0
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz_tinfl.c +0 -0
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz_tinfl.h +0 -0
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz_zip.h +0 -0
- /package/{runtime/ext_gui → vendor/nanosvg}/nanosvg.h +0 -0
- /package/{runtime/ext_gui → vendor/nanosvg}/nanosvgrast.h +0 -0
- /package/{runtime/xt_storage → vendor}/sqlite3/sqlite3.c +0 -0
- /package/{runtime/xt_storage → vendor}/sqlite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,CAAC;AAEL,CAAC,CAAC,CAAC"}
|
|
@@ -14,8 +14,9 @@ describe("core extension storage globals", () => {
|
|
|
14
14
|
});
|
|
15
15
|
it("declares the storage link feature carrying the SQLite sources", () => {
|
|
16
16
|
const features = coreExtension.linkFeatures?.() ?? [];
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const storage = features.find((feature) => feature.name === "storage");
|
|
18
|
+
expect(storage).toBeDefined();
|
|
19
|
+
const sources = storage?.runtimeSources?.() ?? [];
|
|
19
20
|
expect(sources.some((source) => /sqlite3\.c$/.test(source))).toBe(true);
|
|
20
21
|
expect(sources.some((source) => /xt_storage[\\/]storage\.c$/.test(source))).toBe(true);
|
|
21
22
|
expect(sources.some((source) => /xt_storage[\\/]indexed_db\.c$/.test(source))).toBe(true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.test.js","sourceRoot":"","sources":["../../../tests/extensions/storage.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,OAAO,GAAG,aAAa,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,CAAC;QACrD,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,kBAA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E,GAAG,CAAC,CAAC;QACrF,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAElE,MAAM,MAAM,GAAG,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC,iBAAiB,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;QAChF,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QACvE,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/doc/ai/contributing.md
CHANGED
|
@@ -8,11 +8,17 @@ get wrong.
|
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npm install
|
|
11
|
+
npm run vendor # fetch the pinned stb/NanoSVG/miniz/SQLite sources into vendor/
|
|
11
12
|
npm run typecheck # tsc --noEmit
|
|
12
13
|
npm run lint # eslint + the 600-line file budget
|
|
13
14
|
npm test # unit + end-to-end
|
|
14
15
|
```
|
|
15
16
|
|
|
17
|
+
`vendor/` is not committed: `npm run vendor` fetches each package at an
|
|
18
|
+
immutable pinned revision and verifies its SHA-256 (`npm test` runs it through
|
|
19
|
+
`pretest`). Only the `gui` build and programs that use `storage` or
|
|
20
|
+
`compression` need the files.
|
|
21
|
+
|
|
16
22
|
Node.js ≥ 22 is required to run the compiler from source, and a **clang 16+**
|
|
17
23
|
toolchain is required for anything that links a binary (see
|
|
18
24
|
[troubleshooting.md](./troubleshooting.md)). `xbintsc emit` needs neither clang
|
|
@@ -180,11 +186,19 @@ diff scratch/ref.ll scratch/gen2.ll
|
|
|
180
186
|
effect:
|
|
181
187
|
|
|
182
188
|
```bash
|
|
189
|
+
npm run vendor # fetch the pinned vendored sources -> vendor/
|
|
183
190
|
npm run runtime # tsx scripts/build-runtime.ts -> runtime/lib/<os>-<arch>/
|
|
184
191
|
npm run runtime:clean # drop build/runtime-obj and runtime/lib
|
|
185
192
|
npm run package-platform # pack the host archives -> dist/npm-platform/*.tgz
|
|
193
|
+
npm run tls # build the optional mbedTLS/nghttp2 feature archives
|
|
186
194
|
```
|
|
187
195
|
|
|
196
|
+
`npm run tls` fetches the pinned mbedTLS and nghttp2 releases into `vendor/`
|
|
197
|
+
(gitignored, like `gui`/`media`) and writes `tls`/`nghttp2` into
|
|
198
|
+
`runtime/lib/<os>-<arch>/`. The `tls`/`http2`/https-fetch e2e suites skip when
|
|
199
|
+
those archives are missing, so run it once before `npm test` when touching
|
|
200
|
+
TLS or HTTP/2.
|
|
201
|
+
|
|
188
202
|
`package-platform` produces the optional `@xbintsc/<os>-<arch>` npm package; CI
|
|
189
203
|
uploads it for every host and `release.yml` publishes it before `xbintsc`. Before
|
|
190
204
|
publishing, `npm run verify:platform` (`scripts/verify-platform-package.ts`)
|
package/doc/ai/extensions.md
CHANGED
|
@@ -47,6 +47,7 @@ resolve to the same implementation.
|
|
|
47
47
|
| `stream`, `stream/promises` | |
|
|
48
48
|
| `events` | |
|
|
49
49
|
| `net`, `dgram`, `http` | sockets and servers on the xbintsc event loop (see the async caveat below) |
|
|
50
|
+
| `tls`, `http2` | mbedTLS client/server and nghttp2 h2c/TLS+ALPN; optional link features built by `npm run tls` |
|
|
50
51
|
| `child_process` | |
|
|
51
52
|
| `worker_threads` | |
|
|
52
53
|
| `util`, `querystring`, `url`, `assert`, `test`, `zlib` | |
|
|
@@ -128,9 +129,10 @@ glslang. Queries, atomics and DOM-image uploads report validation errors; see
|
|
|
128
129
|
[../gui/webgpu.md](../gui/webgpu.md). WebXR and streaming are **not**
|
|
129
130
|
implemented: `typeof` answers `"undefined"` so a page takes its own fallback
|
|
130
131
|
branch. `fetch`
|
|
131
|
-
is **not** a GUI extension feature: the core runtime provides it (`http
|
|
132
|
-
plus local `file://` and relative paths;
|
|
133
|
-
programs can use it too. See
|
|
132
|
+
is **not** a GUI extension feature: the core runtime provides it (`http://` and
|
|
133
|
+
`https://`, plus local `file://` and relative paths; HTTPS links the optional
|
|
134
|
+
`tls` feature, and responses are buffered), so GUI programs can use it too. See
|
|
135
|
+
[../implemented/fetch.md](../implemented/fetch.md).
|
|
134
136
|
|
|
135
137
|
### `storage` — SQLite-backed Web Storage and IndexedDB (a core link feature)
|
|
136
138
|
|
|
@@ -77,7 +77,7 @@ Canonical detail (always current, much longer):
|
|
|
77
77
|
| `queueMicrotask` / `setImmediate` / `performance.now` | ✅ | microtasks share the promise FIFO queue; `setImmediate` is a zero-delay timer with numeric ids; `performance.now` is monotonic fractional milliseconds |
|
|
78
78
|
| Sockets / servers (`http`, `net`, `dgram`) | ✅ | callbacks run on the event loop and can settle a promise you await (`net` / `http` examples included in the tests) |
|
|
79
79
|
| `fs/promises` | ✅ | file, directory and `FileHandle` operations run on the async I/O worker pool and settle on the reactor, so timers and sockets keep running while they wait |
|
|
80
|
-
| Global `fetch` | ✅ | HTTP/1.1 client whose connect/send/receive runs on the same worker pool; `await fetch(...)` yields and redirects are followed on the reactor. `http://`
|
|
80
|
+
| Global `fetch` | ✅ | HTTP/1.1 client whose connect/send/receive runs on the same worker pool; `await fetch(...)` yields and redirects are followed on the reactor. `http://` and `https://` (the optional `tls` link feature, mbedTLS; selected by an `https://` literal or `--feature tls`); the body is buffered before resolving |
|
|
81
81
|
| Worker threads | 🚫 | workers are child processes |
|
|
82
82
|
| `async` generators | ✅ | suspend at `await` and `yield`; every `.next()` returns a promise; `for await...of` supported |
|
|
83
83
|
|
|
@@ -7,11 +7,16 @@
|
|
|
7
7
|
|
|
8
8
|
```bash
|
|
9
9
|
npm install
|
|
10
|
+
npm run vendor # 把固定版本的 stb/NanoSVG/miniz/SQLite 源码取到 vendor/
|
|
10
11
|
npm run typecheck # tsc --noEmit
|
|
11
12
|
npm run lint # eslint + 600 行文件预算
|
|
12
13
|
npm test # 单元测试 + 端到端测试
|
|
13
14
|
```
|
|
14
15
|
|
|
16
|
+
`vendor/` 不提交进仓库:`npm run vendor` 会按不可变的固定版本获取每个包并校验其
|
|
17
|
+
SHA-256(`npm test` 通过 `pretest` 自动运行)。只有 `gui` 构建以及使用 `storage` 或
|
|
18
|
+
`compression` 的程序需要这些文件。
|
|
19
|
+
|
|
15
20
|
从源码运行编译器需要 Node.js ≥ 22;任何会链接二进制的操作都需要 **clang 16+** 工具链
|
|
16
21
|
(见 [troubleshooting.md](./troubleshooting.md))。`xbintsc emit` 既不需要 clang 也不需要
|
|
17
22
|
运行时库,因此它是最快的内循环。
|
|
@@ -149,11 +154,18 @@ diff scratch/ref.ll scratch/gen2.ll
|
|
|
149
154
|
C 改动必须重建运行时才会生效:
|
|
150
155
|
|
|
151
156
|
```bash
|
|
157
|
+
npm run vendor # 获取固定版本的 vendored 源码 -> vendor/
|
|
152
158
|
npm run runtime # tsx scripts/build-runtime.ts -> runtime/lib/<os>-<arch>/
|
|
153
159
|
npm run runtime:clean # 删除 build/runtime-obj 与 runtime/lib
|
|
154
160
|
npm run package-platform # 把宿主归档打包 -> dist/npm-platform/*.tgz
|
|
161
|
+
npm run tls # 构建可选的 mbedTLS/nghttp2 特性归档
|
|
155
162
|
```
|
|
156
163
|
|
|
164
|
+
`npm run tls` 会把固定版本的 mbedTLS 与 nghttp2 下载到 `vendor/`(与
|
|
165
|
+
`gui`/`media` 一样被 git 忽略),并把 `tls`/`nghttp2` 写入
|
|
166
|
+
`runtime/lib/<os>-<arch>/`。缺少这些归档时 `tls`/`http2`/https-fetch 端到端测试会
|
|
167
|
+
跳过,因此改动 TLS 或 HTTP/2 后请先运行一次再跑 `npm test`。
|
|
168
|
+
|
|
157
169
|
`package-platform` 生成可选的 `@xbintsc/<os>-<arch>` npm 包;CI 会为每个宿主上传
|
|
158
170
|
它,`release.yml` 在发布 `xbintsc` 之前先发布这些平台包。发布前
|
|
159
171
|
`npm run verify:platform`(`scripts/verify-platform-package.ts`)会逐个校验暂存的
|
|
@@ -45,6 +45,7 @@ xbintsc run app.ts --ext node
|
|
|
45
45
|
| `stream`、`stream/promises` | |
|
|
46
46
|
| `events` | |
|
|
47
47
|
| `net`、`dgram`、`http` | 跑在 xbintsc 事件循环上的套接字与服务端(注意下面的异步限制) |
|
|
48
|
+
| `tls`、`http2` | mbedTLS 客户端/服务端与 nghttp2 h2c/TLS+ALPN;由 `npm run tls` 构建的可选链接特性 |
|
|
48
49
|
| `child_process` | |
|
|
49
50
|
| `worker_threads` | |
|
|
50
51
|
| `util`、`querystring`、`url`、`assert`、`test`、`zlib` | |
|
|
@@ -116,8 +117,9 @@ VAO、实例化、整数属性、采样器对象、`texStorage2D` 与缓冲拷
|
|
|
116
117
|
[../../zh-CN/gui/webgpu.md](../../zh-CN/gui/webgpu.md)。WebXR 与流式接口**尚未实现**:
|
|
117
118
|
`typeof` 会回答
|
|
118
119
|
`"undefined"`,让页面走自己的降级分支。`fetch` 不是 GUI 扩展的功能——它由核心
|
|
119
|
-
运行时提供(`http://`,以及本地 `file://`
|
|
120
|
-
|
|
120
|
+
运行时提供(`http://` 与 `https://`,以及本地 `file://` 与相对路径;HTTPS 会链接可选的
|
|
121
|
+
`tls` 特性,响应整体缓冲),因此 GUI 程序同样可用。见
|
|
122
|
+
[../../implemented/fetch.md](../../implemented/fetch.md)。
|
|
121
123
|
|
|
122
124
|
### `storage` —— 基于 SQLite 的 Web Storage 与 IndexedDB(核心链接特性)
|
|
123
125
|
|
|
@@ -74,7 +74,7 @@ xbintsc 编译 TypeScript 的一个**实用子集**。本页用来判断你能
|
|
|
74
74
|
| `queueMicrotask` / `setImmediate` / `performance.now` | ✅ | 微任务与 Promise 共用 FIFO 队列;`setImmediate` 是零延迟定时器,返回数字 id;`performance.now` 返回单调递增的毫秒小数 |
|
|
75
75
|
| 套接字/服务端(`http`、`net`、`dgram`) | ✅ | 回调在事件循环上执行,可以 settle 你正在 await 的 Promise(测试含 `net`/`http` 示例) |
|
|
76
76
|
| `fs/promises` | ✅ | 文件、目录与 `FileHandle` 操作跑在异步 I/O 线程池上,并在 reactor 上 settle,等待期间定时器与套接字继续运行 |
|
|
77
|
-
| 全局 `fetch` | ✅ | HTTP/1.1 客户端,connect/send/receive 跑在同一线程池;`await fetch(...)` 会让出,重定向在 reactor
|
|
77
|
+
| 全局 `fetch` | ✅ | HTTP/1.1 客户端,connect/send/receive 跑在同一线程池;`await fetch(...)` 会让出,重定向在 reactor 上处理。支持 `http://` 与 `https://`(可选 `tls` 链接特性,mbedTLS;由 `https://` 字面量或 `--feature tls` 选中),resolve 前缓冲整个响应体 |
|
|
78
78
|
| worker 线程 | 🚫 | worker 是子进程 |
|
|
79
79
|
| `async` 生成器 | ✅ | 可在 `await` 与 `yield` 处挂起;每次 `.next()` 返回 Promise;支持 `for await...of` |
|
|
80
80
|
|
package/doc/gui/api.md
CHANGED
|
@@ -108,7 +108,7 @@ requestAnimationFrame(frame);
|
|
|
108
108
|
| `navigator` | `userAgent` (a desktop Chrome string ending in `xbintsc`), `platform`, `vendor`, `language(s)`, `hardwareConcurrency`, `maxTouchPoints`, `onLine`, `vibrate()` |
|
|
109
109
|
| `localStorage` | an in-memory `getItem` / `setItem` / `removeItem` / `clear` / `key` / `length` store |
|
|
110
110
|
| `AudioContext`, `webkitAudioContext` | a Web Audio graph with a real mixer and decoder (see below) |
|
|
111
|
-
| `fetch(input, init)` | the core runtime's HTTP/1.1 client, available to GUI programs too: `http
|
|
111
|
+
| `fetch(input, init)` | the core runtime's HTTP/1.1 client, available to GUI programs too: `http://` and `https://` (the latter links the optional `tls` feature), plus local `file://` and relative paths; responses are buffered. See [Implemented fetch](../implemented/fetch.md). |
|
|
112
112
|
| `Event`, `CustomEvent`, `ProgressEvent`, `MouseEvent`, `KeyboardEvent`, `PointerEvent`, `WheelEvent`, `FocusEvent`, `InputEvent`, `SubmitEvent` | event constructors; the `init` argument is kept as given (`detail`, `composed`, mouse/keyboard fields, …) |
|
|
113
113
|
| `AbortController`, `AbortSignal` | a real controller/signal pair for `{ signal }` listener removal, with `abort()`, `aborted`, `reason`, `onabort` and `throwIfAborted()` |
|
|
114
114
|
| `HTMLCanvasElement`, `HTMLImageElement`, `WebGLRenderingContext`, `WebGL2RenderingContext`, `WebGLBuffer`/`WebGLTexture`/`WebGLShader`/`WebGLProgram`/`WebGLFramebuffer`/`WebGLRenderbuffer`/`WebGLUniformLocation`/`WebGLActiveInfo`/`WebGLVertexArrayObject`/`WebGLSampler`/`WebGLQuery`/`WebGLSync`/`WebGLTransformFeedback` | real constructor values. `canvas.getContext("webgl")` and `getContext("webgl2")` return GPU contexts (see [WebGL](./webgl.md)). |
|
package/doc/gui/build.md
CHANGED
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
> decisions and roadmap live there.
|
|
5
5
|
|
|
6
6
|
- Sources live in `runtime/ext_gui/` (C/C++) plus vendored libs under `vendor/`
|
|
7
|
-
(gitignored; fetched on demand).
|
|
8
|
-
|
|
7
|
+
(gitignored; fetched on demand). `npm run vendor` fetches the pinned
|
|
8
|
+
stb/NanoSVG headers (and the miniz/SQLite sources the link features compile);
|
|
9
|
+
`npm run gui` fetches just the two header sets it needs. Media decoding lives
|
|
10
|
+
in `runtime/xt_media/` and is built separately.
|
|
9
11
|
- `npm run gui` (`scripts/build-gui.ts`) fetches a pinned SDL3 (`SDL3_TAG`,
|
|
10
12
|
default `release-3.2.10`), builds a static SDL3, fetches and builds static
|
|
11
13
|
**FreeType** (`FREETYPE_VERSION`, default `2.13.3`) and **HarfBuzz**
|
|
@@ -20,7 +22,7 @@
|
|
|
20
22
|
Windows/Linux the script neither fetches nor merges SPIRV-Cross:
|
|
21
23
|
`webgl_msl.cpp` compiles to nothing there and the ~2.5 MiB it contributes
|
|
22
24
|
would be unreachable. The default text path uses the bundled
|
|
23
|
-
**stb_truetype** (`
|
|
25
|
+
**stb_truetype** (`vendor/stb/stb_truetype.h`); HarfBuzz + FreeType are
|
|
24
26
|
only extracted when the `shaping` feature is active.
|
|
25
27
|
Every library (SDL3, FreeType, HarfBuzz, glslang, SPIRV-Cross and the engine)
|
|
26
28
|
is compiled with `-ffunction-sections -fdata-sections`, and SDL is configured
|
package/doc/gui/rendering.md
CHANGED
|
@@ -197,7 +197,7 @@ unavailable it is skipped while the rest of the page still paints.
|
|
|
197
197
|
|
|
198
198
|
`runtime/ext_gui/text.{h,cpp}` is the front-end; it dispatches through a small
|
|
199
199
|
backend table. The default backend is the bundled **stb_truetype**
|
|
200
|
-
(`text_stb.cpp`, `
|
|
200
|
+
(`text_stb.cpp`, `vendor/stb/stb_truetype.h`). The optional **`shaping`**
|
|
201
201
|
link feature installs `text_hb.cpp`, a HarfBuzz + FreeType backend, and is
|
|
202
202
|
selected automatically for non-ASCII text or an author `@font-face` rule. Both
|
|
203
203
|
backends share the font database in `text_font_db.cpp` (discovery and indexing)
|
package/doc/gui.md
CHANGED
|
@@ -151,7 +151,7 @@ Pinned versions: SDL3 `release-3.2.10`, FreeType `2.13.3`, HarfBuzz `10.1.0`
|
|
|
151
151
|
`vulkan-sdk-1.4.313.0`, FFmpeg `7.1` for the optional `media` archive
|
|
152
152
|
(overridable with `SDL3_TAG` / `FREETYPE_VERSION` / `HARFBUZZ_VERSION` /
|
|
153
153
|
`GLSLANG_VERSION` / `SPIRV_CROSS_VERSION` / `FFMPEG_VERSION`). The default text
|
|
154
|
-
backend is the bundled `stb_truetype.h`; it accepts TrueType outlines (not
|
|
154
|
+
backend is the bundled `vendor/stb/stb_truetype.h`; it accepts TrueType outlines (not
|
|
155
155
|
CFF/OTF or variable fonts). The `shaping` feature swaps in HarfBuzz + FreeType
|
|
156
156
|
for full OpenType shaping.
|
|
157
157
|
|
package/doc/implemented/async.md
CHANGED
|
@@ -47,6 +47,6 @@ Location: `runtime/xt_async.c`, `runtime/xt_coroutine.c`, `runtime/xt_promise.c`
|
|
|
47
47
|
- `fetch` runs each request/redirect hop as a job; `fs/promises` runs every file and descriptor operation as a job. Neither blocks timers, sockets or other `await`s.
|
|
48
48
|
- The event loop stays alive while jobs are outstanding (`xt_loop_has_work`), and exits once the pool is idle again.
|
|
49
49
|
|
|
50
|
-
Known limits of the asynchronous surface (
|
|
50
|
+
Known limits of the asynchronous surface (streaming/abortable `fetch`, inert
|
|
51
51
|
`fs.watch`, four-worker pool) are listed in
|
|
52
52
|
[Runtime deviations](../unimplemented/deviations.md) and the Node pages.
|
|
@@ -12,6 +12,7 @@ Location: `src/extensions/registry.ts`, `src/extensions/node/`, `src/extensions/
|
|
|
12
12
|
- `resolveLinkFeatures` applies `--feature` / `--no-feature` (and `all`), expands `requires`, reports an unavailable auto-detected feature as a warning and a forced one as an error, and returns the bridges/archives/flags to link.
|
|
13
13
|
- The bridge is the strong reference: its constructor installs the feature's dispatch table and its references force the linker to extract the implementation. With no bridge, the table stays null and the implementation members are never linked.
|
|
14
14
|
- Current clients: `media` (FFmpeg, `runtime/xt_media/media_bridge.c` + `media.a`), `gpu` (glslang/SPIRV-Cross, `runtime/ext_gui/gpu_bridge.c` + `gpu_feature.cpp` inside `gui.a`), `images` (stb_image/NanoSVG, `runtime/ext_gui/image_bridge.c` + `image_feature.cpp`), `shaping` (HarfBuzz/FreeType, `runtime/ext_gui/text_bridge.c` + `text_hb.cpp`), `webgl` (context/DOM bindings, `runtime/ext_gui/webgl_bridge.c` + `webgl_feature.cpp`, requiring `gpu`), and `storage` (SQLite-backed Web Storage/IndexedDB, whose implementation lives entirely in the feature's `runtimeSources` — `runtime/xt_storage/*.c` — because the globals themselves are the strong references).
|
|
15
|
+
- TLS/HTTP2 clients: `tls` (the mbedTLS transport in `runtime/xt_tls/tls_core.c` plus the `tls` archive, used by `fetch` and `node:tls`), `node-tls` (the `TLSSocket`/server surface, requiring `tls`) and `http2` (the nghttp2 backend in `runtime/ext_node/http2/http2_backend.c`, requiring `tls` and `node-tls`; `npm run tls` builds both archives).
|
|
15
16
|
- The built-in core extension `core`: exposes `print` (mapped to `xt_println`), always registered.
|
|
16
17
|
- The Node extension `node`:
|
|
17
18
|
- Modular organisation: `src/extensions/node/fs/` + `runtime/ext_node/fs/read_file.c`
|
package/doc/implemented/fetch.md
CHANGED
|
@@ -4,15 +4,23 @@
|
|
|
4
4
|
|
|
5
5
|
Location: `runtime/xt_fetch.c`, `runtime/xt_fetch/async.inc`, `runtime/xt_async_io.c`.
|
|
6
6
|
|
|
7
|
-
- Global `fetch(input, init)` is an HTTP/1.1 client
|
|
7
|
+
- Global `fetch(input, init)` is an HTTP/1.1 client over either `http://` or
|
|
8
|
+
`https://`. The blocking socket exchange
|
|
8
9
|
(`getaddrinfo`, connect, send, receive) runs on the asynchronous I/O worker
|
|
9
10
|
pool, so a request in flight does **not** stall the event loop: timers, sockets
|
|
10
11
|
and other `await`s keep running and the promise settles when the reactor
|
|
11
12
|
dispatches the completed exchange.
|
|
12
13
|
- Redirects are followed on the main thread: each hop is one offloaded
|
|
13
14
|
exchange, up to 20 redirects, and a 301/302/303 switches POST to GET.
|
|
14
|
-
- It accepts `http://`
|
|
15
|
-
|
|
15
|
+
- It accepts `http://` and `https://` URLs. HTTPS is served by the optional
|
|
16
|
+
`tls` link feature (vendored mbedTLS): the compiler selects it for an
|
|
17
|
+
`https://` literal (or `--feature tls`), and a program that never makes an
|
|
18
|
+
HTTPS request pays nothing. Without the archive a request rejects with a
|
|
19
|
+
`TypeError` naming the missing feature. Certificates are verified against the
|
|
20
|
+
platform trust store (Windows `ROOT`, Linux CA bundles, macOS
|
|
21
|
+
`/etc/ssl/cert.pem`); `NODE_EXTRA_CA_CERTS` names an extra PEM bundle to
|
|
22
|
+
trust, which is how a private or self-signed CA is used. `fetch` takes no
|
|
23
|
+
`ca` option in `init`.
|
|
16
24
|
- A reference with **no scheme** (a relative path) and `file://` URLs read a
|
|
17
25
|
local file, so a compiled program can load an asset from disk without an HTTP
|
|
18
26
|
server. Relative paths resolve against the working directory; `GET` / `HEAD`
|
|
@@ -45,5 +53,12 @@ setTimeout(() => console.log("timer"), 10); // runs before the 150ms response
|
|
|
45
53
|
await pending;
|
|
46
54
|
```
|
|
47
55
|
|
|
48
|
-
|
|
56
|
+
An HTTPS request works the same way once the `tls` feature is linked:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
const response = await fetch("https://example.com/status");
|
|
60
|
+
console.log(response.status, await response.text());
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Known limits (buffered body, no streaming or abort signal) are listed in
|
|
49
64
|
[Runtime deviations](../unimplemented/deviations.md).
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# `http2`
|
|
2
|
+
|
|
3
|
+
> Part of [Node extension: implemented](../node.md) · [简体中文](../../zh-CN/implemented/node/http2.md)
|
|
4
|
+
|
|
5
|
+
Location: `src/extensions/node/http2/`, `runtime/ext_node/http2/`, `runtime/xt_http2/`
|
|
6
|
+
|
|
7
|
+
HTTP/2 framing and HPACK come from vendored nghttp2. The `http2` link feature is
|
|
8
|
+
selected by importing `http2` / `node:http2` (or naming `createSecureServer`);
|
|
9
|
+
it `requires: ["tls", "node-tls"]`, because a secure server reuses the
|
|
10
|
+
`node:tls` server wrapper and both schemes negotiate ALPN `h2` through mbedTLS.
|
|
11
|
+
`runtime/ext_node/http2/http2_backend.c` is compiled into the pinned nghttp2
|
|
12
|
+
archive (`runtime/lib/<os>-<arch>/nghttp2.{a,lib}`); the feature's compiled
|
|
13
|
+
entry point is `http2_bridge.c`, whose call extracts the backend and installs
|
|
14
|
+
it. `npm run tls` builds that archive and the mbedTLS one, so an installed npm
|
|
15
|
+
package does not need the vendored headers.
|
|
16
|
+
|
|
17
|
+
An `Http2Session` owns one socket and one `nghttp2_session`. The runtime's
|
|
18
|
+
readiness reactor feeds bytes to `nghttp2_session_mem_recv2` and flushes
|
|
19
|
+
`nghttp2_session_mem_send2`; nghttp2 callbacks raise the JavaScript events.
|
|
20
|
+
There is no HTTP/1.1 upgrade: a cleartext `http://` connection speaks h2c with
|
|
21
|
+
prior knowledge, exactly like Node's client.
|
|
22
|
+
|
|
23
|
+
| API | Notes |
|
|
24
|
+
| --- | --- |
|
|
25
|
+
| `http2.connect(authority[, options][, listener])` | `http(s)://host:port`; `options`: `ca`, `rejectUnauthorized`; returns a connected `ClientHttp2Session` and emits `connect` |
|
|
26
|
+
| `session.request(headers[, options])` | `headers` with `:method` (default `GET`), `:path`, `:scheme`, `:authority` plus ordinary fields; returns a `ClientHttp2Stream` |
|
|
27
|
+
| `stream.end([data])` / `write(data)` / `close()` | request body and cancellation; emits `response(headers, flags)`, `data`, `end`, `close`, `error` |
|
|
28
|
+
| `session.close()` / `destroy()` | sends GOAWAY and closes the transport |
|
|
29
|
+
| `http2.createServer([options][, onRequest])` | cleartext h2c server; `listen` / `address` / `close` behave like `net.Server` |
|
|
30
|
+
| `http2.createSecureServer(options[, onRequest])` | TLS + ALPN `h2`; `options` needs `cert` and `key` (plus `ca` for client certificates) |
|
|
31
|
+
| `server.on("stream", (stream, headers) => …)` | server-side stream combines the request emitter with `respond` / `setHeader` / `write` / `end` |
|
|
32
|
+
| `http2.constants` | frame-type and error-code numbers (`NGHTTP2_FLAG_END_STREAM`, `NGHTTP2_CANCEL`, …) |
|
|
33
|
+
|
|
34
|
+
Server-side streams expose `method`, `url`, `scheme`, `authority`,
|
|
35
|
+
`httpVersion` (`"2.0"`) and `headers`; the second `stream` argument is the same
|
|
36
|
+
headers object. `respond(statusOrHeaders[, headers])` (or `respond({":status":
|
|
37
|
+
201})`), `setHeader` / `getHeader` and `write` / `end` submit the response. The
|
|
38
|
+
incoming request body is delivered through `data` / `end` and is also available
|
|
39
|
+
through the same stream object.
|
|
40
|
+
|
|
41
|
+
The e2e suite proves interoperability in both directions: a compiled client
|
|
42
|
+
against Node's `http2` server (h2c and TLS) and Node's client against a compiled
|
|
43
|
+
`createServer` / `createSecureServer`.
|
|
44
|
+
|
|
45
|
+
## Known limits
|
|
46
|
+
|
|
47
|
+
`pushStream`, trailers, extended CONNECT, session pooling / connection reuse,
|
|
48
|
+
`stream.priority` and flow-control tuning are not implemented. Response headers
|
|
49
|
+
and body are buffered until `end()` (which is when the response is submitted),
|
|
50
|
+
so a handler that wants to stream a long body still works but does not flush
|
|
51
|
+
partial responses early.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# `tls`
|
|
2
|
+
|
|
3
|
+
> Part of [Node extension: implemented](../node.md) · [简体中文](../../zh-CN/implemented/node/tls.md)
|
|
4
|
+
|
|
5
|
+
Location: `src/extensions/node/tls/`, `runtime/ext_node/tls/`, `runtime/xt_tls/`
|
|
6
|
+
|
|
7
|
+
`node:tls` is backed by vendored mbedTLS (TLS 1.2/1.3, X.509 and PSA crypto).
|
|
8
|
+
Two link features keep it optional:
|
|
9
|
+
|
|
10
|
+
- **`tls`** (declared by the core extension) is the mbedTLS transport:
|
|
11
|
+
`runtime/xt_tls/tls_core.c` is archived into `tls.{a,lib}` and the feature's
|
|
12
|
+
compiled entry point is the tiny `tls_bridge.c`, whose call extracts the
|
|
13
|
+
backend and installs it. `fetch` uses it for `https://` URLs. It is selected
|
|
14
|
+
by an `https://` literal, `node:tls`/`node:http2` usage, or `--feature tls`.
|
|
15
|
+
- **`node-tls`** (`requires: ["tls"]`) adds the JavaScript surface in
|
|
16
|
+
`runtime/ext_node/tls/tls_backend.c` and is selected by importing `tls` /
|
|
17
|
+
`node:tls` (the import specifier is a string literal in the bundle).
|
|
18
|
+
|
|
19
|
+
`npm run tls` fetches the pinned mbedTLS release into `vendor/mbedtls`, compiles
|
|
20
|
+
it together with `tls_core.c` and writes `runtime/lib/<os>-<arch>/tls.{a,lib}`.
|
|
21
|
+
The bridge and the backend are the only tracked sources, so an installed npm
|
|
22
|
+
package compiles a TLS-using program without the vendored headers. Without the
|
|
23
|
+
archive the modules still import, but the calls throw a clear runtime error;
|
|
24
|
+
`--feature tls` turns the missing archive into a build error.
|
|
25
|
+
|
|
26
|
+
| API | Notes |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| `tls.connect(options[, callback])` | `options`: `port`, `host`, `servername`, `ca`, `cert`, `key`, `rejectUnauthorized`, `ALPNProtocols`. Also `connect(port[, host][, options][, callback])` |
|
|
29
|
+
| `tls.createServer(options[, onSecure])` | `options`: `cert`, `key`, `ca`, `requestCert`, `rejectUnauthorized`, `ALPNProtocols`; reuses `net.Server` for `listen` / `address` / `close` |
|
|
30
|
+
| `tls.TLSSocket` | EventEmitter with `write` / `end` / `destroy` / `address` / `setEncoding` / `getPeerCertificate`; emits `data`, `end`, `close`, `error` |
|
|
31
|
+
|
|
32
|
+
`connect` performs the TCP connect and TLS handshake synchronously, then returns
|
|
33
|
+
an already-secure socket. `secureConnect` and the callback are delivered on a
|
|
34
|
+
zero-delay timer, so they run after the `const socket = connect(...)` binding is
|
|
35
|
+
initialised, matching Node's ordering. The socket's readiness watcher decrypts
|
|
36
|
+
records on the reactor; writes block only for the duration of one record.
|
|
37
|
+
|
|
38
|
+
## Certificate verification
|
|
39
|
+
|
|
40
|
+
- `rejectUnauthorized` defaults to `true`. A supplied `ca` (PEM string or
|
|
41
|
+
Buffer) replaces the platform trust store; without one, Windows reads its
|
|
42
|
+
`ROOT` store through crypt32, Linux reads `ca-certificates.crt` /
|
|
43
|
+
`ca-bundle.crt` (or `/etc/ssl/certs`), and macOS/BSD read
|
|
44
|
+
`/etc/ssl/cert.pem`.
|
|
45
|
+
- `NODE_EXTRA_CA_CERTS` names a PEM bundle trusted **in addition** to the
|
|
46
|
+
platform roots, like Node. The `tls` e2e tests use it with a self-signed
|
|
47
|
+
fixture.
|
|
48
|
+
- `servername` defaults to `host` and is used for SNI and hostname verification.
|
|
49
|
+
|
|
50
|
+
## Known limits
|
|
51
|
+
|
|
52
|
+
`createServer` looks exactly like `net.Server` but performs the handshake on the
|
|
53
|
+
accept path (the runtime has no separate TLS thread). There is no session
|
|
54
|
+
resumption, 0-RTT, or TLS-over-a-preconnected-`net`-socket constructor: a
|
|
55
|
+
`TLSSocket` wraps a connection the module itself opened or accepted. PEM inputs
|
|
56
|
+
must be strings or Buffers; `key` and `cert` must be supplied together.
|
package/doc/implemented/node.md
CHANGED
|
@@ -29,6 +29,8 @@ work on another. Missing or different behaviour is recorded under
|
|
|
29
29
|
| `net` | [net](./node/net.md) | TCP server and client |
|
|
30
30
|
| `dgram` | [dgram](./node/dgram.md) | UDP sockets |
|
|
31
31
|
| `http` | [http](./node/http.md) | server and client, `Connection: close` |
|
|
32
|
+
| `tls` | [tls](./node/tls.md) | mbedTLS client/server (`node-tls` link feature) |
|
|
33
|
+
| `http2` | [http2](./node/http2.md) | nghttp2 h2c and TLS/ALPN (`http2` link feature) |
|
|
32
34
|
| `child_process` | [child_process](./node/child-process.md) | `spawnSync` / `spawn` / `execFile` / `execSync` |
|
|
33
35
|
| `events` | [events](./node/events.md) | `EventEmitter` (global and named export) |
|
|
34
36
|
| `util` | [util](./node/util.md) | formatting, inspection and predicates |
|
|
@@ -48,6 +50,12 @@ Additional small modules are provided with their core surface: `timers`
|
|
|
48
50
|
(`StringDecoder`), `diagnostics_channel` (`channel`/`tracingChannel`), and
|
|
49
51
|
`util/types` (the type predicates).
|
|
50
52
|
|
|
53
|
+
`tls` and `http2` are implemented as optional **link features** backed by the
|
|
54
|
+
vendored mbedTLS and nghttp2 libraries: `npm run tls` fetches and builds
|
|
55
|
+
`runtime/lib/<os>-<arch>/{tls,nghttp2}.{a,lib}`, and the driver links them only
|
|
56
|
+
when the program may use them. A checkout without those archives still compiles,
|
|
57
|
+
but the calls report a clear runtime error until `npm run tls` has run.
|
|
58
|
+
|
|
51
59
|
## Where does a change belong?
|
|
52
60
|
|
|
53
61
|
A Node module change normally touches `src/extensions/node/<module>/` and
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
The three browser storage globals — `localStorage`, `sessionStorage` and
|
|
6
6
|
`indexedDB` — are always available (they are core globals), backed by a
|
|
7
|
-
vendored SQLite (`
|
|
7
|
+
vendored SQLite (`vendor/sqlite3`, fetched by `npm run vendor`). No extension
|
|
8
|
+
flag is needed.
|
|
8
9
|
|
|
9
10
|
## Backend selection
|
|
10
11
|
|
package/doc/implemented.md
CHANGED
|
@@ -38,14 +38,14 @@ small file instead of a single monolithic document.
|
|
|
38
38
|
- [Collections](./implemented/collections.md) — Map, Set, WeakMap, WeakSet, WeakRef, iteration
|
|
39
39
|
- [Typed arrays and binary data](./implemented/typed-arrays.md) — typed arrays, ArrayBuffer, DataView
|
|
40
40
|
- [Async, promises and generators](./implemented/async.md) — async/await, async generators, promises, timers
|
|
41
|
-
- [fetch](./implemented/fetch.md) — reactor-driven HTTP/1.1 client and Headers
|
|
41
|
+
- [fetch](./implemented/fetch.md) — reactor-driven HTTP/1.1 client (HTTP and HTTPS) and Headers
|
|
42
42
|
- [WebAssembly](./implemented/wasm.md) — the `WebAssembly` namespace surface (bytecode execution is not implemented)
|
|
43
43
|
|
|
44
44
|
### Modules and tooling
|
|
45
45
|
|
|
46
46
|
- [Module system](./implemented/modules.md) — import/export, bundling, `node_modules`, `import.meta`
|
|
47
47
|
- [Extension mechanism](./implemented/extensions.md) — registry, the `node` extension, native C++/Rust extensions
|
|
48
|
-
- [Node extension](./implemented/node.md) —
|
|
48
|
+
- [Node extension](./implemented/node.md) — 24 Node built-in modules, one page per module
|
|
49
49
|
- [Storage extension](./implemented/storage.md) — SQLite-backed `localStorage`, `sessionStorage` and `indexedDB`
|
|
50
50
|
- [Driver, incremental compilation and toolchain](./implemented/driver.md) — cache, clang/LTO/PGO, config, icons
|
|
51
51
|
- [CLI and programmatic API](./implemented/cli.md) — commands, flags, embedder API
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
The following Node built-in modules have no corresponding extension / builtin
|
|
6
6
|
(`fs` / `fs/promises` / `path` / `os` / `process` / `buffer` / `stream` /
|
|
7
|
-
`dgram` / `http` / `
|
|
8
|
-
`test` are implemented, and `crypto` / `url` /
|
|
9
|
-
`stream/promises` / `worker_threads` are partially
|
|
10
|
-
[implemented: Node extension](../../implemented/node.md)):
|
|
7
|
+
`dgram` / `http` / `tls` / `http2` / `events` / `util` / `querystring` /
|
|
8
|
+
`readline` / `assert` / `test` are implemented, and `crypto` / `url` /
|
|
9
|
+
`child_process` / `zlib` / `stream/promises` / `worker_threads` are partially
|
|
10
|
+
implemented; see [implemented: Node extension](../../implemented/node.md)):
|
|
11
11
|
|
|
12
12
|
| Module | Notes |
|
|
13
13
|
| --- | --- |
|
|
14
|
-
| `https` | TLS version of HTTP |
|
|
15
|
-
| `
|
|
14
|
+
| `https` | TLS version of HTTP; use `http2` or `tls` directly, or `fetch` for `https://` |
|
|
15
|
+
| `cluster` / `vm` | other core modules not listed |
|
|
16
16
|
|
|
17
17
|
> `crypto` (only `createHash`, now with the streaming API), `url` (only
|
|
18
18
|
> `pathToFileURL` / `fileURLToPath`), `child_process` (only `spawnSync` /
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
| Type checker | partial: the default [semantic checker](../implemented/checker.md) reports unresolved names, redeclarations, call arity, property existence and definite assignability mismatches, with structural interfaces/classes, simple generics and basic flow narrowing; there is no full inference or strict-null pass |
|
|
10
10
|
| Full standard library | partial: Math / JSON / Date / Map / Set / RegExp / `Error` / `BigInt` / `Symbol` / `structuredClone` implemented; String.normalize missing |
|
|
11
11
|
| Multi-file module bundling | partial: relative-path `.ts` bundling, ESM `node_modules` packages, namespace imports and bare-specifier extension module imports implemented; CommonJS is handled only inside `node_modules`; circular dependencies / live bindings are not implemented |
|
|
12
|
-
| Real async runtime | ✓ `async`/`await` suspends on pending promises on the `select(2)` reactor: timers, TCP sockets, offloaded file/HTTP work and promise callbacks resume the coroutine. Still missing: real OS-level file watching, non-blocking `net.connect`,
|
|
12
|
+
| Real async runtime | ✓ `async`/`await` suspends on pending promises on the `select(2)` reactor: timers, TCP sockets, offloaded file/HTTP work and promise callbacks resume the coroutine. Still missing: real OS-level file watching, non-blocking `net.connect`, and user-visible worker threads (`worker_threads` uses child processes) |
|
|
13
13
|
| Windows binary artifact verification | adapted at the build layer (`.exe` suffix, link flag branch), verified in CI |
|
|
14
14
|
| Precise ECMAScript number / string / comparison semantics | partial, see [Runtime deviations](./deviations.md) |
|
package/doc/zh-CN/gui/api.md
CHANGED
|
@@ -101,7 +101,7 @@ requestAnimationFrame(frame);
|
|
|
101
101
|
| `navigator` | `userAgent`(以 `xbintsc` 结尾的桌面 Chrome 字符串)、`platform`、`vendor`、`language(s)`、`hardwareConcurrency`、`maxTouchPoints`、`onLine`、`vibrate()` |
|
|
102
102
|
| `localStorage` | 内存中的 `getItem` / `setItem` / `removeItem` / `clear` / `key` / `length` |
|
|
103
103
|
| `AudioContext`、`webkitAudioContext` | 带真实混音器与解码器的 Web Audio 图(见下) |
|
|
104
|
-
| `fetch(input, init)` | 核心运行时的 HTTP/1.1 客户端,GUI 程序同样可用:支持 `http
|
|
104
|
+
| `fetch(input, init)` | 核心运行时的 HTTP/1.1 客户端,GUI 程序同样可用:支持 `http://` 与 `https://`(后者链接可选的 `tls` 特性)、本地 `file://` 与相对路径;响应整体缓冲。见[已实现的 fetch](../../implemented/fetch.md)。 |
|
|
105
105
|
| `Event`、`CustomEvent`、`ProgressEvent`、`MouseEvent`、`KeyboardEvent`、`PointerEvent`、`WheelEvent`、`FocusEvent`、`InputEvent`、`SubmitEvent` | 事件构造器;`init` 参数按原样保留(`detail`、`composed`、鼠标/键盘字段等) |
|
|
106
106
|
| `AbortController`、`AbortSignal` | 真实的 controller/signal 对,用于 `{ signal }` 移除监听器,支持 `abort()`、`aborted`、`reason`、`onabort` 与 `throwIfAborted()` |
|
|
107
107
|
| `HTMLCanvasElement`、`HTMLImageElement`、`WebGLRenderingContext`、`WebGL2RenderingContext`、`WebGLBuffer`/`WebGLTexture`/`WebGLShader`/`WebGLProgram`/`WebGLFramebuffer`/`WebGLRenderbuffer`/`WebGLUniformLocation`/`WebGLActiveInfo`/`WebGLVertexArrayObject`/`WebGLSampler`/`WebGLQuery`/`WebGLSync`/`WebGLTransformFeedback` | 真实的构造函数值。`canvas.getContext("webgl")` 与 `getContext("webgl2")` 返回 GPU 上下文(见 [WebGL](./webgl.md))。 |
|
package/doc/zh-CN/gui/build.md
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
> 属于 [GUI 扩展](../gui.md) 的一部分;引擎总览、锁定决策与路线图在那里。
|
|
6
6
|
|
|
7
7
|
- 源码位于 `runtime/ext_gui/`(C/C++),外加 `vendor/` 下的 vendored 库
|
|
8
|
-
(被 gitignore
|
|
8
|
+
(被 gitignore;按需获取)。`npm run vendor` 获取固定版本的 stb/NanoSVG 头文件
|
|
9
|
+
(以及链接特性要编译的 miniz/SQLite 源码);`npm run gui` 只获取它需要的两组
|
|
10
|
+
头文件。媒体解码位于 `runtime/xt_media/`,单独构建。
|
|
9
11
|
- `npm run gui`(`scripts/build-gui.ts`)获取固定版本的 SDL3(`SDL3_TAG`,
|
|
10
12
|
默认 `release-3.2.10`),构建静态 SDL3,获取并构建静态 **FreeType**
|
|
11
13
|
(`FREETYPE_VERSION`,默认 `2.13.3`)与 **HarfBuzz**(`HARFBUZZ_VERSION`,
|
|
@@ -17,7 +19,7 @@
|
|
|
17
19
|
MSL(见 [WebGL](./webgl.md)),两者都与其他库一样合并进归档。Metal 是唯一消费
|
|
18
20
|
MSL 的 SDL_GPU 后端,因此 Windows/Linux 上脚本既不获取也不合并 SPIRV-Cross:
|
|
19
21
|
那里的 `webgl_msl.cpp` 编译为空,合并进来只会多出约 2.5 MiB 不可达代码。
|
|
20
|
-
默认文本路径使用内置的 **stb_truetype**(`
|
|
22
|
+
默认文本路径使用内置的 **stb_truetype**(`vendor/stb/stb_truetype.h`);
|
|
21
23
|
HarfBuzz/FreeType 只在 `shaping` 特性启用时被取出。
|
|
22
24
|
每个库(SDL3、FreeType、HarfBuzz、glslang、SPIRV-Cross 与引擎)都用
|
|
23
25
|
`-ffunction-sections -fdata-sections` 编译;SDL 关闭引擎从不调用的子系统
|
|
@@ -154,7 +154,7 @@ shader 合成到场景上。全部十六种 CSS 模式(`multiply`、`screen`
|
|
|
154
154
|
## 文本技术栈(M4b)
|
|
155
155
|
|
|
156
156
|
`runtime/ext_gui/text.{h,cpp}` 是前端,通过一个小型后端表分发。默认后端是内置的
|
|
157
|
-
**stb_truetype**(`text_stb.cpp`、`
|
|
157
|
+
**stb_truetype**(`text_stb.cpp`、`vendor/stb/stb_truetype.h`)。可选的
|
|
158
158
|
**`shaping`** 链接特性会安装 `text_hb.cpp`(HarfBuzz + FreeType 后端),非 ASCII
|
|
159
159
|
文本或作者的 `@font-face` 规则会自动选中它。两个后端共享 `text_font_db.cpp` 中的
|
|
160
160
|
字体数据库(发现与索引)、`text_fonts.cpp` 中的 CSS 匹配器和
|
package/doc/zh-CN/gui.md
CHANGED
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
`vulkan-sdk-1.4.313.0`、FFmpeg `7.1`(供可选的 `media` 归档使用;可用
|
|
100
100
|
`SDL3_TAG` / `FREETYPE_VERSION` / `HARFBUZZ_VERSION` / `GLSLANG_VERSION` /
|
|
101
101
|
`SPIRV_CROSS_VERSION` / `FFMPEG_VERSION` 覆盖)。默认文本后端是内置的
|
|
102
|
-
`stb_truetype.h`;它只接受 TrueType 轮廓(不支持 CFF/OTF 或可变字体)。
|
|
102
|
+
`vendor/stb/stb_truetype.h`;它只接受 TrueType 轮廓(不支持 CFF/OTF 或可变字体)。
|
|
103
103
|
`shaping` 特性会换成 HarfBuzz + FreeType,提供完整 OpenType 整形。
|
|
104
104
|
|
|
105
105
|
如果否决 SDL3,备选是 **GLFW + OpenGL 3.3**(更简单,但 OpenGL 在 macOS 上
|
|
@@ -47,4 +47,4 @@
|
|
|
47
47
|
- `fetch` 把每一跳请求/重定向作为 job 执行;`fs/promises` 把每个文件与描述符操作作为 job 执行。两者都不会阻塞定时器、套接字或其他 `await`。
|
|
48
48
|
- 仍有 job 未完成时事件循环保持存活(`xt_loop_has_work`),线程池空闲后退出。
|
|
49
49
|
|
|
50
|
-
异步表面的已知限制(`fetch`
|
|
50
|
+
异步表面的已知限制(`fetch` 无流式/abort、`fs.watch` 不触发、线程池固定 4 个 worker)列在[运行时偏差](../unimplemented/deviations.md)与各 Node 页面。
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
- `resolveLinkFeatures` 应用 `--feature` / `--no-feature`(以及 `all`),展开 `requires`,把自动检测到但不可用的特性报为 warning、把强制开启却不可用的报为 error,并返回要链接的 bridge/归档/参数。
|
|
13
13
|
- bridge 就是强引用:构造函数安装特性的分发表,其引用迫使链接器取出实现;没有 bridge 时表保持 null,实现成员永不被链接。
|
|
14
14
|
- 当前客户端:`media`(FFmpeg,`runtime/xt_media/media_bridge.c` + `media.a`)、`gpu`(glslang/SPIRV-Cross,`runtime/ext_gui/gpu_bridge.c` + `gui.a` 内的 `gpu_feature.cpp`)、`images`(stb_image/NanoSVG,`runtime/ext_gui/image_bridge.c` + `image_feature.cpp`)、`shaping`(HarfBuzz/FreeType,`runtime/ext_gui/text_bridge.c` + `text_hb.cpp`)、`webgl`(context/DOM 绑定,`runtime/ext_gui/webgl_bridge.c` + `webgl_feature.cpp`,依赖 `gpu`)以及 `storage`(基于 SQLite 的 Web Storage/IndexedDB,其实现完全位于该特性的 `runtimeSources` —— `runtime/xt_storage/*.c`,因为这些全局变量本身就是强引用)。
|
|
15
|
+
- TLS/HTTP2 客户端:`tls`(`runtime/xt_tls/tls_core.c` 中的 mbedTLS 传输层加 `tls` 归档,供 `fetch` 与 `node:tls` 使用)、`node-tls`(`TLSSocket`/服务端接口,依赖 `tls`)与 `http2`(`runtime/ext_node/http2/http2_backend.c` 中的 nghttp2 后端,依赖 `tls` 与 `node-tls`;`npm run tls` 构建两个归档)。
|
|
15
16
|
- 内置核心扩展 `core`:暴露 `print`(映射 `xt_println`),始终注册。
|
|
16
17
|
- Node 扩展 `node`:
|
|
17
18
|
- 模块化组织:`src/extensions/node/fs/` + `runtime/ext_node/fs/read_file.c`
|
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
实现位置:`runtime/xt_fetch.c`、`runtime/xt_fetch/async.inc`、`runtime/xt_async_io.c`。
|
|
6
6
|
|
|
7
|
-
- 全局 `fetch(input, init)`
|
|
7
|
+
- 全局 `fetch(input, init)` 是同时支持 `http://` 与 `https://` 的 HTTP/1.1 客户端。阻塞的套接字交换(`getaddrinfo`、connect、send、receive)运行在异步 I/O 工作线程池上,因此进行中的请求**不会**卡住事件循环:定时器、套接字与其他 `await` 继续运行,promise 在 reactor 派发完成结果时 settle。
|
|
8
8
|
- 重定向在主线程上处理:每一跳是一次 offload 交换,最多 20 次;301/302/303 会把 POST 改成 GET。
|
|
9
|
-
-
|
|
9
|
+
- 接受 `http://` 与 `https://` URL。HTTPS 由可选 `tls` 链接特性(随仓库引入的 mbedTLS)
|
|
10
|
+
提供:出现 `https://` 字面量(或传入 `--feature tls`)时编译器会选中它,从不发起
|
|
11
|
+
HTTPS 请求的程序不会付出体积代价。缺少归档时请求会以 `TypeError` 拒绝并说明缺失的特性。
|
|
12
|
+
证书按平台信任库校验(Windows `ROOT`、Linux CA 包、macOS `/etc/ssl/cert.pem`);
|
|
13
|
+
`NODE_EXTRA_CA_CERTS` 指定额外信任的 PEM 包,私有或自签名 CA 通过它使用。
|
|
14
|
+
`fetch` 的 `init` 不接受 `ca` 选项。
|
|
10
15
|
- **没有协议的引用**(相对路径)与 `file://` URL 会读取本地文件,因此编译后的程序
|
|
11
16
|
无需 HTTP 服务即可加载磁盘资源。相对路径相对工作目录解析;支持 `GET` / `HEAD`。
|
|
12
17
|
在 Windows 上,标准写法 `file:///C:/dir/file` 与 `file://C:/dir/file` /
|
|
@@ -32,4 +37,11 @@ setTimeout(() => console.log("timer"), 10); // 会在 150ms 的响应之前运
|
|
|
32
37
|
await pending;
|
|
33
38
|
```
|
|
34
39
|
|
|
35
|
-
|
|
40
|
+
链接 `tls` 特性后,HTTPS 请求的用法完全相同:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
const response = await fetch("https://example.com/status");
|
|
44
|
+
console.log(response.status, await response.text());
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
已知限制(响应体整体缓冲、无流式与 abort signal)列在[运行时偏差](../unimplemented/deviations.md)。
|