Skip to content
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

formdata shim #7

Closed
jimmywarting opened this issue Jul 18, 2021 · 8 comments
Closed

formdata shim #7

jimmywarting opened this issue Jul 18, 2021 · 8 comments

Comments

@jimmywarting
Copy link

recommend formdata-polyfill

@trgwii
Copy link
Contributor

trgwii commented Aug 6, 2021

Unfortunately we can't use this library yet since it only exposes ESM, and we're currently building to CommonJS.

@trgwii trgwii closed this as completed Aug 6, 2021
@jimmywarting
Copy link
Author

fyi, node-fetch v3 is going to be released soon and it will become a esm only package

@trgwii
Copy link
Contributor

trgwii commented Aug 6, 2021

Oh damn, we'll probably have to convert eventually, but we need to take it slow to ensure minimal breakage, so we can't really just switch on a whim.

@wojpawlik
Copy link
Contributor

form-data is problematic. After fetch-blob doesn't take 8 MB to install, I'd switch to tiny https://npm.im/formdata-polyfill if we switch to ESM, or small https://npm.im/formdata-node if we don't.

@wojpawlik wojpawlik reopened this Aug 9, 2021
@wojpawlik
Copy link
Contributor

It'd be nice if formdata-polyfill provided a .d.ts file for typings @jimmywarting

@jimmywarting
Copy link
Author

Most of the size comes from fetch-blob depending on web stream polyfills.
formdata-node also depends on fetch-blob

@MattiasBuelens is working on reducing the size here: MattiasBuelens/web-streams-polyfill#83

jimmywarting added a commit to jimmywarting/FormData that referenced this issue Aug 10, 2021
@jimmywarting
Copy link
Author

@wojpawlik JSDoc can provide same level of typing support as d.ts
So I borrowed the typing from DOM lib instead of writing my own set, cuz it's fully spec compatible (appart from the constructor)

image

fixed in: jimmywarting/FormData@5d7dff9

@wojpawlik
Copy link
Contributor

Fixed in d401de9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants