diff --git a/experiments/iroh-relay-ws/host/bridge.ts b/experiments/iroh-relay-ws/host/bridge.ts index fdc3eae..6d6ed44 100644 --- a/experiments/iroh-relay-ws/host/bridge.ts +++ b/experiments/iroh-relay-ws/host/bridge.ts @@ -13,7 +13,7 @@ // Connections are keyed by the guest socket that carries them (one relay // connection = one synthetic socket = one websocket). -import { Websocket } from "../../../.deps/websocket/js/polyengine/websocket.ts"; +import { Websocket } from "@polymorph/websocket"; import type { OutgoingDatagram, UdpSocket } from "./sockets.ts"; import { pushDatagram, registerBridge } from "./sockets.ts"; import { describeErr } from "./errors.ts"; diff --git a/experiments/iroh-relay-ws/host/deno.json b/experiments/iroh-relay-ws/host/deno.json index 4011568..e628518 100644 --- a/experiments/iroh-relay-ws/host/deno.json +++ b/experiments/iroh-relay-ws/host/deno.json @@ -1,9 +1,9 @@ { - "//": "MODULE-IDENTITY CONSTRAINT: polyengine's wasi package and the sibling polyengine host modules (.deps/{websocket,webrtc}) import @polyengine/runtime/embedder by bare specifier internally; this file maps that specifier ONCE for the whole module graph, so `instanceof ComponentException` holds across every boundary. This is the ONE deno config for all three experiments (iroh-relay-ws, iroh-blobs, ping-demo): the others pass --config pointing here. polyengine arrives as exact-pinned JSR releases (caret-honest upstream: within a minor line releases stay compatible, breaking bumps the minor; per-commit `-pre.g` prereleases exist between releases — pin exactly; @polyengine/translator ships the translator wasm for the SAME commit); the version matches host-polyengine/deno.json by repo convention (exam-polyengine asserts it; see host-polyengine/README.md, 'The pin'). minimumDependencyAge keeps Deno's default supply-chain gate for everything else while letting same-day @polyengine publishes resolve. The npm mappings serve the webrtc module's bare specifiers under Deno; a browser build resolves the RTCPeerConnection global instead. compilerOptions.lib carries dom next to deno.ns so the browser entries (browser-entry.ts, ping-demo's demo.ts/overlay.ts) type-check in the same graph as the Deno drivers.", + "//": "MODULE-IDENTITY CONSTRAINT: polyengine's wasi package and the sibling @polymorph host modules (JSR) import @polyengine/runtime/embedder by bare specifier internally; this file maps that specifier ONCE for the whole module graph, so `instanceof ComponentException` holds across every boundary. This is the ONE deno config for all three experiments (iroh-relay-ws, iroh-blobs, ping-demo): the others pass --config pointing here. polyengine arrives as exact-pinned JSR releases (caret-honest upstream: within a minor line releases stay compatible, breaking bumps the minor; per-commit `-pre.g` prereleases exist between releases — pin exactly; @polyengine/translator ships the translator wasm for the SAME commit); the version matches host-polyengine/deno.json by repo convention (exam-polyengine asserts it; see host-polyengine/README.md, 'The pin'). The @polymorph packages are exact-pinned the same way. minimumDependencyAge keeps Deno's default supply-chain gate for everything else while letting same-day @polyengine/@polymorph publishes resolve. The webrtc module's npm dependencies (node-datachannel, werift) arrive through @polymorph/webrtc-datachannels' own manifest; a browser build externalizes them and resolves the RTCPeerConnection global instead. compilerOptions.lib carries dom next to deno.ns so the browser entries (browser-entry.ts, ping-demo's demo.ts/overlay.ts) type-check in the same graph as the Deno drivers.", "nodeModulesDir": "auto", "minimumDependencyAge": { "age": "P1D", - "exclude": ["jsr:@polyengine/*"] + "exclude": ["jsr:@polyengine/*", "jsr:@polymorph/*"] }, "compilerOptions": { "lib": ["dom", "dom.iterable", "dom.asynciterable", "deno.ns"] @@ -14,9 +14,8 @@ "@polyengine/translator": "jsr:@polyengine/translator@0.3.0", "@polyengine/wasi": "jsr:@polyengine/wasi@0.3.0", "@polyengine/wasi/io": "jsr:@polyengine/wasi@0.3.0/io", - "node-datachannel": "npm:node-datachannel@0.32.3", - "node-datachannel/polyfill": "npm:node-datachannel@0.32.3/polyfill", - "werift": "npm:werift@0.22.2" + "@polymorph/webrtc-datachannels": "jsr:@polymorph/webrtc-datachannels@0.3.0", + "@polymorph/websocket": "jsr:@polymorph/websocket@0.3.0" }, "tasks": { "check": "deno check ." diff --git a/experiments/iroh-relay-ws/host/deno.lock b/experiments/iroh-relay-ws/host/deno.lock index 6a53f13..7677c73 100644 --- a/experiments/iroh-relay-ws/host/deno.lock +++ b/experiments/iroh-relay-ws/host/deno.lock @@ -6,6 +6,8 @@ "jsr:@polyengine/runtime@0.3.0": "0.3.0", "jsr:@polyengine/translator@0.3.0": "0.3.0", "jsr:@polyengine/wasi@0.3.0": "0.3.0", + "jsr:@polymorph/webrtc-datachannels@0.3.0": "0.3.0", + "jsr:@polymorph/websocket@0.3.0": "0.3.0", "npm:node-datachannel@0.32.3": "0.32.3", "npm:playwright@^1.62.1": "1.62.1", "npm:werift@0.22.2": "0.22.2" @@ -32,6 +34,20 @@ "jsr:@polyengine/protocol", "jsr:@polyengine/runtime@0.3" ] + }, + "@polymorph/webrtc-datachannels@0.3.0": { + "integrity": "576bcbe4b1053e7d27ac9f8b2d2f61e979987a749b226cc09db328f837b32675", + "dependencies": [ + "jsr:@polyengine/runtime@0.3", + "npm:node-datachannel", + "npm:werift" + ] + }, + "@polymorph/websocket@0.3.0": { + "integrity": "23c92ed2ccda31ca66cad1ac9cbcf87473ccac7ae9a2b82fcb3486d5af97bbcd", + "dependencies": [ + "jsr:@polyengine/runtime@0.3" + ] } }, "npm": { @@ -611,8 +627,8 @@ "jsr:@polyengine/runtime@0.3.0", "jsr:@polyengine/translator@0.3.0", "jsr:@polyengine/wasi@0.3.0", - "npm:node-datachannel@0.32.3", - "npm:werift@0.22.2" + "jsr:@polymorph/webrtc-datachannels@0.3.0", + "jsr:@polymorph/websocket@0.3.0" ], "packageJson": { "dependencies": [ diff --git a/experiments/iroh-relay-ws/host/webrtc-bridge.ts b/experiments/iroh-relay-ws/host/webrtc-bridge.ts index 899aa28..a0cec2f 100644 --- a/experiments/iroh-relay-ws/host/webrtc-bridge.ts +++ b/experiments/iroh-relay-ws/host/webrtc-bridge.ts @@ -30,7 +30,7 @@ import { DataChannelOptions, PeerConnection, PeerConnectionConfig, -} from "../../../.deps/webrtc/polyengine-impl/src/webrtc.ts"; +} from "@polymorph/webrtc-datachannels"; import type { IpSocketAddress, OutgoingDatagram, UdpSocket } from "./sockets.ts"; import { pushDatagram, diff --git a/experiments/ping-demo/web/overlay.ts b/experiments/ping-demo/web/overlay.ts index 5905ff7..62adb17 100644 --- a/experiments/ping-demo/web/overlay.ts +++ b/experiments/ping-demo/web/overlay.ts @@ -23,7 +23,7 @@ import { DataChannelOptions, PeerConnection, PeerConnectionConfig, -} from "../../../.deps/webrtc/polyengine-impl/src/webrtc.ts"; +} from "@polymorph/webrtc-datachannels"; import type { IpSocketAddress, OutgoingDatagram, UdpSocket } from "../../iroh-relay-ws/host/sockets.ts"; import { pushDatagram, diff --git a/justfile b/justfile index 1858fe9..84edb7f 100644 --- a/justfile +++ b/justfile @@ -130,8 +130,7 @@ interop-prod: build # bootstrap over the polymorph-websocket sibling's polyengine module, then # live migration onto a WebRTC data channel through the synthetic-address # overlay (issue #26). Research probe attached to the issue, so manual: -# not part of `ci`. The host's sibling polyengine module imports await the -# JSR migration (issue #83). +# not part of `ci`. iroh-relay-ws: cd experiments/iroh-relay-ws/guest && cargo build --release cd experiments/iroh-relay-ws/host && deno install --frozen --allow-scripts=npm:node-datachannel