Skip to content

Update API overview page #791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions pages/docs/manual/latest/api.mdx
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
# Overview

## New Standard Library
## ReScript Core

[ReScript Core](api/core) is ReScript's new standard library. It replaces the complete `Js` module as well as some of the more frequently used modules from `Belt` and is recommended to use with uncurried mode.
[Core](api/core) is ReScript's new standard library. It replaces the complete `Js` module as well as some of the more frequently used modules from `Belt` and is recommended to use with uncurried mode.

## Other Modules
In ReScript 11, it is shipped as a separate npm package `@rescript/core` that is added to your project as per the [installation instructions](http://localhost:3000/docs/manual/latest/installation). In future ReScript versions, it will be included with the `rescript` npm package itself.

ReScript ships 3 modules in its standard library.
## Additional Libraries

- [Js](api/js): bindings for all your familiar JavaScript APIs.
- [Belt](api/belt): extra collections and helpers not available in JavaScript.
- [Dom](api/dom): Dom related types and modules.
ReScript ships with these two additional modules in its standard library:

Usage heuristics:
- [Belt](api/belt): immutable collections and extra helpers not available in JavaScript / [Core](api/core).
- [Dom](api/dom): Dom related types and modules. Contains our standardized types used by various userland DOM bindings.

- 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.
## Legacy Modules

**Note**: we do not recommend other userland standard library alternatives (unless it's DOM bindings). These cause confusion and split points for the community.
The [Js](api/js) module is superseded by [Core](api/core).