Skip to content

feat(net): add bounded fetch(net) module - #246

Open
siwei-yuan wants to merge 1 commit into
pocket-stack:mainfrom
siwei-yuan:codex/feat-net-surface
Open

feat(net): add bounded fetch(net) module#246
siwei-yuan wants to merge 1 commit into
pocket-stack:mainfrom
siwei-yuan:codex/feat-net-surface

Conversation

@siwei-yuan

Copy link
Copy Markdown
Contributor

Summary

  • add a spec-pinned globalThis.net module and framework-neutral fetch() SDK
  • add the transport-neutral pocket-net Rust core with bounded handles, tick-batched completions, response ownership, portable errors, and a host-owned HttpTransport seam
  • add deterministic sim and browser-fetch host adapters, lazy service pumping across Solid/Vue Vapor/Octane, capability/export codegen, tests, and docs

Design

NET v1 is intentionally a bounded whole-response HTTP client rather than a complete WHATWG Fetch implementation. It supports common app methods, headers, string/byte bodies, timeout and per-request maxBytes; it omits streams, cookies, cache, Request/Headers, AbortSignal, WebSocket, servers, and raw sockets.

Concrete DNS/TLS/HTTP libraries remain host-owned. pocket-net does not depend on ureq, reqwest, ESP-IDF, or a runtime executor; downstream hosts implement HttpTransport::start/cancel/drain. Network workers never call QuickJS, and the guest polls once per tick only while requests are pending. One poll drains the complete visible batch.

Verification

  • bun run test — 11/11 stages green
  • bunx tsc --noEmit
  • cargo test -p pocket-net --manifest-path engine/Cargo.toml — 5 passed
  • cargo clippy -p pocket-net --all-targets --manifest-path engine/Cargo.toml -- -D warnings
  • cargo check --workspace --manifest-path engine/Cargo.toml
  • bun run site:build
  • bun tests/contract.ts

@siwei-yuan siwei-yuan changed the title feat(net): add bounded fetch module feat(net): add bounded fetch(net) module Aug 7, 2026
@siwei-yuan
siwei-yuan marked this pull request as ready for review August 7, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant