Closed shellscape closed 4 months ago
Just in case throwing in here that I like (& use) valibot a lot.
Not sure how the current TemplateStruct
works under the hood but probably a good idea to make it general so you can use whatever
That's interesting. valibot looks like an implementation copy of superstruct (which is what the TemplateStruct thing was initially about)
I haven't begun development on this yet, still thinking through implementation and if it even makes sense to have builtin support for various validation schema types. You can however, set PreviewProps
however you'd like to now, including with valibot, and that won't change.
How would I currently use valibot, isn't it running superstructs create behind the scenes or did I get your comment wrong?
1 option could be keeping the current behavior but if TemplateStruct
(maybe with a different name) is set to a function just run that with some context data so within that function people can do what they want, but would be more boilerplate and also type inference will be harder, maybe via a generic.
I'm on my phone right now 😅
Have been playing with this idea a lot and the one thing that I've been struggling with is where the value is added - there's no real advantage to having builtin support for any validator libraries. There's no real time savings for the user, and there's no real complexity savings either. If anything, it potentially makes the templates more complex.
At the moment, we're going to remove the builtin superstruct support for the next major version, and table the idea for the meantime.
As much as I loathe
zod
, this needs to be done.This is a placeholder issue for a task for jsx-email v1.6.0