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
feat: support formdata in fetch adapter #5649
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @juliusmarminge and the rest of your teammates on Graphite |
Diagnostics ComparisonNumbers
Timings and averages
unstable timingsUnstable
|
4b77a70
to
07f219a
Compare
examples/bun/src/client.ts
Outdated
const form = new FormData(); | ||
form.append('foo', 'bar'); | ||
const postFormData = await proxy.formData.mutate(form); | ||
console.log('formData reponse', postFormData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.input(z.instanceof(FormData)) | ||
.mutation(({ input }) => { | ||
const object = {} as Record<string, unknown>; | ||
input.forEach((value, key) => (object[key] = value)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can do some Object.fromEntries
-thing here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a copy-pasta from Nicks vanilla router
@@ -244,6 +256,26 @@ describe('with default server', () => { | |||
|
|||
await client.foo.query(); | |||
}); | |||
|
|||
// Miniflare seems broken. Working test in examples/bun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate on this comment a bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test failed when it shouldn't
This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you. |
Ref #5648
🎯 Changes
What changes are made in this PR? Is it a feature or a bug fix?
FormData
support in fetch adapterRequest
generic since most frameworks has their own extended type that sets some extra properties on top of the standard✅ Checklist