feat(client): createUploadClient returns { upload, useUpload }#180
feat(client): createUploadClient returns { upload, useUpload }#180abhay-ramesh wants to merge 1 commit intobetafrom
Conversation
Instead of returning just the route proxy, createUploadClient now
returns an object you can destructure:
export const { upload, useUpload } = createUploadClient<AppRouter>({
endpoint: '/api/upload'
});
// Component — AppRouter type already baked in, no generic needed
const { uploadFiles } = useUpload('imageUpload');
// old proxy style still works too
const { uploadFiles } = upload.imageUpload();
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
createUploadClientnow returns{ upload, useUpload }instead of just the proxy, so you can define everything once and use it without repeating the router type in every component.Before
After
Test plan
useUploadroute name argument is fully type-safe (autocomplete + error on unknown routes)upload.routeName()proxy still works unchanged🤖 Generated with Claude Code