Closed juliusmarminge closed 1 month ago
Latest commit: 662ab9902de3c9baabe8b729c95f9673861ae02a
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 | Oct 7, 2024 8:57pm |
[!WARNING]
Rate limit exceeded
@juliusmarminge has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 23 minutes and 23 seconds before requesting another review.
β How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.π¦ How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://coderabbit.ai/docs/faq) for further information.π₯ Commits
Files that changed from the base of the PR and between 77c86b2bc45a75eb74eb4145216bfa7aaaf4d096 and 662ab9902de3c9baabe8b729c95f9673861ae02a.
The changes introduce a new function, getDefaultRouteConfigValues
, which centralizes default configuration values for file types. The fillInputRouteConfig
function is updated to use this new function, reducing redundancy. Additionally, the getTypeFromFileName
function is enhanced to accept an optional fallbackType
parameter. The assertFilesMeetConfig
function is modified to improve file type and size validation, enhancing accuracy in type resolution and error handling.
Files | Change Summary |
---|---|
packages/shared/src/utils.ts | Added getDefaultRouteConfigValues(type: FileRouterInputKey) method. Updated getTypeFromFileName to accept an optional fallbackType parameter. |
packages/uploadthing/src/internal/... | Modified assertFilesMeetConfig to include file.type in getTypeFromFileName calls. Enhanced file size validation logic and error handling for mismatches. |
examples/minimal-appdir/src/server/... | Added maxFileCount: 10 to the blob configuration in uploadRouter . |
packages/uploadthing/src/client.ts | Updated isValidFileType and isValidFileSize functions to include file.type in their signatures. Refined upload handling logic in genUploader . |
packages/uploadthing/src/internal/... | Updated handleUploadAction to include file.type in getTypeFromFileName calls. Enhanced error handling and logging throughout the upload process. |
getTypeFromFileName
function to include a file.type
parameter, which directly relates to the modifications made in the main PR where the getTypeFromFileName
function was updated to accept an optional fallbackType
parameter.withUt
function to improve module resolution, which indirectly relates to the overall functionality of file handling and routing, similar to the changes made in the main PR regarding file type configurations.OurFileRouter
type to UploadRouter
, which aligns with the changes in the main PR that focus on enhancing the structure and maintainability of file handling functions.π documentation
, @uploadthing/react
In the code where rabbits hop,
New functions bloom, and changes crop.
Default values, neat and bright,
Help our files take flight!
With types and sizes all in line,
Happy coding, oh how fine! πβ¨
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 | 26.03KB | See Treemap π |
PR (01d6ce0fe34b5f53af41f79cf541cb1d318eadfa) | 26.03KB | See Treemap π |
Diff | No change |
- [@example/minimal-astro-react](https://pkg.pr.new/template/76544b06-7ac9-4f54-bf92-8a61ea98967f) - [@example/minimal-appdir](https://pkg.pr.new/template/e195ad62-daf7-4543-a83c-b173479e6854) - [@example/minimal-nuxt](https://pkg.pr.new/template/2aa57bf3-dc03-4090-b36b-99637174e0de) - [@example/minimal-expo](https://pkg.pr.new/template/34a396f8-4432-45e9-b7b1-9093d1e54d6e) - [@example/minimal-pagedir](https://pkg.pr.new/template/2f95cedd-6d0e-4244-b663-50302c9be5ee) - [@example/minimal-solidstart](https://pkg.pr.new/template/9b9d9328-5c69-4858-93be-e26db1068231) - [@example/minimal-sveltekit](https://pkg.pr.new/template/244b21d1-dece-4bff-ac11-3f9d4be1a100) - [@example/minimal-tanstack-start](https://pkg.pr.new/template/057a8ccd-2978-4319-a6f3-63f0e24f681b)
pnpm add https://pkg.pr.new/pingdotgg/uploadthing/@uploadthing/nuxt@991
pnpm add https://pkg.pr.new/pingdotgg/uploadthing/@uploadthing/shared@991
pnpm add https://pkg.pr.new/pingdotgg/uploadthing@991
commit: 662ab99
Prefer
file.type
when matching route config type. Fallback to lookup based on extensionFile { name: 'foo.png', type: 'image/png' } => image/png
File { name: 'foo', type: 'image/png' } => image/png
File { name: 'foo.jpg', type: 'image/png' } => image/png
File { name: 'foo.jpg', type: '' } => image/jpg
x-ref: https://discord.com/channels/966627436387266600/1102510616326967306/1289998476721262623
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes