-
Notifications
You must be signed in to change notification settings - Fork 78
Add TypeMap (Zod & Valibot) #1731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool, excited to see the results!
Wow, cool project 😄.
That will indeed cause problems in the future. But these can be (easily?) mitigated by keeping all modules in isolation as some kind of multi-package repository where each library is installed and benchmarked separately including all its dependencies and its own typescript and whatever it needs, see #899. I'm too lazy right now to do anything (may others do the first step) but I know that I'd jump in once there is enough pressure because things are falling apart 😁. |
@hoeck Hi, thanks :)
Hey yeah! Having a separate project / isolated node_modules directory per test case would be an amazing setup :) Isolating each test as a isolate project should fully mitigate any issues relating to cross linked peer dependencies (each project just installing what it needs). I'm not too familiar with progen, but it does seem like it could offer some test automation options. I might do some further reading on it (it actually looks quite interesting) As for TypeMap, and depending on timings, I am keeping track of the current two peer dependencies (Valibot, Zod). These dependencies should update fine for revisions and minor semver ticks, but am somewhat mindful on the upcoming Zod 4 release (major semver). Depending on how things go, if there are problems updating to Zod 4, I would be totally fine omitting TypeMap from the tests cases just to let Zod 4 test cases go through (that would be more important I think) TypeMap will be updated to Zod 4 when it's out, it mostly just comes down to timings :) Cheers! |
experienced that too .. but that was because unpgk.com had long response times / timeouts even. Should switch to using Vite rather soon bc. its easier to use and does not depend on an external service to load dependencies.
There was again some kind of race condition, the pr.yml action failed to commit the results because I think some other job ran as well that also committed something. But that is not an issue as the regular automatic dependabot updates also run all benchmarks. And there where was one those updates already and you can see that typemap/zod and typemap/valibot results are present in the results json. Now, they do not show up the results. To me it looks like the pages deploy happens before the results are being committed and pushed to master. TLDR: I re-ran the github pages action and now your results show up despite unpgk slowing down the loading of the site. |
Oh and BTW the results for your zod wrapper are insane 😄 |
@hoeck Hi!
Hey, thanks for the follow up! Can confirm the website loaded up ok. All good :)
Nice! The new tests benchmarked quite well. The mappings should let these libraries validate with roughly the same performance as TypeBox JIT. There's a bit of upfront overhead mapping the libraries over to schematics, but once mapped, they should be nice and fast! Thanks again! |
Description
This PR adds a new library named TypeMap. This library is somewhat unique in that it JIT accelerates Zod and Valibot on TypeBox infrastructure. It also provides runtime and type level mapping for these libraries so should fit the benchmark criteria.
https://github.com/sinclairzx81/typemap
This PR also bumps Valibot to the
1.0.0-rc.4
release candidate.Notes
The TypeMap library takes on Zod and Valibot as peerDependencies. I am currently tracking the latest versions of these libraries, but will need to be mindful when new majors are pushed (as I may need to bump the peer dependency version ranges in TypeMap). If there are any issues though, feel free to ping me (peer dependencies can get a bit awkward)
Additionally, depending on the degree of upstream changes taking place in these libraries, if changes are significant and can't be trivially reconciled in TypeMap via version ranges, I would be happy to omit TypeMap from these tests to allow the new versions through (with particular note to the upcoming Zod 4).
Submitting for consideration and review.
Testing
Tested via
Checklist