Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge committed Feb 17, 2025
1 parent 11efabb commit ff2120b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .changeset/fair-tomatoes-jog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"@uploadthing/shared": patch
---

feat: add `progressGranularity` option to control how granular progress events
feat: add `uploadProgressGranularity` option to control how granular progress events
are fired at

You can now set `progressGranularity` to `all`, `fine`, or `coarse` to control
You can now set `uploadProgressGranularity` to `all`, `fine`, or `coarse` to control
how granular progress events are fired at.

- `all` will forward every event from the XHR upload
Expand Down
6 changes: 3 additions & 3 deletions docs/src/app/(docs)/api-reference/react/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export const OurUploadButton = () => (
<Property name="onUploadAborted" type="function" since="6.7">
Callback function when that runs when an upload is aborted.
</Property>
<Property name="progressGranularity" type="'all' | 'fine' | 'coarse'" since="7.3" defaultValue="coarse">
<Property name="uploadProgressGranularity" type="'all' | 'fine' | 'coarse'" since="7.3" defaultValue="coarse">
The granularity of which progress events are fired. 'all' forwards every progress event, 'fine' forwards events for every 1% of progress, 'coarse' forwards events for every 10% of progress.
</Property>
<Property name="onUploadProgress" type="function" since="5.1">
Expand Down Expand Up @@ -425,7 +425,7 @@ export const OurUploadDropzone = () => (
<Property name="onUploadAborted" type="function" since="6.7">
Callback function when that runs when an upload is aborted.
</Property>
<Property name="progressGranularity" type="'all' | 'fine' | 'coarse'" since="7.3" defaultValue="coarse">
<Property name="uploadProgressGranularity" type="'all' | 'fine' | 'coarse'" since="7.3" defaultValue="coarse">
The granularity of which progress events are fired. 'all' forwards every progress event, 'fine' forwards events for every 1% of progress, 'coarse' forwards events for every 10% of progress.
</Property>
<Property name="onUploadProgress" type="function" since="5.1">
Expand Down Expand Up @@ -558,7 +558,7 @@ using a string literal parameter.
<Property name="onUploadAborted" type="function" since="6.7">
Callback function when that runs when an upload is aborted.
</Property>
<Property name="progressGranularity" type="'all' | 'fine' | 'coarse'" since="7.3" defaultValue="coarse">
<Property name="uploadProgressGranularity" type="'all' | 'fine' | 'coarse'" since="7.3" defaultValue="coarse">
The granularity of which progress events are fired. 'all' forwards every progress event, 'fine' forwards events for every 1% of progress, 'coarse' forwards events for every 10% of progress.
</Property>
<Property name="onUploadProgress" type="function" since="5.1">
Expand Down
1 change: 1 addition & 0 deletions packages/svelte/src/lib/component/UploadDropzone.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
void uploader.onClientUploadComplete?.(res);
uploadProgress = 0;
},
uploadProgressGranularity: uploader.uploadProgressGranularity,
onUploadProgress: (p) => {
uploadProgress = p;
uploader.onUploadProgress?.(p);
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte/src/lib/create-uploadthing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const generateSvelteHelpers = <TRouter extends FileRouter>(

const createUploadThing = <TEndpoint extends keyof TRouter>(
endpoint: EndpointArg<TRouter, TEndpoint>,
props: UploadthingComponentProps<TRouter, TEndpoint>,
props: UseUploadthingProps<TRouter[TEndpoint]>,
) => {
return __createUploadThingInternal(url, endpoint, fetch, props);
};
Expand Down

0 comments on commit ff2120b

Please sign in to comment.