Closed juliusmarminge closed 2 weeks ago
Latest commit: 9f3d8d92c60e606c937453f41c418282852a46c3
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git βοΈ
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
docs-uploadthing | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Nov 6, 2024 9:09am |
The changes introduce a new feature that forwards the request context to the onUploadComplete
and onUploadError
callbacks, allowing access to relevant upload information. Additionally, the type MiddlewareArgs
has been renamed to AdapterArgs
across various files, reflecting a shift in the argument structure. The onUploadComplete
method's parameters have been updated to destructured parameters, improving clarity in handling metadata and file information. The modifications also refine type definitions, enhance error handling, and improve test coverage.
File | Change Summary |
---|---|
.changeset/warm-moons-count.md |
Introduced request context forwarding to onUploadComplete and onUploadError callbacks. |
examples/backend-adapters/server/src/router.ts |
Updated onUploadComplete method parameters from data to destructured { metadata, file } . |
packages/uploadthing/src/effect-platform.ts |
Updated import from MiddlewareArguments to AdapterArguments and adjusted internal logic accordingly. |
packages/uploadthing/src/express.ts |
Renamed MiddlewareArgs to AdapterArgs , updated createUploadthing function to use new type. |
packages/uploadthing/src/fastify.ts |
Renamed MiddlewareArgs to AdapterArgs , updated createUploadthing function to use new type. |
packages/uploadthing/src/h3.ts |
Renamed MiddlewareArgs to AdapterArgs , updated createUploadthing function to use new type. |
packages/uploadthing/src/internal/handler.ts |
Renamed MiddlewareArguments to AdapterArguments , updated related types and imports. |
packages/uploadthing/src/internal/types.ts |
Renamed MiddlewareFnArgs to AdapterFnArgs , updated related type references. |
packages/uploadthing/src/internal/upload-builder.ts |
Replaced TMiddlewareArgs with TAdapterFnArgs in createBuilder and internalCreateBuilder functions. |
packages/uploadthing/src/next-legacy.ts |
Renamed MiddlewareArgs to AdapterArgs , updated createUploadthing function to use new type. |
packages/uploadthing/src/next.ts |
Renamed MiddlewareArgs to AdapterArgs , updated createUploadthing function to use new type. |
packages/uploadthing/src/remix.ts |
Renamed MiddlewareArgs to AdapterArgs , updated createUploadthing function to use new type. |
packages/uploadthing/src/server.ts |
Renamed MiddlewareArgs to AdapterArgs , updated createUploadthing function to use new type. |
packages/uploadthing/test/request-handler.test.ts |
Enhanced tests for error handling, middleware functionality, input validation, and file upload logic. |
onUploadComplete
callback to return an object hash, related to changes in the main PR.onUploadComplete
callback to return an object hash, aligning with the main PR's focus.createRouteHandler
function for improved parameter handling, relating to upload callbacks.onUploadComplete
callback.effect/Redacted
for handling sensitive information, relating to the request context forwarding.sdk
In a world of uploads, swift and bright,
We forward our context, a new delight.
With metadata in hand, we log with glee,
Adapters now dance, as happy as can be!
So letβs celebrate this change, oh so grand,
A hop and a skip, in code we stand! πβ¨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
- [@example/minimal-appdir](https://pkg.pr.new/template/4fbbb089-7b42-4fd8-a45c-1634645b434a) - [@example/minimal-astro-react](https://pkg.pr.new/template/c13b003d-791c-4b82-a1d2-f246670a520c) - [@example/minimal-expo](https://pkg.pr.new/template/f8efd348-8e67-436f-a27b-556bcdaa242c) - [@example/minimal-nuxt](https://pkg.pr.new/template/1a71569f-9182-4cb3-a329-4a32bb709c51) - [@example/minimal-pagedir](https://pkg.pr.new/template/d8c58f34-2c70-42e5-9e19-41ed6d760034) - [@example/minimal-solidstart](https://pkg.pr.new/template/52d72009-3150-45b3-96e7-5d642aeb0631) - [@example/minimal-sveltekit](https://pkg.pr.new/template/9aa8629a-ee71-45ea-a4f7-f5fb7855f5a1) - [@example/minimal-tanstack-start](https://pkg.pr.new/template/88fd7bed-0cb8-453e-afed-451586bc4cbd)
pnpm add https://pkg.pr.new/pingdotgg/uploadthing@1045
commit: 9f3d8d9
Bundle | Size (gzip) | Visualization |
---|---|---|
Main | 27.51KB | See Treemap π |
PR (94c5a521683712bd43c06eab96d5493da9c28d28) | 27.51KB | See Treemap π |
Diff | No change |
currently you can only access the request in
middleware
. This adds so you can also access it inonUploadComplete
andonUploadError
. This is especially important in e.g. workers where your environment variables and bindings are on the request contextSummary by CodeRabbit
Release Notes
New Features
onUploadComplete
andonUploadError
callbacks, enhancing upload process visibility.Bug Fixes
Tests