Skip to content

Commit d5131d7

Browse files
committed
use full defaults
1 parent 9cd7e09 commit d5131d7

File tree

405 files changed

+5552
-5527
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

405 files changed

+5552
-5527
lines changed

.prettierrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
semi: false
21
plugins:
32
- "@prettier/plugin-oxc"

_blogposts/2020-08-28-new-rescript-logo.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: |
77
Today, our resident designer Bettina is unveiling to us the fresh new ReScript branding we've been long waiting for. We hope you're as excited about the result as us!
88
---
99

10-
import Image from "src/components/Image"
10+
import Image from "src/components/Image";
1111

1212
## Why the Rebranding?
1313

_blogposts/2020-09-25-release-8-3.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ let a = input "hello"
102102
Will now be compiled properly under es6 format as below:
103103

104104
```js
105-
import Hello from "hello"
106-
var a = Hello("hello")
105+
import Hello from "hello";
106+
var a = Hello("hello");
107107
```
108108

109109
## Customized js file extension support

_blogposts/2020-11-17-editor-support-custom-operators-and-more.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: |
88
Update on what we're doing around the end of 2020 and early next year.
99
---
1010

11-
import Video from "src/components/Video"
11+
import Video from "src/components/Video";
1212

1313
## Upcoming Improvements
1414

_blogposts/2021-02-09-release-9-0.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@ The snippet above will compile to the following JS output:
6767

6868
```js
6969
function test(x) {
70-
return x === 0
70+
return x === 0;
7171
}
7272
```
7373

7474
```js
7575
function test(x) {
7676
if (typeof x === "number") {
77-
return x === 0
77+
return x === 0;
7878
} else {
79-
return false
79+
return false;
8080
}
8181
}
8282
```

_blogposts/2021-05-07-release-9-1.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ let test = (arg: t) => {
7979
```
8080

8181
```js
82-
var secret = 42
82+
var secret = 42;
8383

8484
function test(arg) {
8585
if (arg === 5) {
86-
return "world"
86+
return "world";
8787
} else {
88-
return "hello"
88+
return "hello";
8989
}
9090
}
9191
```
@@ -111,15 +111,15 @@ Js.log(test3(Some(#3)))
111111

112112
```js
113113
function test2(arg) {
114-
return arg
114+
return arg;
115115
}
116116

117117
function test3(arg) {
118-
return arg
118+
return arg;
119119
}
120120

121-
console.log(1)
122-
console.log(3)
121+
console.log(1);
122+
console.log(3);
123123
```
124124

125125
</CodeTab>

_blogposts/2021-06-25-roadmap-2021-and-new-landing-page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: |
77
Announcing our roadmap for 2021 / 2022, release cycle plans and new landing page.
88
---
99

10-
import Image from "src/components/Image.mjs"
10+
import Image from "src/components/Image.mjs";
1111

1212
## Team Update
1313

_blogposts/2023-02-02-release-10-1.mdx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -180,70 +180,70 @@ let root =
180180
```
181181

182182
```js
183-
import * as React from "react"
184-
import * as JsxRuntime from "react/jsx-runtime"
183+
import * as React from "react";
184+
import * as JsxRuntime from "react/jsx-runtime";
185185

186186
function Playground$AutomaticModeExample(props) {
187187
return JsxRuntime.jsx("div", {
188188
children: "Hello " + props.name + "",
189-
})
189+
});
190190
}
191191

192192
var AutomaticModeExample = {
193193
make: Playground$AutomaticModeExample,
194-
}
194+
};
195195

196196
function Playground$ClassicModeExample(props) {
197-
return React.createElement("div", undefined, "Hello " + props.name + "")
197+
return React.createElement("div", undefined, "Hello " + props.name + "");
198198
}
199199

200200
var ClassicModeExample = {
201201
make: Playground$ClassicModeExample,
202-
}
202+
};
203203

204204
function make(props) {
205205
return JsxRuntime.jsx("div", {
206206
children: "Hello " + props.name + "",
207-
})
207+
});
208208
}
209209

210210
var NoAttributeExample = {
211211
make: make,
212-
}
212+
};
213213

214214
function Playground$ReactInterfaceExample(props) {
215-
var age = props.age
216-
var age$1 = age !== undefined ? age : 0
215+
var age = props.age;
216+
var age$1 = age !== undefined ? age : 0;
217217
return JsxRuntime.jsx("div", {
218218
children:
219219
"Hello " + props.name + ", you are " + String(age$1) + " years old.",
220-
})
220+
});
221221
}
222222

223223
var ReactInterfaceExample = {
224224
make: Playground$ReactInterfaceExample,
225-
}
225+
};
226226

227227
function Playground$PropTypeInjectionExample(props) {
228-
var msg = props.isHuman ? "hello human" : "hello fellow computer"
228+
var msg = props.isHuman ? "hello human" : "hello fellow computer";
229229
return JsxRuntime.jsx("div", {
230230
children: msg,
231-
})
231+
});
232232
}
233233

234234
var PropTypeInjectionExample = {
235235
make: Playground$PropTypeInjectionExample,
236-
}
236+
};
237237

238238
function Playground$PropSpreadExample(props) {
239239
return JsxRuntime.jsx(make, {
240240
name: "World",
241-
})
241+
});
242242
}
243243

244244
var PropSpreadExample = {
245245
make: Playground$PropSpreadExample,
246-
}
246+
};
247247

248248
var root = JsxRuntime.jsxs("div", {
249249
children: [
@@ -264,7 +264,7 @@ var root = JsxRuntime.jsxs("div", {
264264
}),
265265
JsxRuntime.jsx(Playground$PropSpreadExample, {}),
266266
],
267-
})
267+
});
268268

269269
export {
270270
AutomaticModeExample,
@@ -274,7 +274,7 @@ export {
274274
PropTypeInjectionExample,
275275
PropSpreadExample,
276276
root,
277-
}
277+
};
278278
```
279279

280280
</CodeTab>

_blogposts/2023-04-17-improving-interop.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ This is represented as:
3131
var user = {
3232
TAG: /* User */ 0,
3333
name: "Hello",
34-
}
34+
};
3535
```
3636

3737
However, this has been problematic when binding to external data because there has been no way to customize the discriminator (the `TAG` property) or how its value is represented for each variant case (`0` representing `User` here). This means that unless your external data is modeled the exact same way as above, which is unlikely, you'd be forced to convert to the structure ReScript expects at runtime.
@@ -42,7 +42,7 @@ To illustrate this, let's imagine we're binding to an external union that looks
4242
type LoadingState =
4343
| { state: "loading"; ready: boolean }
4444
| { state: "error"; message: string }
45-
| { state: "done"; data: Data }
45+
| { state: "done"; data: Data };
4646
```
4747

