-
Notifications
You must be signed in to change notification settings - Fork 388
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
[Feature?]: Custom Seroval plugins #1474
Comments
I took some time to find the code where the seroval plugins are specified and found that in the From
|
I haven't really given a response here since the discussion for this remained with Ryan but user-based plugins is definitely in heavy consideration, it wasn't just considered back then because of potential security risks. No worries though, we will revisit this in the future. |
Hello! Checking back in on this thread now that v1.1.0 is out. I'm interested in adding a few server function/Seroval customization options, would a PR be considered at the point? |
Hey @agoldstein03 !! About extending Seroval, I'll let @lxsmnsyc reply, but I imagine he'll need to know what kind of customization you're planning to add. But I can say we'd be appreciative of any contribution that address a general use-case or improves the DX. |
Figured I would bump this thread, as I'm reaching a similar need/use-case where I would like to define some schema/structure to the objects that I return (and serialize) from server functions. For how I'd theoretically use this, I would probably see it being defined in the Solid config in the Vite plugin. I'm not sure of a better way to inject these, but I could see a config option for optional extensions to seroval being used there. I can foresee this being a little tricky to get passed to seroval, but I think it would be useful for devs to drop in some kind of common format into it and let seroval automatically pick up how to parse all your schemas. Right now I have a lot of APIs I'm trying to use in solid, and end up having to structured clone the objects they return so that I can properly serialize them. Does seroval expose these in a simple format? I'm interested in how we can get Solid to properly inject plugins like these so that there is a common path for class serialization |
Not an effective place since Vite is a bundler runtime, not the app runtime, where the serialization happens. We'll most likely introduce a place to set this up.
Not really, but it's going to be exposed in Solid. We are also planning to renovate the whole serialization stuff so it is in sync with Solid (currently it isn't) |
Possible plugin feature request: can Seroval eventually support serverside validation (using Standard Schema)? Related. |
@AlexErrant it's not seroval that handles server-side validation though. |
Duplicates
Latest version
Summary 💡
It would be useful to be able to define a list of your own plugins used by Seroval, as far as I know, this is the only way to properly parse custom classes.
Examples 🌈
No response
Motivation 🔦
I'm struggling with trying to return the ObjectId (used in MongoDb) from a server function, instance cannot be parsed by Seroval.
The text was updated successfully, but these errors were encountered: