Skip to content

Commit c18e266

Browse files
authored
ReScript v12 (#581)
* start adding ReScript v12 stuff * start moving to Rescript v12 * remove most usage of Belt * fix remaining Belt usages * 4.0.0 * switch to correct branch
1 parent b6d90b6 commit c18e266

File tree

169 files changed

+2310
-1144
lines changed

Some content is hidden

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

169 files changed

+2310
-1144
lines changed

.github/workflows/bindings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v4
1818
- uses: actions/setup-node@v4
1919
with:
20-
node-version: 20
20+
node-version: 23
2121
env:
2222
CI: true
2323
- name: Set up OCaml

.github/workflows/build-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/checkout@v4
2323
- uses: actions/setup-node@v4
2424
with:
25-
node-version: 20.x
25+
node-version: 23.x
2626
env:
2727
CI: true
2828
- name: Set up OCaml
@@ -64,7 +64,7 @@ jobs:
6464
- uses: actions/checkout@v4
6565
- uses: actions/setup-node@v4
6666
with:
67-
node-version: 20.x
67+
node-version: 23.x
6868
env:
6969
CI: true
7070
- name: Set up OCaml
@@ -154,7 +154,7 @@ jobs:
154154
- uses: actions/checkout@v4
155155
- uses: actions/setup-node@v4
156156
with:
157-
node-version: 20
157+
node-version: 23
158158
env:
159159
CI: true
160160
- name: Set up OCaml

.github/workflows/cli.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v4
1818
- uses: actions/setup-node@v4
1919
with:
20-
node-version: 20
20+
node-version: 23
2121
env:
2222
CI: true
2323
- name: Install

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
submodules: "true"
1717
- uses: actions/setup-node@v4
1818
with:
19-
node-version: 20
19+
node-version: 23
2020
env:
2121
CI: true
2222
- uses: actions-rs/toolchain@v1

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# master
22

3+
# 4.0.0
4+
35
- Support `@exhaustive` on interfaces as well.
6+
- Remove `ReactDOMExperimental` module, since everything needed is in the official RescriptReact bindings now.
7+
- Move fully to ReScript v12. From `4.x`, only v12 is supported.
48

59
# 3.5.1
610

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ let make = (~user) => {
6969
<div>
7070
<p>
7171
{React.string(
72-
userData.firstName ++ (" has " ++ (userData.friendCount->string_of_int ++ " friends.")),
72+
userData.firstName ++ (" has " ++ (userData.friendCount->Int.toString ++ " friends.")),
7373
)}
7474
</p>
7575
</div>
@@ -100,11 +100,21 @@ let make = () => {
100100

101101
## Note about versioning
102102

103-
There's plenty of work ongoing to bring RescriptRelay to full ReScript v11 support, including uncurried mode. Here's the versioning scheme that'll be followed going forward:
103+
RescriptRelay has moved through a few major lines with different ReScript baselines. Use the compatibility guide below to pick the right versions:
104+
105+
### Compatibility
106+
107+
| RescriptRelay | Required ReScript |
108+
| ------------- | ----------------- |
109+
| 4.x and newer | v12.x (or newer) |
110+
| 3.x and below | v11.x (or older) |
111+
112+
Additional context on historical focus areas:
104113

105114
- 1.x will receive critical bug fixes etc, but new features won't be added
106-
- 2.x will focus on compatibility with ReScript v11, and uncurried mode (uncurried mode will be optional). This is intended to make the transition to v11+ smooth
107-
- 3.x is fully embracing uncurried mode (no curried mode available), and adds a bunch of new stuff + change existing APIs to make them better and more ergonomic
115+
- 2.x focuses on compatibility with ReScript v11, and uncurried mode (uncurried mode can be optional). This is intended to make the transition to v11+ smooth
116+
- 3.x fully embraces uncurried mode (no curried mode available), and adds a bunch of new stuff + changes existing APIs to make them better and more ergonomic
117+
- 4.x focuses exclusively on ReScript v12+.
108118

109119
## Examples
110120

packages/relay

Submodule relay updated 120 files

packages/rescript-relay/__tests__/ProvidedVariables.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module InputC = {
1010
}
1111

1212
module InputCArr = {
13-
let get = (): option<array<RelaySchemaAssets_graphql.input_InputC>> => Some([{intStr: 123}])
13+
let get = () => Some([({intStr: 123}: RelaySchemaAssets_graphql.input_InputC)])
1414
}
1515

1616
module IntStr = {

packages/rescript-relay/__tests__/RelayEnv.res

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ let fetchQuery: RescriptRelay.Network.fetchFunctionPromise = async (
1212
{
1313
method: #POST,
1414
body: {"query": operation.text, "id": operation.id, "variables": variables}
15-
->Js.Json.stringifyAny
16-
->Belt.Option.getExn
15+
->JSON.stringifyAny
16+
->Option.getOrThrow
1717
->Body.string,
1818
headers: Headers.fromObject({
1919
"content-type": "application/json",
@@ -27,6 +27,6 @@ let fetchQuery: RescriptRelay.Network.fetchFunctionPromise = async (
2727
RescriptRelay.Network.preloadResources(~operation, ~variables, ~response=json)
2828
json
2929
} else {
30-
raise(Graphql_error("Request failed: " ++ Response.statusText(resp)))
30+
throw(Graphql_error("Request failed: " ++ Response.statusText(resp)))
3131
}
3232
}

packages/rescript-relay/__tests__/TestRelayResolvers.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ let localUser = () => {
3434
* @RelayResolver LocalUser.nameRepeated(times: Int!): String
3535
*/
3636
let nameRepeated = (user, args) => {
37-
user.name->Js.String2.repeat(args.times)
37+
user.name->String.repeat(args.times)
3838
}
3939

4040
/**

0 commit comments

Comments
 (0)