Skip to main content

Crate obeli_sk_boa_wintertc

Crate obeli_sk_boa_wintertc 

Source
Expand description

Boa’s boa_wintertc crate implements the WinterTC (TC55) Minimum Common Web API for the boa_engine crate.

WinterTC (TC55) is an Ecma International Technical Committee working towards a baseline set of Web Platform APIs that all server-side JavaScript runtimes (Deno, Bun, Cloudflare Workers, Node.js, etc.) agree to implement, enabling portable server-side JavaScript.

§Relationship to boa_runtime

boa_wintertc is a standalone crate that depends only on boa_engine. boa_runtime depends on boa_wintertc and re-exports its APIs, so users of boa_runtime automatically get TC55 compliance without any extra setup.

If you only want the TC55-mandated APIs and nothing else, depend on boa_wintertc directly.

§Example: Registering all TC55 APIs

use boa_engine::Context;

let mut context = Context::default();

boa_wintertc::register(None, &mut context)
    .expect("failed to register TC55 APIs");

§About Boa

Boa is an open-source, experimental ECMAScript Engine written in Rust for lexing, parsing and executing ECMAScript/JavaScript. Currently, Boa supports some of the language. More information can be viewed at Boa’s website.

Try out the most recent release with Boa’s live demo playground.

§Boa Crates

  • boa_cli - Boa’s CLI && REPL implementation
  • boa_ast - Boa’s ECMAScript Abstract Syntax Tree.
  • boa_engine - Boa’s implementation of ECMAScript builtin objects and execution.
  • boa_gc - Boa’s garbage collector.
  • boa_icu_provider - Boa’s ICU4X data provider.
  • boa_interner - Boa’s string interner.
  • boa_macros - Boa’s macros.
  • boa_parser - Boa’s lexer and parser.
  • boa_runtime - Boa’s WebAPI features.
  • boa_string - Boa’s ECMAScript string implementation.
  • boa_wintertc - Boa’s WinterTC (TC55) Minimum Common Web API implementation.
  • tag_ptr - Utility library that enables a pointer to be associated with a tag of type usize.
  • small_btree - Utility library that adds the SmallBTreeMap data structure.

Modules§

abort
TC55 AbortController and AbortSignal implementation.
base64
TC55 atob / btoa implementation.
clone
TC55 structuredClone implementation.
console
TC55 console object implementation.
encoding
TC55 encoding APIs: TextEncoder, TextDecoder, TextEncoderStream, TextDecoderStream.
events
TC55 event APIs: EventTarget, Event, CustomEvent, ErrorEvent, MessageEvent.
fetch
TC55 Fetch API: fetch, Request, Response, Headers.
microtask
TC55 queueMicrotask implementation.
timers
TC55 timer APIs: setTimeout, clearTimeout, setInterval, clearInterval.
url
TC55 URL APIs: URL, URLSearchParams.

Functions§

register
Register all TC55-mandated Web APIs into the given boa_engine::Context.