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#
| API | Globals | Crate | Status |
|---|---|---|---|
| Timers | setTimeout, setInterval, clearTimeout, clearInterval, queueMicrotask | web-core | Available |
| Events | Event, CustomEvent, EventTarget | web-core | Available |
| Abort | AbortController, AbortSignal | web-core | Available |
DOMException | DOMException | web-core | Available |
| URL | URL, URLSearchParams | web-core | Available |
| Encoding | TextEncoder, TextDecoder, atob, btoa | web-core | Available |
| Performance | performance, Performance, PerformanceEntry, PerformanceMark, PerformanceMeasure, PerformanceObserver, PerformanceObserverEntryList | web-core | Available |
navigator | navigator, Navigator | web-core | Available |
structuredClone | structuredClone (uses the engine's serializer; V8 provides it) | web-core | Available |
| Streams | ReadableStream (default, byte, BYOB readers), WritableStream, TransformStream, CountQueuingStrategy, ByteLengthQueuingStrategy, TextEncoderStream, TextDecoderStream, CompressionStream, DecompressionStream | web-streams | Available |
| Fetch | fetch, Headers, Request, Response | web-fetch | Available |
| Web Crypto | crypto, Crypto, SubtleCrypto, CryptoKey | web-crypto | Available |
| Messaging | MessageChannel, MessagePort, MessageEvent, ErrorEvent, BroadcastChannel | runtime-workers | Available |
| Workers | Worker (module workers only) | runtime-workers | Available |
| Console | console | runtime-ops | Available |
"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:
CompressionStreamandDecompressionStreamacceptgzip,deflateanddeflate-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.getRandomValuesandcrypto.randomUUIDare 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,reportErrorand the event-listener functions exist on the global object. See Workers.
Not installed yet#
| API | Notes | Status |
|---|---|---|
Blob, File | Response.blob() is defined only when Blob exists, so it is absent today | Planned |
FormData | Required for Request/Response form bodies | Planned |
URLPattern | Listed in the Minimum Common Web API target | Planned |
WebSocket | Scheduled with the Phase 04 web runtime plan; no client or server code exists | Planned |
WebAssembly | Provided by V8 itself, but Velyr has no tests or permission review for it yet. Do not treat it as supported | Experimental |
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).
| Suite | Plan | State today |
|---|---|---|
| test262 (ECMAScript) | velyr-test262 runner against engine-v8 and engine-native, with committed expected-failure manifests | Runner exists. Results are generated locally and are not published |
| Web Platform Tests | velyr-wpt runner and a versioned compat/wpt/manifest.txt selecting server-relevant tests | Planned. 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.