You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: markdown-pages/blog/release-9-0.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ Our compiler comes with a set of stdlib modules (such as `Belt`, `Pervasives`, e
34
34
35
35
In previous versions, users couldn't ship their compiled JS code without defining a `package.json` dependency on `bs-platform`. Whenever a ReScript developer wanted to publish a package just for pure JS consumption / lean container deployment, they were required to use a bundler to bundle up their library / stdlib code, which made things way more complex and harder to understand.
36
36
37
-
To fix this problem, we introduced an `external-stdlib` configuration that allows specifying a pre-compiled stdlib npm package (`@rescript/std`). More details on how to use that feature can be found in our [External Stdlib](../docs/manual/build-external-stdlib.mdx) documentation.
37
+
To fix this problem, we introduced an `external-stdlib` configuration that allows specifying a pre-compiled stdlib npm package (`@rescript/std`).
Copy file name to clipboardExpand all lines: markdown-pages/docs/manual/array-and-list.mdx
+5-9Lines changed: 5 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ order: 12
10
10
11
11
## Array
12
12
13
-
Arrays are our main ordered data structure. They work the same way as JavaScript arrays: they can be randomly accessed, dynamically resized, updated, etc.
13
+
Arrays are the main ordered data structure in ReScript. They can be randomly accessed, dynamically resized, and updated.
14
14
15
15
<CodeTablabels={["ReScript", "JS Output"]}>
16
16
@@ -84,7 +84,7 @@ myArray[0] = "bye";
84
84
85
85
**Since 11.1**
86
86
87
-
You can spread arrays of the the same type into new arrays, just like in JavaScript:
87
+
You can spread arrays of the same type into new arrays:
88
88
89
89
<CodeTablabels={["ReScript", "JS Output"]}>
90
90
@@ -96,21 +96,17 @@ let x3 = [...y]
96
96
```
97
97
98
98
```javascript
99
-
var Belt_Array =require("rescript/lib/js/belt_Array.js");
100
-
101
99
var y = [1, 2];
102
100
103
-
var x =Belt_Array.concatMany([[4, 5], y]);
101
+
var x =[4, 5, ...y];
104
102
105
-
var x2 =Belt_Array.concatMany([[4, 5], y, [7], y]);
103
+
var x2 =[4, 5, ...y, 7, ...y];
106
104
107
-
var x3 =Belt_Array.concatMany([y]);
105
+
var x3 =[...y];
108
106
```
109
107
110
108
</CodeTab>
111
109
112
-
> Note that array spreads compiles to `Belt.Array.concatMany` right now. This is likely to change to native array spreads in the future.
113
-
114
110
## List
115
111
116
112
ReScript provides a singly linked list too. Lists are:
Copy file name to clipboardExpand all lines: markdown-pages/docs/manual/async-await.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ You will probably notice that this looks very similar to `async` / `await` in JS
67
67
-`await` may only be called on a `promise` value
68
68
-`await` calls are expressions, therefore they can be used in pattern matching (`switch`)
69
69
- A function returning a `promise<'a>` is equivalent to an `async` function returning a value `'a` (important for writing signature files and bindings)
70
-
-`promise` values and types returned from an `async` function don't auto-collapse into a "flat promise" like in JS (more on this later)
70
+
-`promise` values and types returned from an `async` function don't auto-collapse into a flat promise. See the details below.
Copy file name to clipboardExpand all lines: markdown-pages/docs/manual/build-configuration.mdx
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,17 +81,13 @@ Here, the file `src/MyMainModule.res` is exposed to outside consumers, while all
81
81
}
82
82
```
83
83
84
-
## bs-dependencies, bs-dev-dependencies
84
+
## dependencies, dev-dependencies
85
85
86
86
List of ReScript dependencies. Just like `package.json`'s dependencies, they'll be searched in `node_modules`.
87
87
88
-
Note that only sources marked with `"type":"dev"` will be able to resolve modules from `bs-dev-dependencies`.
88
+
Note that only sources marked with `"type":"dev"` will be able to resolve modules from `dev-dependencies`.
89
89
90
-
## external-stdlib
91
-
92
-
**Since 9.0**: This setting allows depending on an externally built stdlib package (instead of a locally built stdlib runtime). Useful for shipping packages that are only consumed in JS or TS without any dependencies to the ReScript development toolchain.
93
-
94
-
More details can be found on our [external stdlib](./build-external-stdlib.mdx) page.
90
+
> The legacy keys `bs-dependencies` and `bs-dev-dependencies` are still accepted but deprecated.
95
91
96
92
## js-post-build
97
93
@@ -155,7 +151,8 @@ This configuration only applies to you, when you develop the project. When the p
155
151
156
152
## suffix
157
153
158
-
**Since 11.0**: The suffix can now be freely chosen. However, we still suggest you stick to the convention and use
154
+
**Since 11.0**: The suffix can be freely chosen. However, we still suggest you stick to the convention and use
155
+
159
156
one of the following:
160
157
161
158
-`".js`
@@ -190,12 +187,14 @@ Turn off warning `44` and `102` (polymorphic comparison). Turn warning `5` (part
190
187
191
188
The warning numbers are shown in the build output when they're triggered. See [Warning Numbers](./warning-numbers.mdx) for the complete list.
192
189
193
-
## bsc-flags
190
+
## compiler-flags
194
191
195
192
Extra flags to pass to the compiler. For advanced usages.
196
193
197
194
-`-open ABC` opens the module `ABC` for each file in the project. `ABC` can either be a dependency, namespaced project or local module of the current project.
198
195
196
+
> The legacy key `bsc-flags` is still accepted but deprecated.
197
+
199
198
## gentypeconfig
200
199
201
200
To enable genType, set `"gentypeconfig"` at top level in the project's `rescript.json`.
0 commit comments