@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 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 | Ppx_spice |
132
- | -------- | ---------------------------- |
133
- | v12 | v0.2.3 >= |
134
- | v11 | v0.2.2 >= && > v0.2.0 |
135
- | v10 | v0.2.0 >= |
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
- ["@greenlabs/ppx-spice/ppx", "-uncurried"]
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greenlabs/ppx-spice",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "ReScript PPX which generate JSON (de)serializer",
5
5
  "license": "MIT",
6
6
  "author": "Greenlabs Dev <developer@greenlabs.co.kr>",
package/ppx-linux.exe CHANGED
Binary file
package/ppx-osx.exe CHANGED
Binary file
package/ppx-windows.exe CHANGED
Binary file
@@ -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) => Ok(BigInt.fromFloat(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