Overview

Other languages of this page: 中文

ReScript ships 3 modules in its 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.