Skip to content

Commit

Permalink
Update rescript-schema-ppx version
Browse files Browse the repository at this point in the history
  • Loading branch information
DZakh committed Jun 17, 2024
1 parent c0a38f2 commit 05798b9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions CHANGELOG_V7.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### `s.flatten`

Now it's possible to spread/flatten an object schema in another object schema, allowing you to reuse schemas in a more powerful way.
Now, it's possible to spread/flatten an object schema in another object schema, allowing you to reuse schemas in a more powerful way.

```rescript
type entityData = {
Expand Down Expand Up @@ -46,7 +46,7 @@ let schema = S.object(s => {

### Object destructuring

Also, it's possible to destructure object field schemas inside of definition. You could also notice it in the `s.flatten` example 😁
Also, it's possible to destructure object field schemas inside of the definition. You could also notice it in the `s.flatten` example 😁

```rescript
let entitySchema = S.object(s => {
Expand Down Expand Up @@ -80,7 +80,7 @@ let entitySchema = S.object(s => {
})
```

> 🧠 Destructuring works only with not-transformed object schemas. Be careful, since it's not protected by typesystem.
> 🧠 Destructuring works only with not-transformed object schemas. Be careful since it's not protected by type system.
## Autocomplete improvements ⌨️

Expand All @@ -104,19 +104,19 @@ Added unsafe mode for `S.json`:
## Other cool changes and sometimes breaking 💣

- Added `serializeToJsonStringOrRaiseWith`
- Allow to create `S.union` with single item
- Allow to create `S.union` with a single item
- Removed `s.failWithError`. Use `S.Error.raise` instead
- PPX: Removed `@schema` for type expressions. Use `@s.matches` instead.
- Removed async support for `S.union`. Please create an issue if you used the feature
- Improved parsing performance of `S.array` and `S.dict` ~3 times
- Automatic serializing stopped working for tuples/objects/unions of literals. Use `S.literal` instead
- Removed `InvalidTupleSize` error code in favor of `InvalidType`
- Changed payload of `Object` and `Tuple` variants in the `tagged` type
- Redesigned `Literal` module to make it more effecient
- Redesigned `Literal` module to make it more efficient

- The `S.Literal.t` type was renamed to `S.literal`, became private and changed structure. Use `S.Literal.parse` to create instances of the type
- `S.Literal.classify` -> `S.Literal.parse`
- `S.Literal.toText` -> `S.Literal.toString`. Also, started using `.toString` for `Function` literalls and removed spaces for `Dict` and `Array` literals to make them look the same as the `JSON.stringify` output
- `S.Literal.toText` -> `S.Literal.toString`. Also, started using `.toString` for `Function` literals and removed spaces for `Dict` and `Array` literals to make them look the same as the `JSON.stringify` output

- Moved built-in refinements from nested modules to improve tree-shaking:

Expand Down Expand Up @@ -146,4 +146,4 @@ Added unsafe mode for `S.json`:
- `S.Int.max` -> `S.intMax`

- `S.Number.max` -> `S.numberMax`/`S.integerMax`
- `S.Number.min` -> `S.numberMin`/`S.integerMin`
- `S.Number.min` -> `S.numberMin`/`S.integerMin`
4 changes: 2 additions & 2 deletions packages/rescript-schema-ppx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rescript-schema-ppx",
"version": "6.4.0",
"version": "7.0.0",
"description": "ReScript PPX to generate rescript-schema from type",
"keywords": [
"ReScript",
Expand Down Expand Up @@ -31,6 +31,6 @@
"postinstall": "node ./install.cjs"
},
"peerDependencies": {
"rescript-schema": "6.4.0"
"rescript-schema": "7.0.0"
}
}
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit 05798b9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 05798b9 Previous: f718dde Ratio
Parse string 819198280 ops/sec (±0.13%) 814044167 ops/sec (±0.15%) 0.99
Serialize string 820501493 ops/sec (±0.06%) 814166152 ops/sec (±0.12%) 0.99
Advanced object schema factory 453182 ops/sec (±0.47%) 457405 ops/sec (±0.90%) 1.01
Parse advanced object 45147336 ops/sec (±0.22%) 42985342 ops/sec (±0.72%) 0.95
Create and parse advanced object 35056 ops/sec (±0.54%) 34684 ops/sec (±1.48%) 0.99
Parse advanced strict object 22420520 ops/sec (±1.07%) 21540357 ops/sec (±0.57%) 0.96
Serialize advanced object 808867538 ops/sec (±0.09%) 800158749 ops/sec (±0.09%) 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.