diff --git a/.changeset/great-fans-play.md b/.changeset/great-fans-play.md deleted file mode 100644 index 82ca7d4c7..000000000 --- a/.changeset/great-fans-play.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -"@vercel/blob": patch -"vercel-storage-integration-test-suite": patch ---- - -feat(blob): allow folder creation - -This allows the creation of empty folders in the blob store. Before this change the SDK would always require a body, which is prohibited by the API. -Now the the SDK validates if the operation is a folder creation by checking if the pathname ends with a trailling slash. - -```ts -const blob = await vercelBlob.put('folder/', { - access: 'public', - addRandomSuffix: false, -}); -``` diff --git a/.changeset/six-melons-doubt.md b/.changeset/six-melons-doubt.md deleted file mode 100644 index 891d61ac1..000000000 --- a/.changeset/six-melons-doubt.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -"@vercel/blob": minor -"vercel-storage-integration-test-suite": patch ---- - -feat(blob): Add multipart option to reliably upload medium and large files - -It turns out, uploading large files using Vercel Blob has been a struggle for users. -Before this change, file uploads were limited to around 200MB for technical reasons. -Before this change, even uploading a file of 100MB could fail for various reasons (network being one of them). - -To solve this for good, we're introducting a new option to `put` and `upload` calls: `multipart: true`. This new option will make sure your file is uploaded parts by parts to Vercel Blob, and when some parts are failing, we will retry them. This option is available for server and client uploads. - -Usage: -```ts -const blob = await put('file.png', file, { - access: 'public', - multipart: true // `false` by default -}); - -// and: -const blob = await upload('file.png', file, { - access: 'public', - handleUploadUrl: '/api/upload', - multipart: true -}); -``` - -If your `file` is a Node.js stream or a [ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) then we will gradually read and upload it without blowing out your server or browser memory. - -More examples: - -```ts -import { createReadStream } from 'node:fs'; - -const blob = await vercelBlob.put( - 'elon.mp4', - // this works 👍, it will gradually read the file from the system and upload it - createReadStream('/users/Elon/me.mp4'), - { access: 'public', multipart: true } -); -``` - -```ts -const response = await fetch( - 'https://example-files.online-convert.com/video/mp4/example_big.mp4', -); - -const blob = await vercelBlob.put( - 'example_big.mp4', - // this works too 👍, it will gradually read the file from internet and upload it - response.body, - { access: 'public', multipart: true }, -); -``` diff --git a/packages/blob/CHANGELOG.md b/packages/blob/CHANGELOG.md index a4fc7b1f7..344869318 100644 --- a/packages/blob/CHANGELOG.md +++ b/packages/blob/CHANGELOG.md @@ -1,5 +1,75 @@ # @vercel/blob +## 0.17.0 + +### Minor Changes + +- 898c14a: feat(blob): Add multipart option to reliably upload medium and large files + + It turns out, uploading large files using Vercel Blob has been a struggle for users. + Before this change, file uploads were limited to around 200MB for technical reasons. + Before this change, even uploading a file of 100MB could fail for various reasons (network being one of them). + + To solve this for good, we're introducting a new option to `put` and `upload` calls: `multipart: true`. This new option will make sure your file is uploaded parts by parts to Vercel Blob, and when some parts are failing, we will retry them. This option is available for server and client uploads. + + Usage: + + ```ts + const blob = await put('file.png', file, { + access: 'public', + multipart: true, // `false` by default + }); + + // and: + const blob = await upload('file.png', file, { + access: 'public', + handleUploadUrl: '/api/upload', + multipart: true, + }); + ``` + + If your `file` is a Node.js stream or a [ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) then we will gradually read and upload it without blowing out your server or browser memory. + + More examples: + + ```ts + import { createReadStream } from 'node:fs'; + + const blob = await vercelBlob.put( + 'elon.mp4', + // this works 👍, it will gradually read the file from the system and upload it + createReadStream('/users/Elon/me.mp4'), + { access: 'public', multipart: true }, + ); + ``` + + ```ts + const response = await fetch( + 'https://example-files.online-convert.com/video/mp4/example_big.mp4', + ); + + const blob = await vercelBlob.put( + 'example_big.mp4', + // this works too 👍, it will gradually read the file from internet and upload it + response.body, + { access: 'public', multipart: true }, + ); + ``` + +### Patch Changes + +- fd1781f: feat(blob): allow folder creation + + This allows the creation of empty folders in the blob store. Before this change the SDK would always require a body, which is prohibited by the API. + Now the the SDK validates if the operation is a folder creation by checking if the pathname ends with a trailling slash. + + ```ts + const blob = await vercelBlob.put('folder/', { + access: 'public', + addRandomSuffix: false, + }); + ``` + ## 0.16.1 ### Patch Changes diff --git a/packages/blob/package.json b/packages/blob/package.json index 63fd8d6da..240d506f4 100644 --- a/packages/blob/package.json +++ b/packages/blob/package.json @@ -1,6 +1,6 @@ { "name": "@vercel/blob", - "version": "0.16.1", + "version": "0.17.0", "description": "The Vercel Blob JavaScript API client", "homepage": "https://vercel.com/storage/blob", "repository": { diff --git a/test/next/CHANGELOG.md b/test/next/CHANGELOG.md index 15951b066..10789d72d 100644 --- a/test/next/CHANGELOG.md +++ b/test/next/CHANGELOG.md @@ -1,5 +1,77 @@ # vercel-storage-integration-test-suite +## 0.1.37 + +### Patch Changes + +- fd1781f: feat(blob): allow folder creation + + This allows the creation of empty folders in the blob store. Before this change the SDK would always require a body, which is prohibited by the API. + Now the the SDK validates if the operation is a folder creation by checking if the pathname ends with a trailling slash. + + ```ts + const blob = await vercelBlob.put('folder/', { + access: 'public', + addRandomSuffix: false, + }); + ``` + +- 898c14a: feat(blob): Add multipart option to reliably upload medium and large files + + It turns out, uploading large files using Vercel Blob has been a struggle for users. + Before this change, file uploads were limited to around 200MB for technical reasons. + Before this change, even uploading a file of 100MB could fail for various reasons (network being one of them). + + To solve this for good, we're introducting a new option to `put` and `upload` calls: `multipart: true`. This new option will make sure your file is uploaded parts by parts to Vercel Blob, and when some parts are failing, we will retry them. This option is available for server and client uploads. + + Usage: + + ```ts + const blob = await put('file.png', file, { + access: 'public', + multipart: true, // `false` by default + }); + + // and: + const blob = await upload('file.png', file, { + access: 'public', + handleUploadUrl: '/api/upload', + multipart: true, + }); + ``` + + If your `file` is a Node.js stream or a [ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) then we will gradually read and upload it without blowing out your server or browser memory. + + More examples: + + ```ts + import { createReadStream } from 'node:fs'; + + const blob = await vercelBlob.put( + 'elon.mp4', + // this works 👍, it will gradually read the file from the system and upload it + createReadStream('/users/Elon/me.mp4'), + { access: 'public', multipart: true }, + ); + ``` + + ```ts + const response = await fetch( + 'https://example-files.online-convert.com/video/mp4/example_big.mp4', + ); + + const blob = await vercelBlob.put( + 'example_big.mp4', + // this works too 👍, it will gradually read the file from internet and upload it + response.body, + { access: 'public', multipart: true }, + ); + ``` + +- Updated dependencies [fd1781f] +- Updated dependencies [898c14a] + - @vercel/blob@0.17.0 + ## 0.1.36 ### Patch Changes diff --git a/test/next/package.json b/test/next/package.json index 27ee5115d..83053594b 100644 --- a/test/next/package.json +++ b/test/next/package.json @@ -1,6 +1,6 @@ { "name": "vercel-storage-integration-test-suite", - "version": "0.1.36", + "version": "0.1.37", "private": true, "scripts": { "build": "next build",