Skip to content

Commit 4d80231

Browse files
committed
Update installation instructions to take Core into account
1 parent 04878f1 commit 4d80231

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

pages/docs/manual/latest/installation.mdx

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ canonical: "/docs/manual/latest/installation"
66

77
# Installation
88

9+
## Notes
10+
11+
With the instructions below, our new standard library [ReScript Core](https://github.com/rescript-association/rescript-core) will be included by default. (In ReScript 11, it comes as a separate npm package `@rescript/core`. In future versions, it will be included in the `rescript` npm package itself.)
12+
913
## Prerequisites
1014

1115
- [Node.js](https://nodejs.org/) version >= 14
12-
- One of the following package managers
16+
- One of the following package managers:
1317
- [npm](https://docs.npmjs.com/cli/) (comes with Node.js)
1418
- [yarn](https://yarnpkg.com/)
1519
- [pnpm](https://pnpm.io/)
@@ -49,7 +53,9 @@ bun create rescript-app
4953
node src/Demo.res.js
5054
```
5155

52-
That compiles your ReScript into JavaScript, then uses Node.js to run said JavaScript. **We recommend you use our unique workflow of keeping a tab open for the generated `.res.js` file**, so that you can learn how ReScript transforms into JavaScript. Not many languages output clean JavaScript code you can inspect and learn from!
56+
That compiles your ReScript into JavaScript, then uses Node.js to run said JavaScript.
57+
58+
**When taking your first steps with ReScript, we recommend you use our unique workflow of keeping a tab open for the generated JS file** (`.res.js`/`.res.mjs`), so that you can learn how ReScript transforms into JavaScript. Not many languages output clean JavaScript code you can inspect and learn from! With our [VS Code extension](https://marketplace.visualstudio.com/items?itemName=chenglou92.rescript-vscode), use the command "ReScript: Open the compiled JS file for this implementation file" to open the generated JS file for the currently active ReScript source file.
5359

5460
During development, instead of running `npm run res:build` each time to compile, use `npm run res:dev` to start a watcher that recompiles automatically after file changes.
5561

@@ -87,16 +93,16 @@ bun create rescript-app
8793
<CodeTab labels={["npm", "yarn", "pnpm", "bun"]}>
8894

8995
```sh
90-
npm install rescript
96+
npm install rescript @rescript/core
9197
```
9298
```sh
93-
yarn add rescript
99+
yarn add rescript @rescript/core
94100
```
95101
```sh
96-
pnpm install rescript
102+
pnpm install rescript @rescript/core
97103
```
98104
```sh
99-
bun install rescript
105+
bun install rescript @rescript/core
100106
```
101107

102108
</CodeTab>
@@ -117,15 +123,20 @@ bun create rescript-app
117123
}
118124
],
119125
"suffix": ".res.js",
120-
"bs-dependencies": []
126+
"bs-dependencies": [
127+
"@rescript/core"
128+
],
129+
"bsc-flags": [
130+
"-open RescriptCore"
131+
]
121132
}
122133
```
123134
See [Build Configuration](build-configuration) for more details on `rescript.json`.
124135
- Add convenience `npm` scripts to `package.json`:
125136
```json
126137
"scripts": {
127138
"res:build": "rescript",
128-
"res:dev": "rescript build -w"
139+
"res:dev": "rescript -w"
129140
}
130141
```
131142

0 commit comments

Comments
 (0)