You are currently looking at the v11.0 docs, which are still a work in progress. If you miss anything, you may find it in the older v10.0 docs here.
Migrate to ReScript 11
Minimal Migration
This guide describes the things to do at least to migrate to ReScript 11.
Disable uncurried mode
If you use currying extensively and don't want to bother with adapting your code (or have dependencies )
JSON{
"uncurried": false
}
Recommended Migration
Uncurried Mode
For uncurried mode to take effect in ReScript 11 there is nothing to configure, it is activated by default.
Adapt suffix
ReScript 11 now allows having arbitrary suffixes in the generated JavaScript files. However it is still recommended to stick to using .res.js
, .res.mjs
or .res.cjs
. For more information, read the Build System Configuration about suffixes.
rescript.json
The old configuration filename bsconfig.json
is finally deprecated. Rename it to rescript.json
.
ReScript-Core standard library
There is a new standard library in development that can already be installed called ReScript-Core. It replaces the complete Js
module as well as some of the more frequently used modules from Belt
and is the recommended standard library to use with uncurried mode. At a later stage it will be integrated into the compiler while Belt
will be maintaned as a separate npm package.
Until it's integrated in the compiler, it needs to be installed manually:
CONSOLE$ npm install @rescript/core
Then add @rescript/core
to your rescript.json
's dependencies:
DIFF {
"bs-dependencies": [
+ "@rescript/core"
]
}
Open it so it's available in the global scope.
DIFF {
"bsc-flags": [
+ "-open RescriptCore",
]
}
For a detailed explanation on migration to ReScript-Core, please refer to its migration guide. A semi-automated script is available as well.
Note: ReScript-Core API docs will be added to this documentation platform at a later stage. For now check out the .resi
files in the repository or, more conveniently, read the docs for a certain module or function directly in the editor tooling.
Removed bindings
Many Node bindings have been removed from the compiler. Please use rescript-nodejs instead or write your own local bindings.