Skip to content

Commit 221ebb3

Browse files
WIP: V12 migration guide
1 parent e18406c commit 221ebb3

File tree

2 files changed

+57
-131
lines changed

2 files changed

+57
-131
lines changed

pages/docs/manual/v12.0.0/migrate-to-v11.mdx

Lines changed: 0 additions & 131 deletions
This file was deleted.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: "Migrate to v12"
3+
description: "Instructions on upgrading to ReScript 12"
4+
canonical: "/docs/manual/v12.0.0/migrate-to-v12"
5+
---
6+
7+
# Migrate to ReScript 12
8+
9+
## Recommended Migration
10+
11+
### Prerequisites
12+
13+
- ReScript V11 project.
14+
- Uncurried mode must be enabled (i.e. you have not opted-out from it)
15+
- Your project must not contain any OCaml source code anymore, as support for `.ml` files is removed in this version. However there are ways to convert OCaml syntax with an older ReScript compiler version (see below).
16+
- The old configuration filename that was deprecated in v11, `bsconfig.json`, is removed. Rename it to `rescript.json`.
17+
18+
### Standard library changes
19+
20+
In V12, the new standard library ships with the compiler, so you can uninstall and remove the `@rescript/core` dependency from your `rescript.json`
21+
22+
```console
23+
$ npm remove @rescript/core
24+
```
25+
26+
```diff
27+
{
28+
"bs-dependencies": [
29+
- "@rescript/core"
30+
]
31+
}
32+
```
33+
34+
Also remove auto opening of `RescriptCore`.
35+
36+
```diff
37+
{
38+
"bsc-flags": [
39+
- "-open RescriptCore",
40+
]
41+
}
42+
```
43+
44+
## Replacements
45+
46+
Some typical name changes include:
47+
48+
`Error.t` -> `JsError.t`
49+
`raise(` -> `throw(`
50+
`Js.Exn.Error` exception -> `JsExn`
51+
`Error.make` -> `JsExn.make`
52+
`Error.raise` -> `JsExn.raise`
53+
`Error.message` -> `JsExn.message`
54+
`Int.Bitwise.lsl` -> `Int.shiftLeft`
55+
56+
57+

0 commit comments

Comments
 (0)