Skip to content

Commit c79ef98

Browse files
committed
Fix blogpost markdown
1 parent d424bb0 commit c79ef98

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

_blogposts/2020-09-23-release-8-3.md.raw

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ title: What's new in ReScript 8.3 (Part 1)
77
description: |
88
---
99

10+
## Introduction
1011

11-
# What's new in ReScript 8.3 (Part 1)
12-
13-
ReScript is a soundly typed language with an optimizing compiler focused on JS platform.
12+
ReScript is a soundly typed language with an optimizing compiler focused on the JS platform.
1413
It's focused on type safety, performance and JS interop. It used to be called BuckleScript.
1514

16-
[email protected] is available, people can try it via
15+
[[email protected]](https://www.npmjs.com/package/bs-platform/v/8.3.0) is now available for testing, you can try it via
1716

1817
```
1918
@@ -119,4 +118,4 @@ like `let {N.x} = ..`
119118

120119
A lot of work is put in improving the build system, we will expand on this topic in the next post!
121120

122-
Happy Hacking!
121+
Happy Hacking!

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ title: What's new in ReScript 8.3 (Part 1)
77
description: |
88
---
99

10+
## Introduction
1011

11-
# What's new in ReScript 8.3 (Part 1)
12-
13-
ReScript is a soundly typed language with an optimizing compiler focused on JS platform.
12+
ReScript is a soundly typed language with an optimizing compiler focused on the JS platform.
1413
It's focused on type safety, performance and JS interop. It used to be called BuckleScript.
1514

16-
[email protected] is available, people can try it via
15+
[[email protected]](https://www.npmjs.com/package/bs-platform/v/8.3.0) is now available for testing, you can try it via
1716

1817
```
1918
@@ -31,6 +30,7 @@ For example, the old externals for `readFileAsUtf8Sync` used to be written like
3130

3231

3332
<CodeTab labels={["ReScript", "Reason", "ML"]}>
33+
3434
```res
3535
@bs.val @bs.module("fs")
3636
external readFileAsUtf8Sync: (string, @bs.as("utf8") _) => string = "readFileSync"
@@ -43,10 +43,13 @@ external readFileAsUtf8Sync: (string, [@bs.as "utf8"] _) => string =
4343
```ocaml
4444
external readFileAsUtf8Sync : string -> (_[@bs.as "utf8"]) -> string = "readFileSync" [@@bs.val] [@@bs.module "fs"]
4545
```
46+
4647
</CodeTab>
4748

4849
It can now be simplified as
50+
4951
<CodeTab labels={["ReScript", "Reason", "ML"]}>
52+
5053
```res
5154
@val @module("fs") external readFileAsUtf8Sync: (string, @as("utf8") _) => string = "readFileSync"
5255
```
@@ -59,6 +62,7 @@ external readFileAsUtf8Sync: (string, [@as "utf8"] _) => string =
5962
external readFileAsUtf8Sync : string -> (_[@as "utf8"]) -> string = "readFileSync"
6063
[@@val] [@@module "fs"]
6164
```
65+
6266
</CodeTab>
6367

6468
Note almost all previous attributes with `bs.xx` can be simplified as `xx`
@@ -75,6 +79,7 @@ backward compatibility.
7579
If you use es6 module output, the default bindings will be compiled properly now:
7680

7781
<CodeTab labels={["ReScript", "Reason", "ML"]}>
82+
7883
```res
7984
@module("hello") external input: string => string = "default"
8085
@@ -90,6 +95,7 @@ external input : string -> string = "default" [@@module "hello"]
9095
9196
let a = input "hello"
9297
```
98+
9399
</CodeTab>
94100

95101
Will now be compiled properly under es6 format as below:
@@ -128,6 +134,7 @@ for example, Next.js/React Native, we allow file names like `404.res`,
128134
Previously, for code like this:
129135

130136
<CodeTab labels={["ReScript", "Reason", "ML"]}>
137+
131138
```res
132139
module N = {
133140
type t = {x: int}
@@ -158,6 +165,7 @@ end
158165
let f (u : N.t) =
159166
let {x } = u in x + 1 (* type error *)
160167
```
168+
161169
</CodeTab>
162170

163171
You will get a type error
@@ -174,4 +182,4 @@ like `let {N.x} = ..`
174182

175183
A lot of work is put in improving the build system, we will expand on this topic in the next post!
176184

177-
Happy Hacking!
185+
Happy Hacking!

0 commit comments

Comments
 (0)