Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Layout (each directory's justfile module in parentheses):
- `js/deltic/` (`just deltic-module-check`) — `websocket.ts`, THE
browser-first JS host module, over
[deltic](https://github.com/lann/deltic)'s embedder conventions (typed
streams, `WitError`) for its runtime-linked, no-transpile legs
streams, `ComponentException`) for its runtime-linked, no-transpile legs
(`conformance/driver-ct/deltic/`, the WPT parity round trip, the demo).
Its knobs are exported functions (`configure`,
`setMaxInboundBufferBytes`, `setConnectTimeoutMs`, `setCloseTimeoutMs`);
Expand All @@ -42,7 +42,7 @@ Layout (each directory's justfile module in parentheses):
upstream commit) which must agree on the `@deltic/runtime` version
(deltic's `wasi-shims` imports `@deltic/runtime/embedder` by bare
specifier internally, so a drift would load the embedder module twice
and break `instanceof WitError` across the boundary); the root
and break `instanceof ComponentException` across the boundary); the root
justfile's `exam-deltic` recipe (CI-wired) asserts one version
repo-wide. Bump procedure: `conformance/driver-ct/deltic/README.md`.
- `js/componentize/` (`just wpt::…`) — `websocket.js`, the WHATWG-API
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ in-guest.
| Path | Deliverable |
| --- | --- |
| [`wit/`](wit) | The `polymorph:websocket` package: a `types` interface for structural types and a `connections` interface owning the `websocket` resource. One copy at the root; consumers pull it in via `wit/deps` symlinks. Package-wide contracts live in [`wit/README.md`](wit/README.md). |
| [`js/deltic`](js/deltic) | The **browser-first JS host module** (`websocket.ts`): the standard `WebSocket` API only, no `node:` modules, no runtime dependencies, over [deltic](https://github.com/lann/deltic)'s embedder conventions (typed streams, `WitError`). Shared verbatim by the demo runner, the conformance JS-host rows, and the WPT parity round trip. |
| [`js/deltic`](js/deltic) | The **browser-first JS host module** (`websocket.ts`): the standard `WebSocket` API only, no `node:` modules, no runtime dependencies, over [deltic](https://github.com/lann/deltic)'s embedder conventions (typed streams, `ComponentException`). Shared verbatim by the demo runner, the conformance JS-host rows, and the WPT parity round trip. |
| [`rust/wasmtime`](rust/wasmtime) | The **Wasmtime host crate** (`wasmtime-websocket`): `add_to_linker` + `WasiWebsocketView`, per-store `WasiWebsocketCtx` knobs for the bounds the WIT leaves implementation-defined. |
| [`js/componentize`](js/componentize) | The **browser-API shim** for componentize-js guests: the WHATWG `WebSocket` interface implemented over the WIT imports — the inverse of `js/deltic` — plus the **WPT parity gate**: vendored web-platform-tests run round-trip (shim → WIT → deltic → platform WebSocket) and held to the platform baseline's pass set. |
| [`rust/guest-provider`](rust/guest-provider) | The **in-guest provider** (`websocket-guest-provider`): a WebSocket client stack over `wasi:sockets` TCP, exporting the package surface as a composable component; `wss:` via the composed [`polymorph:tls`](https://github.com/polymorph-components/polymorph-tls) component. See its README for the TLS posture and configuration channel. |
Expand Down
2 changes: 1 addition & 1 deletion conformance/driver-ct/deltic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ prereleases"). It is pinned in **two** places, both required to agree:
SAME `@deltic/runtime` version (the module-identity constraint: deltic's
`wasi-shims` imports `@deltic/runtime/embedder` by bare specifier
internally, so every config resolving it must agree, or the embedder
module loads twice and `instanceof WitError` stops holding across the
module loads twice and `instanceof ComponentException` stops holding across the
boundary).

`@deltic/translator` ships the translator wasm asset **for the same
Expand Down
2 changes: 1 addition & 1 deletion conformance/driver-ct/deltic/browser-bundle-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// map — the single deltic pin site), the emitted module is what
// browser/worker-entry.ts imports as `@deltic/release-bundle-entry`
// used to. Same export surface: instantiate/Translator/runSuite/
// wasiShims/WitError/artifactsFromEnvelope and friends (49 exports
// wasiShims/ComponentException/artifactsFromEnvelope and friends (49 exports
// verified against the retired upstream entry).
export * from "@deltic/runtime/embedder";
export { Translator } from "@deltic/runtime/shim";
Expand Down
2 changes: 1 addition & 1 deletion conformance/driver-ct/deltic/browser/worker-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// JSR packages' public surface), the upstream worker message loop, and
// this repo's deltic host module, resolved through ONE import map so the
// emitted bundle carries exactly one embedder module instance — which is
// what keeps `instanceof WitError` true when the host module throws
// what keeps `instanceof ComponentException` true when the host module throws
// across the component boundary (workers resolve no import maps, so
// bundling is the only sound shape; see @polymorph/component-test-js's
// runner-deltic README).
Expand Down
12 changes: 6 additions & 6 deletions conformance/driver-ct/deltic/deno.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"//": "MODULE-IDENTITY CONSTRAINT: deltic's wasi-shims module imports @deltic/runtime/embedder by bare specifier internally. The @deltic/runtime/embedder entry here must map to the IDENTICAL exact-pinned JSR version as ../../../js/deltic/deno.json's entry, or the embedder module loads twice and `instanceof WitError` stops holding across the module boundary. Pin story: 0.1.0-pre.g50778a1 names one upstream deltic commit; @deltic/translator ships the translator wasm for that SAME commit; deno.lock carries integrity, --frozen enforced everywhere; one version repo-wide is asserted by the pin gate (justfile: exam-deltic).",
"//": "MODULE-IDENTITY CONSTRAINT: deltic's wasi-shims module imports @deltic/runtime/embedder by bare specifier internally. The @deltic/runtime/embedder entry here must map to the IDENTICAL exact-pinned JSR version as ../../../js/deltic/deno.json's entry, or the embedder module loads twice and `instanceof ComponentException` stops holding across the module boundary. Pin story: 0.1.0-pre.g078aa15 names one upstream deltic commit; @deltic/translator ships the translator wasm for that SAME commit; deno.lock carries integrity, --frozen enforced everywhere; one version repo-wide is asserted by the pin gate (justfile: exam-deltic).",
"imports": {
"@deltic/ct-runner": "jsr:@deltic/ct-runner@0.1.0-pre.g50778a1",
"@deltic/runtime/embedder": "jsr:@deltic/runtime@0.1.0-pre.g50778a1/embedder",
"@deltic/runtime/shim": "jsr:@deltic/runtime@0.1.0-pre.g50778a1/shim",
"@deltic/wasi-shims": "jsr:@deltic/wasi-shims@0.1.0-pre.g50778a1",
"@deltic/translator": "jsr:@deltic/translator@0.1.0-pre.g50778a1",
"@deltic/ct-runner": "jsr:@deltic/ct-runner@0.1.0-pre.g078aa15",
"@deltic/runtime/embedder": "jsr:@deltic/runtime@0.1.0-pre.g078aa15/embedder",
"@deltic/runtime/shim": "jsr:@deltic/runtime@0.1.0-pre.g078aa15/shim",
"@deltic/wasi-shims": "jsr:@deltic/wasi-shims@0.1.0-pre.g078aa15",
"@deltic/translator": "jsr:@deltic/translator@0.1.0-pre.g078aa15",
"@polymorph/component-test-js/deltic-worker-main": "./node_modules/@polymorph/component-test-js/js/runner-deltic/worker-main.mjs"
},
"minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@deltic/*"] },
Expand Down
53 changes: 23 additions & 30 deletions conformance/driver-ct/deltic/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion conformance/driver-ct/deltic/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// `@deltic/runtime/embedder` by bare specifier internally; this leg's
// `deno.json` AND `js/deltic/deno.json` must map that specifier to the
// IDENTICAL exact-pinned JSR version, or the embedder module loads twice
// and `instanceof WitError` stops holding across the module boundary.
// and `instanceof ComponentException` stops holding across the module boundary.
//
// The translator comes from the packaged `@deltic/translator` JSR
// prerelease (defaultTranslator()) by default — no fetch step, no
Expand Down
8 changes: 4 additions & 4 deletions examples/deltic-demo/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
// packaged `@deltic/translator` JSR prerelease by default (no fetch
// step); `--translator <path>` remains as an optional override for a
// locally-built translator shim. The same import map is what keeps
// `instanceof WitError` holding across the host-module boundary (see
// `instanceof ComponentException` holding across the host-module boundary (see
// that deno.json's MODULE-IDENTITY note).

import { Translator } from "@deltic/runtime/shim";
import type { ComponentArtifacts } from "@deltic/runtime/embedder";
import { instantiate, WitError } from "@deltic/runtime/embedder";
import { ComponentException, instantiate } from "@deltic/runtime/embedder";
import { defaultTranslator } from "@deltic/translator";
import { wasiShims } from "@deltic/wasi-shims";
import { websocketImports } from "../../js/deltic/websocket.ts";
Expand Down Expand Up @@ -121,12 +121,12 @@ async function main() {
};
// The export's `result<u32, string>` lifts to return-or-throw in
// return position (contracts/embedder-api.md §"Value mapping"): the
// err payload rides a branded `WitError`.
// err payload rides a branded `ComponentException`.
try {
const received = await demo.run(`${echod.base}/echo`, cli.count);
console.log(`round-tripped ${received}/${cli.count} messages`);
} catch (err) {
const detail = err instanceof WitError ? err.payload : err;
const detail = err instanceof ComponentException ? err.payload : err;
console.error(`demo failed: ${detail}`);
Deno.exitCode = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion js/componentize/wpt/parity/deltic-carrier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// JSR package's lock-pinned module cache (no fetch step). Bundling from
// there is also what keeps `@deltic/runtime/embedder` a single module
// instance across this bundle and js/deltic/websocket.ts, so
// `instanceof WitError` holds.
// `instanceof ComponentException` holds.

import { Translator } from "@deltic/runtime/shim";
import { instantiate } from "@deltic/runtime/embedder";
Expand Down
4 changes: 2 additions & 2 deletions js/deltic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Chromium). It began as the [deltic](https://github.com/lann/deltic)-native
port of the browser-first reference host `js/jco/websocket.js` (retired
with the jco legs at commit c9252be; see git history), rewritten over
deltic's embedder API (typed `Stream<T>` / `ReadableStream` rather than
bare-payload `Stream`, and `WitError` throws rather than
bare-payload `Stream`, and `ComponentException` throws rather than
`throw { tag, val }`). It was developed as deltic's own
`ports/websocket` reference-host port and is upstreamed here per
[lann/deltic#14](https://github.com/lann/deltic/issues/14); the WIT
Expand Down Expand Up @@ -36,7 +36,7 @@ identically on Deno.
pinned URL as `conformance/driver-ct/deltic/deno.json`. deltic's
`wasi-shims` module imports that specifier by bare name internally; if the
two configs ever disagreed, the embedder module would load twice and
`instanceof WitError` would stop holding across the boundary. Keep both
`instanceof ComponentException` would stop holding across the boundary. Keep both
import maps byte-identical for that one entry.

## Unit tests
Expand Down
4 changes: 2 additions & 2 deletions js/deltic/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "@polymorph/websocket-deltic",
"version": "0.0.0",
"exports": "./websocket.ts",
"//": "MODULE-IDENTITY CONSTRAINT: deltic's wasi-shims module imports @deltic/runtime/embedder by bare specifier internally. Every config in this repo (this file AND conformance/driver-ct/deltic/deno.json) must map @deltic/runtime to the IDENTICAL exact-pinned JSR version, or the embedder module loads twice and `instanceof WitError` stops holding across the module boundary. Pin story: 0.1.0-pre.g50778a1 names one upstream deltic commit; @deltic/translator ships the translator wasm for that SAME commit; deno.lock carries integrity, --frozen enforced everywhere; one version repo-wide is asserted by the pin gate (justfile: exam-deltic).",
"//": "MODULE-IDENTITY CONSTRAINT: deltic's wasi-shims module imports @deltic/runtime/embedder by bare specifier internally. Every config in this repo (this file AND conformance/driver-ct/deltic/deno.json) must map @deltic/runtime to the IDENTICAL exact-pinned JSR version, or the embedder module loads twice and `instanceof ComponentException` stops holding across the module boundary. Pin story: 0.1.0-pre.g078aa15 names one upstream deltic commit; @deltic/translator ships the translator wasm for that SAME commit; deno.lock carries integrity, --frozen enforced everywhere; one version repo-wide is asserted by the pin gate (justfile: exam-deltic).",
"imports": {
"@deltic/runtime/embedder": "jsr:@deltic/runtime@0.1.0-pre.g50778a1/embedder"
"@deltic/runtime/embedder": "jsr:@deltic/runtime@0.1.0-pre.g078aa15/embedder"
},
"minimumDependencyAge": { "age": "P1D", "exclude": ["jsr:@deltic/*"] },
"compilerOptions": {
Expand Down
14 changes: 7 additions & 7 deletions js/deltic/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading