Amber

v1.17.0

HomeDocsCompatibilityBlogPlaygroundGitHub
GitHub

v1.17.0

Docs/Compatibility

WinterTC baseline

Stable

ECMA-429 minimum common Web API, runtime keys, and the Sockets API.

Amber implements the WinterTC (Ecma TC55, formerly WinterCG) baseline so Web-platform code written for edge runtimes can run unchanged where the APIs overlap. This baseline is part of the Stable scope in CURRENT_SCOPE.md.

ECMA-429 minimum common Web API

APIBehavior
DOMExceptionGlobal constructor with name, message, code, and legacy constants
globalThis.selfAlias of globalThis
reportError(error)Calls onerror when set
PromiseRejectionEventDispatched on unhandled rejections through onunhandledrejection
navigator.userAgentAmber/<version>
navigator.hardwareConcurrency, language, platformPresent
URLPatterntest() and exec() with :param groups
ByteLengthQueuingStrategy, CountQueuingStrategyGlobal constructors
ReadableStream.fromIterable and async-iterable sources

Runtime keys

package.json "exports" conditions include wintercg and wintertc ahead of node. import.meta.resolve uses the same resolver, so a package that publishes "wintercg": "./winter.js" resolves to that file instead of its "node" entry.

import.meta.main is true for the CLI entry module. import.meta.env maps process environment variables.

Sockets API

js
const { connect } = require("amber:sockets");

const socket = connect(
  { hostname: "example.com", port: 443 },
  { secureTransport: "on" },
);
// socket.readable and socket.writable are Web streams.

secureTransport: "on" and socket.startTls() run a real rustls client handshake. Connecting with TLS to a plain TCP port fails with a TLS error instead of silently staying in cleartext.

Tests

bash
cargo test --test wintertc_compliance_tests -- --test-threads=1
Edit this page on GitHub