@greenlabs/ppx-spice 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +10 -8
- package/package.json +1 -1
- package/ppx-linux.exe +0 -0
- package/ppx-osx.exe +0 -0
- package/ppx-windows.exe +0 -0
- package/src/rescript/Spice.res +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 0.2.9
|
|
4
|
+
|
|
5
|
+
- Update test project for compiler v12. https://github.com/green-labs/ppx_spice/pull/94
|
|
6
|
+
- Fix bigint codec on rescript v12. https://github.com/green-labs/ppx_spice/pull/93
|
|
7
|
+
|
|
8
|
+
## 0.2.8
|
|
9
|
+
|
|
10
|
+
- Dropped support for curried mode in accordance with compiler v12 changes.
|
|
11
|
+
- Fixed a build error in the polyvariant encoder generation function to ensure compatibility with compiler v12-alpha.12. https://github.com/green-labs/ppx_spice/pull/91
|
|
12
|
+
|
|
3
13
|
## 0.2.7
|
|
4
14
|
|
|
5
15
|
- Add type annotation to error pattern: now generates `Error(e: Spice.decodeError)` for record decoding errors.
|
package/README.md
CHANGED
|
@@ -128,11 +128,15 @@ Read our [Guide with examples](docs/GUIDE.md)
|
|
|
128
128
|
|
|
129
129
|
### Compatibility on the compiler versions
|
|
130
130
|
|
|
131
|
-
| Compiler
|
|
132
|
-
|
|
|
133
|
-
| v12
|
|
134
|
-
|
|
|
135
|
-
|
|
|
131
|
+
| Compiler | Ppx_spice | Note |
|
|
132
|
+
| ------------- | --------------------- | ----------------------------- |
|
|
133
|
+
| v12-alpha.14 | v0.2.9 >= | Bigint.fromFloat type changed |
|
|
134
|
+
| v12-alpha.5 | v0.2.8 | Curried mode deprecated |
|
|
135
|
+
| v12-alpha.4 | v0.2.7 >= && > v0.2.2 | |
|
|
136
|
+
| v11 | v0.2.2 >= && > v0.2.0 | |
|
|
137
|
+
| v10 | v0.2.0 >= | |
|
|
138
|
+
|
|
139
|
+
NOTE: Starting from v0.2.8, support for curried mode is discontinued to align with the changes in compiler v12.
|
|
136
140
|
|
|
137
141
|
```sh
|
|
138
142
|
yarn add -D @greenlabs/ppx-spice
|
|
@@ -146,12 +150,10 @@ yarn add -D @greenlabs/ppx-spice
|
|
|
146
150
|
],
|
|
147
151
|
"ppx-flags": [
|
|
148
152
|
...,
|
|
149
|
-
|
|
153
|
+
"@greenlabs/ppx-spice/ppx"
|
|
150
154
|
],
|
|
151
155
|
```
|
|
152
156
|
|
|
153
|
-
> If you want to set it to uncurried mode, add `-uncurried`.
|
|
154
|
-
|
|
155
157
|
## Development
|
|
156
158
|
|
|
157
159
|
### With Dune
|
package/package.json
CHANGED
package/ppx-linux.exe
CHANGED
|
Binary file
|
package/ppx-osx.exe
CHANGED
|
Binary file
|
package/ppx-windows.exe
CHANGED
|
Binary file
|
package/src/rescript/Spice.res
CHANGED
|
@@ -39,7 +39,11 @@ let bigintToJson = (i): Js.Json.t => Js.Json.Number(BigInt.toFloat(i))
|
|
|
39
39
|
|
|
40
40
|
let bigintFromJson = j =>
|
|
41
41
|
switch (j: Js.Json.t) {
|
|
42
|
-
| Js.Json.Number(n) =>
|
|
42
|
+
| Js.Json.Number(n) =>
|
|
43
|
+
switch BigInt.fromFloat(n) {
|
|
44
|
+
| Some(v) => v->Ok
|
|
45
|
+
| None => error("Not a bigint", j)
|
|
46
|
+
}
|
|
43
47
|
| _ => error("Not a number", j)
|
|
44
48
|
}
|
|
45
49
|
|