Skip to content

Conversation

@char0n
Copy link
Contributor

@char0n char0n commented Aug 20, 2021

Closes #2193

@char0n char0n added version: 3.x dependencies Pull requests that update a dependency file labels Aug 20, 2021
@char0n char0n self-assigned this Aug 20, 2021
@octet-stream
Copy link

octet-stream commented Aug 20, 2021

What is confusing about release notes?

@octet-stream
Copy link

I don't think this will work:

expect(await itemEntries[0].text()).toEqual(file1.toString());
expect(await itemEntries[1].text()).toEqual(file2.toString());

Probably replace

-expect(await itemEntries[0].text()).toEqual(file1.toString());
+expect(await itemEntries[0].text()).toEqual(await file1.text());
-expect(await itemEntries[1].text()).toEqual(file2.toString());
+expect(await itemEntries[1].text()).toEqual(await file2.text());

@char0n
Copy link
Contributor Author

char0n commented Aug 20, 2021

I don't think this will work:

expect(await itemEntries[0].text()).toEqual(file1.toString());
expect(await itemEntries[1].text()).toEqual(file2.toString());

Probably replace

-expect(await itemEntries[0].text()).toEqual(file1.toString());
+expect(await itemEntries[0].text()).toEqual(await file1.text());
-expect(await itemEntries[1].text()).toEqual(file2.toString());
+expect(await itemEntries[1].text()).toEqual(await file2.text());

Yeah, this change + other things.

Anyway this technically introduces breaking change for us. We need to find a way how to still support Buffer instances transparently and transform them into Blob types under the hood.

@char0n
Copy link
Contributor Author

char0n commented Aug 20, 2021

What is confusing about release notes?

Remove builtin multipart/form-data encoder and all related methods - did not understood what it really means, but I guess it was because I haven't use it due to the fact we use form-data-encoder

Remove support for Buffer and ReadStream (the one you might create with fs.createReadStream), you can use Blob, fileFromPath and fileFromPathSync to replace them. - I see the word Buffer here, but didn't really know where to start. Needed to inspect commits to understand that it means...eventually I found out: Buffer is not supported as a value of FormData

@char0n
Copy link
Contributor Author

char0n commented Aug 20, 2021

Thanks for heads up and comments, it helped me to process this more quickly!

Backward compatibility when using Buffers is still guaranteed.

@octet-stream
Copy link

Remove builtin multipart/form-data encoder and all related methods - did not understood what it really means, but I guess it was because I haven't use it due to the fact we use form-data-encoder

Because form-data serialization is not the part of the FormData class, this change was made. Basically builtin encoder was separated to another package - form-data-encoder, so any HTTP client can use it or use it as a reference for their own implementation.

I see the word Buffer here, but didn't really know where to start.

Because FormData takes only string, Blob and File as entry's value - I had to remove it. Previously Buffer was converted to File internally, because it basically Uint8Array and Blob accepts it as one of blobParts.

@char0n char0n force-pushed the char0n/formdata-v4 branch from ed6741a to a1eb63e Compare August 20, 2021 13:00
@char0n char0n merged commit 3da4ae8 into master Aug 20, 2021
swagger-bot pushed a commit that referenced this pull request Aug 20, 2021
# [3.16.0](v3.15.0...v3.16.0) (2021-08-20)

### Features

* **deps:** bump formdata-node from 3.7.0 to 4.0.0 ([#2196](#2196)) ([3da4ae8](3da4ae8))
@swagger-bot
Copy link
Contributor

🎉 This PR is included in version 3.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@char0n char0n deleted the char0n/formdata-v4 branch September 13, 2021 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file released version: 3.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants