Skip to content

Commit

Permalink
v5.1.0 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
DZakh committed Oct 12, 2023
1 parent eb3cc15 commit cf689c7
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Install ppx
run: pnpm ppx:install

- run: pnpm exec rescript build -with-deps
- run: pnpm exec rescript build
working-directory: packages/tests

- run: pnpm lint:stdlib
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG_NEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- Added advanced tuple struct to js api
- Added a proper documentation for JS/TS users
- Added table of contents and splitted documentation into multiple documents
- Improved tree-shaking
- Improved tree-shaking. For the JS/TS api example bundle-size reduced by 13% - 2 kB (0.55 kB minified + gzipped)
- Added `S.Error.reason`
- Added alpha version of `S.merge` helper (JS/TS api only)
- Added `S.name`/`S.setName` for JS/TS api
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Highlights:
- Strict mode for object structs to prevent excessive fields and many more built-in helpers
- Works with plain JavaScript/TypeScript too! You don't need to use ReScript
- The **fastest** composable validation library in the entire JavaScript ecosystem ([benchmark](https://moltar.github.io/typescript-runtime-type-benchmarks/))
- Small and tree-shakable: [9.5kB minified + zipped](https://bundlephobia.com/package/rescript-struct)
- Small JS footprint & tree-shakable API ([Comparison with Zod and Valibot](./docs/js-usage.md#comparison))

Also, it has declarative API allowing you to use **rescript-struct** as a building block for other tools, such as:

Expand Down
16 changes: 8 additions & 8 deletions docs/js-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -587,11 +587,11 @@ Besides the individual bundle size, the overall size of the library is also sign

At the same time **rescript-struct** is the fastest composable validation library in the entire JavaScript ecosystem. This is achieved because of the JIT approach when an ultra optimized validator is created using `eval`.

| | [email protected] (unreleased) | [email protected] | [email protected] |
| ---------------------------------------- | ---------------------------------- | --------------- | -------------- |
| **Total size** (minified + gzipped) | 9.68 kB | 13.4 kB | 6.73 kB |
| **Example size** (minified + gzipped) | 5.92 kB | 12.8 kB | 965 B |
| **Performance** (Example parsing) | 1,030,417 ops/ms | 376 ops/ms | 24,034 ops/ms |
| **Eval-free** | |||
| **Codegen-free** (Doesn't need compiler) | |||
| **Ecosystem** | ⭐️ | ⭐️⭐️⭐️⭐️⭐️ | ⭐️⭐️ |
| | [email protected] | [email protected] | [email protected] |
| ---------------------------------------- | --------------------- | --------------- | -------------- |
| **Total size** (minified + gzipped) | 9.67 kB | 13.4 kB | 6.73 kB |
| **Example size** (minified + gzipped) | 5.53 kB | 12.8 kB | 965 B |
| **Performance** (Example parsing) | 1,030,417 ops/ms | 407 ops/ms | 24,034 ops/ms |
| **Eval-free** ||||
| **Codegen-free** (Doesn't need compiler) ||||
| **Ecosystem** | ⭐️ | ⭐️⭐️⭐️⭐️⭐️ | ⭐️⭐️ |
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rescript-struct",
"version": "5.0.1",
"version": "5.1.0",
"description": "The fastest composable parser/serializer for ReScript (and TypeScript)",
"keywords": [
"ReScript",
Expand All @@ -14,7 +14,6 @@
"Decode",
"Validation",
"Transform",
"Migration",
"Contract",
"Mapping",
"Jzon",
Expand Down Expand Up @@ -56,9 +55,9 @@
"coverage": "c8 --reporter=lcov npm test",
"prepack": "node ./packages/prepack/src/Prepack.bs.mjs",
"ppx:install": "node ./packages/ppx/install.cjs",
"res": "rescript build -with-deps -w",
"res:build": "rescript build -with-deps",
"test:res": "cd ./packages/tests && rescript clean && rescript build -with-deps -w",
"res": "rescript build -w",
"res:build": "rescript build",
"test:res": "cd ./packages/tests && rescript clean && rescript build -w",
"test": "ava",
"lint:stdlib": "rescript-stdlib-vendorer lint --project-path=packages/tests --ignore-path=src/ppx/Ppx_Primitives_test.res"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/prepack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"private": true,
"type": "module",
"scripts": {
"res:build": "rescript build -with-deps",
"res": "rescript build -with-deps -w",
"res:build": "rescript build",
"res": "rescript build -w",
"lint:stdlib": "rescript-stdlib-vendorer lint"
},
"dependencies": {
Expand Down

2 comments on commit cf689c7

@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: cf689c7 Previous: 80ac4f1 Ratio
Parse string 587962295 ops/sec (±0.34%) 706149725 ops/sec (±0.41%) 1.20
Serialize string 586665518 ops/sec (±0.28%) 693539015 ops/sec (±2.10%) 1.18
Advanced object struct factory 302290 ops/sec (±0.61%) 286556 ops/sec (±0.58%) 0.95
Parse advanced object 34312934 ops/sec (±0.38%) 22341504 ops/sec (±0.24%) 0.65
Create and parse advanced object 24894 ops/sec (±0.54%) 58042 ops/sec (±1.08%) 2.33
Parse advanced strict object 15662037 ops/sec (±0.27%) 13141235 ops/sec (±0.73%) 0.84
Serialize advanced object 575867950 ops/sec (±0.25%) 32617508 ops/sec (±0.33%) 0.056640603110487395

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

@github-actions
Copy link

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: cf689c7 Previous: 80ac4f1 Ratio
Create and parse advanced object 24894 ops/sec (±0.54%) 58042 ops/sec (±1.08%) 2.33

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

Please sign in to comment.