Integrate with Remix multipart form parser #1032
Replies: 1 comment 4 replies
-
Thanks for the detailed write up. Validating forms with file uploads has been on my list to explore for a while. I don't consider field names opaque. Our APIs infer names mainly for convenience and type safety, but the patterns are documented and it's totally fine to specify names manually. I can see the value of a The implementation of What do you think? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm looking at how to seamlessly integrate Conform + Zod with the Remix streaming
multipart/form-data
parser.https://reactrouter.com/how-to/file-uploads
https://www.npmjs.com/package/@remix-run/form-data-parser
I think these are probably the trickiest bits to get right:
Upload handler
Since Conform field names are opaque (right?), I think this part would work best if Conform provided a utility to query a form schema using a field name and get back the field schema.
Maybe that utility could also know how to search a union for a file type, but I assumed for now that part would be up to me.
Progressive enhancement
I wasn't planning on figuring this part out yet, but I assume users will prefer background uploads with progress indicators.
I have no idea if this would be done using a Conform intent or something more custom.
Beta Was this translation helpful? Give feedback.
All reactions