Skip to content

Commit 23b2f10

Browse files
committed
Merge branch 'main' into add-examples-tests
2 parents f6bf7a7 + 9129456 commit 23b2f10

24 files changed

+251
-63
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## Next version
44

5+
## 1.0.0
6+
7+
- Up ReScript dependency to 11+.
8+
- `JSON`, `Null` and `Nullable` untagged variants are now properly exposed.
9+
- BREAKING: Duplicated definition of `result` in `Result` module removed, as `result` is now a built in. Switch out any `Result.t` type annotations to point to the built in `result` instead.
10+
511
## 0.7.0
612

713
- Add `Dict.getUnsafe` https://github.com/rescript-association/rescript-core/pull/167

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In ReScript 11, it is shipped as a separate npm package @rescript/core that is a
66

77
## Versioning
88

9-
- Versions `0.x` targets ReScript v10.1 and below.
9+
- Versions [`0.x`](https://github.com/rescript-association/rescript-core/tree/0.x) targets ReScript v10.1 and below.
1010
- Versions `1.x` targets ReScript v11 and above, and contains code that will not work with v10.1 and below.
1111

1212
## Background

package-lock.json

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rescript/core",
3-
"version": "0.7.0",
3+
"version": "1.0.0",
44
"scripts": {
55
"clean": "rescript clean",
66
"build": "rescript",
@@ -24,11 +24,10 @@
2424
"src/**/*.mjs"
2525
],
2626
"peerDependencies": {
27-
"rescript": "^10.1.0 || ^11.0.0"
27+
"rescript": ">=11.0.0 || ^11.1.0-rc.2"
2828
},
2929
"devDependencies": {
30-
"@babel/code-frame": "7.18.6",
31-
"@rescript/tools": "^0.5.0",
32-
"rescript": "^11.1.0-rc.2"
30+
"rescript": "11.1.0-rc.2",
31+
"@babel/code-frame": "7.18.6"
3332
}
3433
}

src/Core__JSON.res

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
type t = Js.Json.t
1+
@unboxed
2+
type rec t = Js.Json.t =
3+
| Boolean(bool)
4+
| @as(null) Null
5+
| String(string)
6+
| Number(float)
7+
| Object(Core__Dict.t<t>)
8+
| Array(array<t>)
29

310
@raises @val external parseExn: string => t = "JSON.parse"
411
@raises @val external parseExnWithReviver: (string, (string, t) => t) => t = "JSON.parse"

src/Core__JSON.resi

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ Functions for interacting with JSON.
55
/**
66
A type representing a JSON object.
77
*/
8-
type t = Js.Json.t
8+
@unboxed
9+
type rec t = Js.Json.t =
10+
| Boolean(bool)
11+
| @as(null) Null
12+
| String(string)
13+
| Number(float)
14+
| Object(Core__Dict.t<t>)
15+
| Array(array<t>)
916

1017
/**
1118
`parseExn(string)`

src/Core__Null.res

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
type t<'a> = Js.Null.t<'a>
1+
@unboxed
2+
type t<'a> = Js.Null.t<'a> =
3+
| Value('a)
4+
| @as(null) Null
25

36
external asNullable: t<'a> => Core__Nullable.t<'a> = "%identity"
47

src/Core__Null.resi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ If you also need to cover `undefined`, check out `Nullable` instead.
77
/**
88
A type representing a value that can be either `'a` or `null`.
99
*/
10-
type t<'a> = Js.Null.t<'a>
10+
@unboxed
11+
type t<'a> = Js.Null.t<'a> =
12+
| Value('a)
13+
| @as(null) Null
1114

1215
/**
1316
Converts a `Null.t` into a `Nullable.t`.

src/Core__Nullable.res

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
type t<'a> = Js.Nullable.t<'a>
1+
type t<'a> = Js.Nullable.t<'a> =
2+
| Value('a)
3+
| @as(null) Null
4+
| @as(undefined) Undefined
25

36
external null: t<'a> = "#null"
47

src/Core__Nullable.resi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ Primarily useful when interoping with JavaScript when you don't know whether you
88
Type representing a nullable value.
99
A nullable value can be the value `'a`, `null` or `undefined`.
1010
*/
11-
type t<'a> = Js.Nullable.t<'a>
11+
@unboxed
12+
type t<'a> = Js.Nullable.t<'a> =
13+
| Value('a)
14+
| @as(null) Null
15+
| @as(undefined) Undefined
1216

1317
/**
1418
The value `null`.

0 commit comments

Comments
 (0)