-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: add Valibot support with valibot$
to qwik-city
#4998
base: main
Are you sure you want to change the base?
Conversation
Run & review this pull request in StackBlitz Codeflow. |
✅ Deploy Preview for qwik-insights canceled.
|
Thanks for your nice PR, can you add the documentation for this please? |
Sure. Not done, yet. Will update docs tomorrow! Just wanted to share what I had so far. @fabian-hiller Is there a way with Valibot to check if a value is an ObjectSchema at runtime? |
@brandonpittman yes, this should work via the And via |
Note that you must also include |
It's not clear if we need async support. I've updated my PR with working code that satisfies TypeScript. I've removed any async types though. Can you take a look, please? |
Since the validation is done in an async function, we could enable async validation with |
If you want to add async support, you need to replace |
Okay. Will update it. Thanks. |
You must not remove |
Should I use Do I need to do something like |
Thanks for working on this! ❤️ |
I think I would write
This is not required. |
I will also be reviewing the code thoroughly over the weekend. This issue has the highest priority now. I would like to have it merged before my next big annoucnment next week or the week after. |
|
I will have a look, sorry it is taking me so long to get to this... |
I won't get to my review until next weekend. Last weekend I did not find time for it. 😕 |
Thank you for the hint. I will add such a type to Valibot too. |
@brandonpittman do you prefer that I edit the PR directly (if I get permission to do so) or add comments to your code via GitHub review instead? |
@fabian-hiller Please edit the PR. |
The next version of Valibot will bring improved types for |
Valibot v0.18.0 is now available. You can type |
|
GitGuardian id | Secret | Commit | Filename | |
---|---|---|---|---|
- | Generic High Entropy Secret | bfb1d8a | packages/docs/src/routes/demo/cookbook/mediaController/index.tsx | View secret |
- | Generic High Entropy Secret | bfb1d8a | packages/docs/src/routes/demo/cookbook/mediaController/index.tsx | View secret |
- | Generic High Entropy Secret | bfb1d8a | packages/docs/src/routes/demo/cookbook/mediaController/index.tsx | View secret |
- | Generic High Entropy Secret | bfb1d8a | packages/docs/src/routes/demo/cookbook/mediaController/index.tsx | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
So I tried to build it locally but the demo files are failing to build. Something is off from your types... Not sure how you are building it but here is my process
What kind of help do you need from me to move this forward? |
I'll probably finally get around to thoroughly reviewing this PR this weekend. I will then commit directly to the PR and make improvements. I hope that this is possible without special permissions, since I am not an official maintainer of the Qwik repo. |
@brandonpittman a update for you. I have not forgotten about this PR and will finish it as soon as possible. We are currently working on a major structural change to Valibot. As soon as this is done, I will working on this PR. |
So the current state is that @fabian-hiller will make changes when he finds the time, right? |
Yes, this is the current state. But everyone is welcome to continue working on it before I find the time. In about 3 weeks I will be able to fully focus on my open source work again and will probably finish the PR before Christmas. |
I plan to work on and finalize this PR by the end of next week. |
I am very sorry that this is taking so long. I expect to finalize this PR next week. |
Thanks @fabian-hiller ! can't wait! |
Other things came up that I wanted to preordain. This PR is on my list for the next two weeks. |
There is a Valibot PR I want to review and maybe merge before I finish this implementation because some types may change. I will give an update here in a few days. |
Sorry to push this implementation back again. You may have seen this discussion on Twitter or GitHub. I plan to work on this first, as some types may change. |
Short update: I am basically rewriting Valibot at the moment. I am trying to improve the API design, performance, bundle size and types, but this will take some time. I also have to rewrite the documentation. I don't want to make any more promises about the timing of this PR. As soon as I feel ready, I will finish the implementation. |
The funny thing is: the implementation works. It’s just the types I wanted help with. I didn’t understand the types the original implementation had—because they assumed Zod was being used. |
I expect a lot of breaking changes for the next release. So even though the implementation of this PR is almost done, it might make sense to wait to not confuse people. |
@fabian-hiller Can you tell me what is going to change with Valibot that might affect this? The feature worked, it’s just the types that didn’t work. I’m gonna take a stab at fixing the types again. (Making the action types less Zod-specific in another PR first might be better though.) |
@brandonpittman I spoke with him recently, there's a lot of changes to the API coming, as I understand it. So that zod decoupling first send like a good idea |
The API will be mostly the same (except for the new |
Overview
Adds Valibot support with a
valibot$
function similarly to how Zod is supported byzod$
.Fixes #4924
What is it?
Description
Requires:
valibot
Use cases and why
So you can use Valibot to validate your actions
Checklist: