-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Yuval Datner <[email protected]> Co-authored-by: Mark R. Florkowski <[email protected]>
- Loading branch information
1 parent
f5e080e
commit d69dd6e
Showing
326 changed files
with
32,697 additions
and
11,624 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"uploadthing": major | ||
--- | ||
|
||
refactor: reduce bundle size | ||
|
||
We've continued our efforts to reduce the bundle size of the client side javascript. In a previous minor release, we reduced the bundle size by 70%, from 120kB to 40kB. This release continues on that work with a further reduction of 35% down to just over 25kB client side | ||
javascript shipped to the browser from the `uploadthing/client` package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"uploadthing": major | ||
--- | ||
|
||
feat!: change signature of `genUploader` to return an object with 2 functions, `uploadFiles` and `createUpload` | ||
|
||
`createUpload` can be used to create a resumable upload which you can pause and resume as you wish. | ||
See example: https://github.com/pingdotgg/uploadthing/blob/v7/examples/backend-adapters/client-vanilla/src/resumable-upload.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
"uploadthing": major | ||
"@uploadthing/shared": major | ||
--- | ||
|
||
feat!: use ingest server | ||
|
||
Multi Part Uplaods hasve been abstracted away and files are now uploaded as a single stream to UploadThing, reducing the manual steps required to upload files and improves performance. | ||
|
||
Polling has been removed in favor of a streaming upload process with instant feedback |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@uploadthing/shared": major | ||
"uploadthing": major | ||
--- | ||
|
||
chore: update paths to new api domain | ||
|
||
Previously the SDK version was just sent in the header which made it cumbersome to make large changes on the API without risking breaking older versions. This change improves our flexibility to make changes to the API without needing to do a major bump on the SDK. It should come with some nice performance wins too! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
"uploadthing": major | ||
--- | ||
|
||
## 🚨 Breaking Changes | ||
|
||
### General | ||
|
||
- Change `UPLOADTHING_API_KEY` to `UPLOADTHING_TOKEN`. The token contains both your API key and some other metadata required by the SDK. You can get a token from the [UploadThing dashboard](https://uploadthing.com/dashboard). All options related to `uploadthingSecret` / `apiKey` has now been removed and replaced with `token`: | ||
|
||
```diff | ||
- createRouteHandler({ router, config: { uploadthingSecret: 'sk_123' } }) | ||
+ createRouteHandler({ router, config: { token: 'MY_TOKEN' } }) | ||
|
||
- new UTApi({ apiKey: 'sk_123' }) | ||
+ new UTApi({ token: 'MY_TOKEN' }) | ||
``` | ||
|
||
- If you relied on the `CUSTOM_INFRA_URL` environment variable override, you will have to change this to `UPLOADTHING_API_URL` or `UPLOADTHING_INGEST_URL` depending on your use case. | ||
|
||
### `uploadthing/client` | ||
|
||
- Change signature of `genUploader` to return an object instead of a single function. | ||
|
||
```diff | ||
- const uploadFiles = genUploader(opts) | ||
+ const { uploadFiles } = genUploader(opts) | ||
``` | ||
|
||
- Remove `uploadFiles.skipPolling` option in favor of a new server-side RouteOption `awaitServerData`. If you want your client callback to run as soon as the file has been uploaded, | ||
without waiting for your server side `onUploadComplete` to run, you can now set `awaitServerData` to `false`. | ||
|
||
```diff | ||
// Client option | ||
uploadFiles({ | ||
- skipPolling: true | ||
}) | ||
// Server option | ||
const router = { | ||
myRoute: f( | ||
{ ... }, | ||
+ { awaitServerData: false } | ||
) | ||
} | ||
``` | ||
|
||
Read more about the new `RouteOptions` in the [📚 Server API Reference docs](https://docs.uploadthing.com/api-reference/server#route-options) | ||
|
||
### Adapters | ||
|
||
- Change `config.logLevel` levels. Most are now capitalized to match our new logger. Auto-complete should make migrating trivial. | ||
|
||
```diff | ||
- logLevel: 'info' | ||
+ logLevel: 'Info' | ||
``` | ||
|
||
- `uploadthing/server` adapter now returns a single function instead of individual named functions. The handler accepts a request and will handle routing internally. | ||
|
||
```diff | ||
- const { GET, POST } = createRouteHandler({ router, config }) | ||
+ const handler = createRouteHandler({ router, config }) | ||
``` | ||
|
||
You can re-export the handler as named functions if your framework requires it. | ||
|
||
```ts | ||
const handler = createRouteHandler({ router, config }) | ||
export { handler as GET, handler as POST } | ||
``` | ||
|
||
## Features | ||
|
||
### General | ||
|
||
- Add new configuration provider. All config options (e.g. `UTApi.constructor` options or `createRouteHandler.config` option can now also be set using an environment variable. Setting the option in the constructor is still supported and takes precedence over the environment variable. | ||
|
||
```ts | ||
const api = new UTApi({ | ||
logLevel: 'Info', | ||
}) | ||
// is the same as | ||
process.env.UPLOADTHING_LOG_LEVEL = 'Info' | ||
const api = new UTApi() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,40 @@ | ||
.next | ||
node_modules | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
# sitemap | ||
public/robots.txt | ||
public/sitemap.xml | ||
public/sitemap-0.xml | ||
public/sitemap-0.xml |
Oops, something went wrong.