-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Support new Valibot piping? #432
Comments
Don't think so (using |
I installed it and ran the tests. It'll be quite a bit of work to make the tests pass, and probably a bit in https://github.com/gcornut/valibot-json-schema as well (the JSON Schema generator). Even more if we want to keep backwards compatibility. |
I think since it's a library not even in 1.0, there is no need to keep backwards compatibility, imo |
I am happy to help with any questions. |
Updated to v0.31 and seems to be working fine with v2.15.0, can anyone confirm? |
Everything (types, logic, etc.) seems to be working as expected in my app. |
I am getting an error, and some type errors, but this could be because I am using the Drizzle to Valibot adapter which has yet to be updated. Although one error I am getting is...
which seems to be coming from: @gcornut+valibot-json-schema |
The creator of valibot, Fabian, is working with the Drizzle team to update it. I'd wait for that before migrating. https://discord.com/channels/1043890932593987624/1083702388021538816/1247145749817593917 |
Here is the Drizzle PR: drizzle-team/drizzle-orm#2481 |
Awesome!! |
@saturnonearth You may have to configure the adapter with |
unknow() does not work . I get the error
using latest schema definition for example
used to before the upgrade . I see the error may be coming from valibot-json-schema , i guess the flag ignoreUnknownValidation needs to be set somewhere ? |
Update: This has been replaced (in valibot ) with the union and transform type , so as not to convert unknown to a defined type |
Now getting Multi-type unions must have a default value, or exactly one of the union types must have. |
I am not sure what you mean - as I haven't set anything up with |
@fabian-hiller It looks like something in Valibot between 0.32.0 (working) and 0.33.3 (not working) broke it again. It seems like the It works again if I downgrade Valibot to 0.32.0 When I pass this schema to export const newCharacterSchema = v.object({
name: requiredString,
campaign: v.optional(v.pipe(v.string(), maxStringSize), ""),
race: v.optional(v.pipe(v.string(), maxStringSize), ""),
class: v.optional(v.pipe(v.string(), maxStringSize), ""),
characterSheetUrl: optionalURL,
imageUrl: optionalURL
}); Like this: const form = await superValidate(
parent.character
? {
name: parent.character.name,
campaign: parent.character.campaign || "",
race: parent.character.race || "",
class: parent.character.class || "",
characterSheetUrl: parent.character.characterSheetUrl || "",
imageUrl: parent.character.imageUrl.replace(BLANK_CHARACTER, "")
}
: undefined,
valibot(newCharacterSchema),
{
errors: false
}
); I get this error:
Where The above type is compatible with the |
This is strange because I haven't made any changes to Link: https://github.com/fabian-hiller/valibot/commits/main/library/src/types/schema.ts |
Here's a MRE of the issue And here's the MRE where it's working with Valibot 0.32.0 The version of Superforms is unchanged between these MREs. |
I think I know what the problem is. I have changed some types that are part of the |
See if it works now with 2.15.2 |
Resolved |
Valibot just released the first RC (https://github.com/fabian-hiller/valibot/releases/tag/v0.31.0-rc.0) for their new piping functionality - is this compatible with Superforms?
The text was updated successfully, but these errors were encountered: