-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
refactor: use zod in builders #10117
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10117 +/- ##
===========================================
+ Coverage 35.45% 49.12% +13.66%
===========================================
Files 228 93 -135
Lines 14319 10339 -3980
Branches 1254 692 -562
===========================================
+ Hits 5077 5079 +2
+ Misses 9198 5257 -3941
+ Partials 44 3 -41
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Also, this needs a rebase
Builders used to use Zod but there were many many complaints about it. That was after /builders initially used the I can reason this is related to confusing errors (the actual linked issue is a duplicate). I very strongly recommend you instead contribute to Shapeshift by fulfilling this issue for which most work is already finished in this pr and only unit tests need to be updated. Once that issue is resolved custom messages can be assigned in /builders and get very clear errors. Also relevant: |
This has all already been discussed in internals, albeit rather scattered, see: there's probably more if you search for "shapeshift". |
Copying my message from Discord to here after reading that conversation:
Adding to it, technically I could finish that PR in a couple of days if I really sit down and just finish it. I've just been lacking the motivation to do so. Once it's finished though, adding custom messages is a singe. |
Dumping a comment on here as well as follow-up to my reply above, the shapeshfit version with custom messages has been released. We can review where we want to take this PR further now. |
15460ea
to
6b43f5b
Compare
I'm personally of the opinion that we should go further with zod after all. I understand that an effort was made for that shapeshift release, but it's too little too late, on top of other accumulating issues. I know we keep on going back and forth on this, but the argument of "just wait until zod has an issue and we decide to switch back" really falls apart considering zod is a massive project that iterates quicker than shapeshift ever could - on top of, at least at this time, to my knowledge, having no big issues for us, while shapeshift has been problematic in various ways since the moment we introduced it. |
Superseded by #10448 |
Please describe the changes this PR makes and why it should be merged:
Replaces
shapeshift
withzod
andzod-validation-error
in@discordjs/builders
.Status and versioning classification: