Closed juliusmarminge closed 2 weeks ago
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 5, 2024 2:26pm |
Latest commit: 7efc672e1871cf31dfb8ac618c06d427fcf94247
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 pull request introduces a new route, withTransformedInput
, to the router
object, which processes an input object with a bar
property, transforming it from a number to a string using the zod
library for validation. Additionally, significant modifications are made to the AnyParams
interface and related types, enhancing type safety and clarity in the upload functionality. The changes also include updates to test cases to validate the new route and ensure correct type inference.
File Path | Change Summary |
---|---|
packages/react/test/client-generator.test.ts |
Added new route withTransformedInput for input transformation and updated test cases for validation. |
packages/uploadthing/src/internal/types.ts |
Modified AnyParams interface: _input changed to an object with in and out properties; updated related methods. |
packages/uploadthing/src/internal/upload-builder.ts |
Updated _input type in internalCreateBuilder and createBuilder to an object with in and out properties. |
.changeset/large-flowers-allow.md |
Added patch to enhance "uploadthing" functionality to support input transformers. |
Objective | Addressed | Explanation |
---|---|---|
Fix input type inference for zod transforms (#1040) | ✅ |
getTypeFromFileName
function, relevant to input handling and type validation processes, similar to the new route withTransformedInput
.uploadthing/client
In the realm of code, a new route does bloom,
withTransformedInput
dispels the gloom.
From number to string, the data does flow,
With zod's gentle touch, watch the types grow!
Tests now confirm all's well in the land,
A hop and a skip, we code hand in hand! 🐰✨
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?
Bundle | Size (gzip) | Visualization |
---|---|---|
Main | 27.50KB | See Treemap 📊 |
PR (6d78b570c8861c275929f39fe575572e00f782c9) | 27.50KB | See Treemap 📊 |
Diff | No change |
- [@example/minimal-astro-react](https://pkg.pr.new/template/f9eec76f-f27f-460e-8c14-9c19cbf21c4f) - [@example/minimal-appdir](https://pkg.pr.new/template/9fa1d116-9d1f-4474-8915-b112961d3ef3) - [@example/minimal-expo](https://pkg.pr.new/template/556c8e71-880d-415c-9717-13d293ad013c) - [@example/minimal-nuxt](https://pkg.pr.new/template/1f9ab2bb-0cee-4d02-a14e-cf51003a3512) - [@example/minimal-pagedir](https://pkg.pr.new/template/6b598b56-27fc-480c-b3f8-a2552ec8aac8) - [@example/minimal-solidstart](https://pkg.pr.new/template/d9a321db-6c30-4d4a-8360-8a63ef69bd8d) - [@example/minimal-sveltekit](https://pkg.pr.new/template/6ef6f7bf-fc04-4ae2-a8f4-2d8cace2ff3d) - [@example/minimal-tanstack-start](https://pkg.pr.new/template/f00aa497-821e-4b5c-80d8-6c35eec000a9)
pnpm add https://pkg.pr.new/pingdotgg/uploadthing/@uploadthing/react@1043
pnpm add https://pkg.pr.new/pingdotgg/uploadthing@1043
commit: 7efc672
Closes #1040
Summary by CodeRabbit
New Features
withTransformedInput
for improved input handling and validation.Type Enhancements
AnyParams
interface to better manage input and output types, enhancing type safety.UploadBuilder
type to reflect a structured approach to input handling.Tests