Skip to content
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

[✨] Valibot Adapter for Qwik #4924

Open
mees-van-wel opened this issue Aug 10, 2023 · 4 comments · May be fixed by #4998
Open

[✨] Valibot Adapter for Qwik #4924

mees-van-wel opened this issue Aug 10, 2023 · 4 comments · May be fixed by #4998
Labels
COMMUNITY: PR is welcomed We think it's a good feature to have but would love for the community to help with the PR for it TYPE: enhancement New feature or request

Comments

@mees-van-wel
Copy link
Contributor

Is your feature request related to a problem?

Valibot presents a modern approach to data validation. While it parallels Zod in functionality, Valibot stands out due to its modular design and the significant reductions in bundle size (up to 98%) it can achieve through code splitting.

Describe the solution you'd like

To better leverage Valibot's capabilities within the Qwik framework, I suggest introducing a valibot$() function. This function would integrate with routeAction$() and globalAction$(), accepting a Valibot schema as its parameter.

Describe alternatives you've considered

While there are other validation libraries available, Valibot's bundle size advantage makes it an attractive choice for performance-focused applications. The direct integration of Zod was an initial consideration given its similarities, but the potential bundle size savings with Valibot make it a compelling option to explore further.

Additional context

No response

@mees-van-wel mees-van-wel added TYPE: enhancement New feature or request STATUS-1: needs triage New issue which needs to be triaged labels Aug 10, 2023
@hamatoyogi hamatoyogi added COMMUNITY: PR is welcomed We think it's a good feature to have but would love for the community to help with the PR for it and removed STATUS-1: needs triage New issue which needs to be triaged labels Aug 13, 2023
@brandonpittman
Copy link
Contributor

Here's the current Zod implementation. Wonder if just swapping out the Zod bits for Valibot would suffice?

https://github.com/BuilderIO/qwik/blob/a6d6532bdc96b3b9b1f9689279c71c7f9cf90ca8/packages/qwik-city/runtime/src/server-functions.ts#L236-L281

@zanettin
Copy link
Collaborator

pinging @fabian-hiller 😎 hope you can help on this?

@fabian-hiller
Copy link
Contributor

In some API file a release tag must be set. I think you @zanettin can help better with this.

@brandonpittman feel free to show me your code, I'll give you feedback and help you add the adapter to Qwik. Miško had already asked me to add it to Qwik Laps. However, I had not yet found the time to do so.

@brandonpittman
Copy link
Contributor

In some API file a release tag must be set. I think you @zanettin can help better with this.

@brandonpittman feel free to show me your code, I'll give you feedback and help you add the adapter to Qwik. Miško had already asked me to add it to Qwik Laps. However, I had not yet found the time to do so.

I'll get back to you tomorrow. Having trouble with TypeScript types.

@brandonpittman brandonpittman linked a pull request Aug 24, 2023 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMMUNITY: PR is welcomed We think it's a good feature to have but would love for the community to help with the PR for it TYPE: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants