Web APIs

Which Web Platform APIs Velyr installs as globals today, which are planned, and how conformance will be measured.

Velyr follows a web-standards-first rule (ADR-002): server features are exposed through Web APIs wherever a standard exists, and Velyr-specific features live under the Velyr namespace instead of patching standard prototypes. The baseline target is the Minimum Common Web API.

Every API below is installed on a fresh isolate by velyr run in all four build profiles (minimal, web, node, full). Pure-computation APIs need no permission. APIs that touch the network are gated by permissions.

Installed today#

APIGlobalsCrateStatus
TimerssetTimeout, setInterval, clearTimeout, clearInterval, queueMicrotaskweb-coreAvailable
EventsEvent, CustomEvent, EventTargetweb-coreAvailable
AbortAbortController, AbortSignalweb-coreAvailable
DOMExceptionDOMExceptionweb-coreAvailable
URLURL, URLSearchParamsweb-coreAvailable
EncodingTextEncoder, TextDecoder, atob, btoaweb-coreAvailable
Performanceperformance, Performance, PerformanceEntry, PerformanceMark, PerformanceMeasure, PerformanceObserver, PerformanceObserverEntryListweb-coreAvailable
navigatornavigator, Navigatorweb-coreAvailable
structuredClonestructuredClone (uses the engine's serializer; V8 provides it)web-coreAvailable
StreamsReadableStream (default, byte, BYOB readers), WritableStream, TransformStream, CountQueuingStrategy, ByteLengthQueuingStrategy, TextEncoderStream, TextDecoderStream, CompressionStream, DecompressionStreamweb-streamsAvailable
Fetchfetch, Headers, Request, Responseweb-fetchAvailable
Web Cryptocrypto, Crypto, SubtleCrypto, CryptoKeyweb-cryptoAvailable
MessagingMessageChannel, MessagePort, MessageEvent, ErrorEvent, BroadcastChannelruntime-workersAvailable
WorkersWorker (module workers only)runtime-workersAvailable
Consoleconsoleruntime-opsAvailable

"Available" means installed by velyr run and exercised by tests in this repository. It does not mean the API passes the Web Platform Tests; no WPT results exist yet (see Conformance).

Details worth knowing#

  • Compression formats: CompressionStream and DecompressionStream accept gzip, deflate and deflate-raw.
  • Web Crypto algorithms present in the implementation: SHA-1/256/384/512 digests, HMAC, AES-CBC, AES-CTR, AES-GCM, AES-KW, RSA-OAEP, RSA-PSS, RSASSA, ECDSA, ECDH, Ed25519, X25519, PBKDF2 and HKDF. crypto.getRandomValues and crypto.randomUUID are included. Check the source for the exact curve and parameter coverage before relying on a specific combination.
  • Fetch goes through io-http (hyper) and rustls. Requests need a network grant such as --allow-net=api.example.com. Response bodies are streams backed by Web Streams.
  • Worker scope: inside a worker, postMessage, close, self, name, reportError and the event-listener functions exist on the global object. See Workers.

Not installed yet#

APINotesStatus
Blob, FileResponse.blob() is defined only when Blob exists, so it is absent todayPlanned
FormDataRequired for Request/Response form bodiesPlanned
URLPatternListed in the Minimum Common Web API targetPlanned
WebSocketScheduled with the Phase 04 web runtime plan; no client or server code existsPlanned
WebAssemblyProvided by V8 itself, but Velyr has no tests or permission review for it yet. Do not treat it as supportedExperimental

Velyr namespace#

Velyr-specific features sit under the global Velyr object, never on standard prototypes. Today it carries file and socket helpers (Velyr.readFile, Velyr.connect, Velyr.listen, Velyr.connectTls, Velyr.listenTls), Velyr.env, Velyr.permissions.query and Velyr.unrefWorker. All are permission-gated. Velyr.serve is described in an ADR but does not exist yet; see Server and multicore.

Conformance#

Velyr's rule is that a compatibility status is evidence-backed and never edited by hand (ADR-015, docs/COMPATIBILITY-MATRIX.md).

SuitePlanState today
test262 (ECMAScript)velyr-test262 runner against engine-v8 and engine-native, with committed expected-failure manifestsRunner exists. Results are generated locally and are not published
Web Platform Testsvelyr-wpt runner and a versioned compat/wpt/manifest.txt selecting server-relevant testsPlanned. The runner crate, fetch script and manifest do not exist yet

Not every browser test is meaningful for a server runtime, so the WPT selection will be explicit and versioned. Pass rates will be published with the commit they were measured on and the raw result files, not before.