Skip to content

Commit b73260e

Browse files
committed
update docs
1 parent 69bd74c commit b73260e

File tree

2 files changed

+26
-20
lines changed

2 files changed

+26
-20
lines changed

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

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The changes are listed [here](https://github.com/rescript-lang/rescript-compiler
2525

2626
## Lightweight FFI attributes without `bs.` prefix
2727

28-
In this release, we make it optional to have `bs.` prefix it or not, this will make the FFI less verbose,
28+
In this release, we make the `bs.` prefix optional, this will make the FFI less verbose.
2929

3030
For example, the old externals for `readFileAsUtf8Sync` used to be written like this
3131

@@ -34,18 +34,18 @@ For example, the old externals for `readFileAsUtf8Sync` used to be written like
3434
external readFileAsUtf8Sync : string -> (_[@bs.as "utf8"]) -> string = "readFileSync" [@@bs.val] [@@bs.module "fs"]
3535
```
3636

37-
Could be simplified as
37+
It can now be simplified as
3838
```ocaml
3939
external readFileAsUtf8Sync : string -> (_[@as "utf8"]) -> string = "readFileSync"
4040
[@@val] [@@module "fs"]
4141
```
4242

43-
Note almost all previous attributes with `bs.xx` can be simplified as `xx`, except such two that
44-
we don't provide abbreviations:
43+
Note almost all previous attributes with `bs.xx` can be simplified as `xx`
44+
with the exception of the following two that don't have abbreviations:
4545

46-
- `bs.send.pipe` : this attribute was deprecated in favor of `bs.send`, you can still use the existing one for backward compatibility.
46+
- `bs.send.pipe` : this attribute was deprecated in favor of `bs.send`; you can still use the existing one for backward compatibility.
4747

48-
- `bs.splice` : this attribute was deprecated in favor of `bs.variadic`, you can still use the existing one for
48+
- `bs.splice` : this attribute was deprecated in favor of `bs.variadic`; you can still use the existing one for
4949
backward compatibility.
5050

5151

@@ -84,13 +84,15 @@ Now user can pick up their js file extension support per module format:
8484

8585
## More flexible filename support
8686

87-
To have better integration with other [JS infrastructures](https://github.com/rescript-lang/rescript-compiler/issues/4624), for example, Next.js/React Native, we allow file names like `404.res`, `Button.Andriod.res` so that it can just be picked up by those tools
87+
To have better integration with other [JS infrastructures](https://github.com/rescript-lang/rescript-compiler/issues/4624),
88+
for example, Next.js/React Native, we allow file names like `404.res`,
89+
`Button.Android.res` so that it can just be picked up by those tools
8890

8991

9092

9193
## Better type based inference for pattern `let {a,b,c} = value`
9294

93-
Previously for such piece of code:
95+
Previously, for code like this:
9496

9597
```ocaml
9698
module N = struct
@@ -109,8 +111,9 @@ You will get a type error
109111
Error: Unbound record field x
110112
```
111113

112-
However, since the compiler already knows the type of `u`, it is capable of looking up the label `x` properly,
113-
in this release, we make such style work out of the box without the work around like adding a module prefix like `let {N.x} = ..`
114+
However, since the compiler already knows the type of `u`, it is capable of looking up the label `x` properly.
115+
In this release, we make the original code style work out of the box without a work-around such as adding a module prefix
116+
like `let {N.x} = ..`
114117

115118
## Build system enhancement
116119

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

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The changes are listed [here](https://github.com/rescript-lang/rescript-compiler
2525

2626
## Lightweight FFI attributes without `bs.` prefix
2727

28-
In this release, we make it optional to have `bs.` prefix it or not, this will make the FFI less verbose,
28+
In this release, we make the `bs.` prefix optional, this will make the FFI less verbose.
2929

3030
For example, the old externals for `readFileAsUtf8Sync` used to be written like this
3131

@@ -45,7 +45,7 @@ external readFileAsUtf8Sync : string -> (_[@bs.as "utf8"]) -> string = "readFile
4545
```
4646
</CodeTab>
4747

48-
Could be simplified as
48+
It can now be simplified as
4949
<CodeTab labels={["ReScript", "Reason", "ML"]}>
5050
```res
5151
@val @module("fs") external readFileAsUtf8Sync: (string, @as("utf8") _) => string = "readFileSync"
@@ -61,12 +61,12 @@ external readFileAsUtf8Sync : string -> (_[@as "utf8"]) -> string = "readFileSyn
6161
```
6262
</CodeTab>
6363

64-
Note almost all previous attributes with `bs.xx` can be simplified as `xx`, except such two that
65-
we don't provide abbreviations:
64+
Note almost all previous attributes with `bs.xx` can be simplified as `xx`
65+
with the exception of the following two that don't have abbreviations:
6666

67-
- `bs.send.pipe` : this attribute was deprecated in favor of `bs.send`, you can still use the existing one for backward compatibility.
67+
- `bs.send.pipe` : this attribute was deprecated in favor of `bs.send`; you can still use the existing one for backward compatibility.
6868

69-
- `bs.splice` : this attribute was deprecated in favor of `bs.variadic`, you can still use the existing one for
69+
- `bs.splice` : this attribute was deprecated in favor of `bs.variadic`; you can still use the existing one for
7070
backward compatibility.
7171

7272

@@ -117,13 +117,15 @@ Now user can pick up their js file extension support per module format:
117117

118118
## More flexible filename support
119119

120-
To have better integration with other [JS infrastructures](https://github.com/rescript-lang/rescript-compiler/issues/4624), for example, Next.js/React Native, we allow file names like `404.res`, `Button.Andriod.res` so that it can just be picked up by those tools
120+
To have better integration with other [JS infrastructures](https://github.com/rescript-lang/rescript-compiler/issues/4624),
121+
for example, Next.js/React Native, we allow file names like `404.res`,
122+
`Button.Android.res` so that it can just be picked up by those tools
121123

122124

123125

124126
## Better type based inference for pattern `let {a,b,c} = value`
125127

126-
Previously for such piece of code:
128+
Previously, for code like this:
127129

128130
<CodeTab labels={["ReScript", "Reason", "ML"]}>
129131
```res
@@ -164,8 +166,9 @@ You will get a type error
164166
Error: Unbound record field x
165167
```
166168

167-
However, since the compiler already knows the type of `u`, it is capable of looking up the label `x` properly,
168-
in this release, we make such style work out of the box without the work around like adding a module prefix like `let {N.x} = ..`
169+
However, since the compiler already knows the type of `u`, it is capable of looking up the label `x` properly.
170+
In this release, we make the original code style work out of the box without a work-around such as adding a module prefix
171+
like `let {N.x} = ..`
169172

170173
## Build system enhancement
171174

0 commit comments

Comments
 (0)