4848
Currently, there's no good way to use a ReScript variant to represent this type without resorting to manual and error-prone runtime conversion. However, with the new functionality, binding to the above with no additional runtime cost is easy:
@@ -60,7 +60,7 @@ This will compile to:
6060
var state = {
6161
state: "error",
6262
message: "Something went wrong!",
63-
}
63+
};
6464
```
6565

6666
Let's break down what we've done to make this work:
@@ -91,7 +91,7 @@ enum Direction {
9191
Right = "RIGHT",
9292
}
9393

94-
export const myDirection = Direction.Up
94+
export const myDirection = Direction.Up;
9595
```
9696

9797
Previously, you'd be forced to use a polymorphic variant for this if you wanted clean, zero-cost interop:
@@ -138,7 +138,7 @@ The same logic is easily applied to string literals from TypeScript, only here t
138138

139139
```typescript
140140
// direction.ts
141-
type direction = "UP" | "DOWN" | "LEFT" | "RIGHT"
141+
type direction = "UP" | "DOWN" | "LEFT" | "RIGHT";
142142
```
143143

144144
There's no way to attach documentation strings to string literals in TypeScript, and you only get the actual value to interact with.
@@ -162,7 +162,7 @@ Here, each value will be _unboxed_ at runtime. That means that the variant paylo
162162
It, therefore, compiles to this JS:
163163

164164
```javascript
165-
var myArray = ["hello", true, false, 13.37]
165+
var myArray = ["hello", true, false, 13.37];
166166
```
167167

168168
This was previously possible to do, leveraging a few tricks, when you didn't need to potentially read the values from the array again in ReScript. But, if you wanted to read back the values, you'd have to do a number of manual steps.

_blogposts/2023-06-05-first-class-dynamic-import-support.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ This compiles to:
5555
```javascript
5656
async function main() {
5757
var add = await import("./MathUtils.mjs").then(function (m) {
58-
return m.add
59-
})
58+
return m.add;
59+
});
6060

61-
var onePlusOne = add(1, 1)
62-
console.log(onePlusOne)
61+
var onePlusOne = add(1, 1);
62+
console.log(onePlusOne);
6363
}
6464
```
6565

@@ -115,10 +115,10 @@ And, the generated JavaScript will look like this:
115115

116116
```js
117117
async function main() {
118-
var Utils = await import("./MathUtils.mjs")
118+
var Utils = await import("./MathUtils.mjs");
119119

120-
var twoPlusTwo = Utils.add(2, 2)
121-
console.log(twoPlusTwo)
120+
var twoPlusTwo = Utils.add(2, 2);
121+
console.log(twoPlusTwo);
122122
}
123123
```
124124

0 commit comments

Comments
 (0)