You are currently looking at the v6.0 - v8.2 docs (Reason v3.6 syntax edition). You can find the latest API docs here.

(These docs cover all versions between v3 to v8 and are equivalent to the old BuckleScript docs before the rebrand)

Overview

We ship 3 modules in our standard library.

  • Js: bindings for all your familiar JavaScript APIs.

  • Belt: extra collections and helpers not available in JavaScript.

  • Dom: Dom related types and modules.

Usage heuristics:

  • Default to using the Js module. Most of the APIs in it are runtime-free and compile down to clean, readable JavaScript, which is our priority.

  • For other APIs that aren't available in regular JavaScript (and thus don't exist in our Js bindings), use Belt. For example, prefer Js.Array2 over Belt.Array.

  • The Dom module contains our standardized types used by various userland DOM bindings. Due to the complexity of DOM, we don't mind that you ignore this module and build your application-specific DOM bindings.

Note: we do not recommend other userland standard library alternatives (unless it's DOM bindings). These cause confusion and split points for the community.