Skip to content

Commit

Permalink
Merge branch '4.x' into transloadit-single-assembly
Browse files Browse the repository at this point in the history
* 4.x: (44 commits)
  remove resetProgress and reset-progress (#5221)
  @uppy/audio: remove unused component props (#5209)
  @uppy/angular: fix invalid char in `package.json` (#5224)
  meta: use default argument value instead of `defaultProps` (#5222)
  @uppy/angular: upgrade to Angular 18 (#5215)
  @uppy/utils: remove unused `settle` (#5210)
  @uppy/form: move internal property to private field (#5214)
  @uppy/dashboard: remove unused component props (#5213)
  @uppy/status-bar: remove unused component props (#5211)
  @uppy/audio: move internal property to private field (#5207)
  @uppy/aws-s3: remove todo (#5200)
  @uppy/core: remove unnecessary todo (#5200)
  @uppy/aws-s3: do not expose internal `assertHost` method (#5200)
  @uppy/aws-s3: make passing `signal` consistent (#5200)
  @uppy/core: remove `'upload-started'` event (#5200)
  @uppy/aws-s3: remove `chunkState` getter (#5200)
  @uppy/drop-target: remove `title` property (#5200)
  @uppy/golden-retriever: remove unused `ready` setters (#5200)
  @uppy/dashboard: remove deprecated `autoOpenFileEditor` option (#5200)
  @uppy/aws-s3: remove `uploaderSockets` (#5200)
  ...
  • Loading branch information
Murderlon committed Jun 4, 2024
2 parents f4a9d0c + b81b7fb commit ce6ded7
Show file tree
Hide file tree
Showing 137 changed files with 2,883 additions and 4,494 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ module.exports = {
'react/no-this-in-sfc': 'error',
'react/no-will-update-set-state': 'error',
'react/prefer-stateless-function': 'error',
'react/require-default-props': ['error', {
forbidDefaultForRequired: true,
functions: 'defaultArguments',
}],
'react/sort-comp': 'error',
'react/style-prop-object': 'error',
'react/static-property-placement': 'off',
'react/style-prop-object': 'error',

// accessibility
'jsx-a11y/alt-text': 'error',
Expand Down
16 changes: 6 additions & 10 deletions docs/companion.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,10 @@ using many instances. See [How to scale Companion](#how-to-scale-companion).
#### `COMPANION_REDIS_EXPRESS_SESSION_PREFIX`

Set a custom prefix for redis keys created by
[connect-redis](https://github.com/tj/connect-redis). Defaults to `sess:`.
Sessions are used for storing authentication state and for allowing thumbnails
to be loaded by the browser via Companion. You might want to change this because
if you run a redis with many different apps in the same redis server, it’s hard
to know where `sess:` comes from and it might collide with other apps. **Note:**
in the future, we plan and changing the default to `companion:` and possibly
remove this option. This is a standalone-only option. See also
`COMPANION_REDIS_PUBSUB_SCOPE`.
[connect-redis](https://github.com/tj/connect-redis). Defaults to
`companion-session:`. Sessions are used for storing authentication state and for
allowing thumbnails to be loaded by the browser via Companion and for OAuth2.
See also `COMPANION_REDIS_PUBSUB_SCOPE`.

#### `redisOptions` `COMPANION_REDIS_OPTIONS`

Expand Down Expand Up @@ -655,8 +651,8 @@ as well as

#### `enableUrlEndpoint` `COMPANION_ENABLE_URL_ENDPOINT`

Set this to `false` to disable the
[URL functionalily](https://uppy.io/docs/url/). Default: `true`.
Set this to `true` to enable the [URL functionalily](https://uppy.io/docs/url/).
Default: `false`.

### Events

Expand Down
43 changes: 43 additions & 0 deletions docs/guides/migration-guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,49 @@

These cover all the major Uppy versions and how to migrate to them.

## Migrate from Uppy 3.x to 4.x

### Companion

- `COMPANION_REDIS_EXPRESS_SESSION_PREFIX` now defaults to `companion-session:`
(before `sess:`). To revert keep backwards compatibility, set the environment
variable `COMPANION_REDIS_EXPRESS_SESSION_PREFIX=sess:`.
- The URL endpoint (used by the `Url`/`Link` plugin) is now turned off by
default and must be explicitly enabled with
`COMPANION_ENABLE_URL_ENDPOINT=true` or `enableUrlEndpoint: true`.
- Custom provider breaking changes. If you have not implemented a custom
provider, you should not be affected.
- The static `getExtraConfig` property has been renamed to
`getExtraGrantConfig`.
- The static `authProvider` property has been renamed to `oauthProvider`.
- Endpoint `GET /s3/params` now returns `{ method: "POST" }` instead of
`{ method: "post" }`. This will not affect most people.
- The Companion [`error` event](https://uppy.io/docs/companion/#events) now no
longer includes `extraData` inside the `payload.error` property. `extraData`
is (and was also before) included in the `payload`.
- `access-control-allow-headers` is no longer included in
`Access-Control-Expose-Headers`, and `uppy-versions` is no longer an allowed
header. We are not aware of any issues this might cause.
- Internal refactoring (probably won’t affect you)
- `getProtectedGot` parameter `blockLocalIPs` changed to `allowLocalIPs`
(inverted boolean).
- `getURLMeta` 2nd (boolean) argument inverted.
- `getProtectedHttpAgent` parameter `blockLocalIPs` changed to `allowLocalIPs`
(inverted boolean).
- `downloadURL` 2nd (boolean) argument inverted.

### `@uppy/companion-client`

- `supportsRefreshToken` now defaults to `false` instead of `true`. If you have
implemented a custom provider, this might affect you.
- `Socket` class is no longer in use and has been removed. Unless you used this
class you don’t need to do anything.
- Remove deprecated options `serverUrl` and `serverPattern` (they were merely
defined in Typescript, not in use).
- `RequestClient` methods `get`, `post`, `delete` no longer accepts a boolean as
the third argument. Instead, pass `{ skipPostResponse: true | false }`. This
won’t affect you unless you’ve been using `RequestClient`.

## Migrate from Robodog to Uppy plugins

Uppy is flexible and extensible through plugins. But the integration code could
Expand Down
4 changes: 2 additions & 2 deletions docs/sources/companion-plugins/url.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ new Uppy()

### Use in Companion

Companion supports this plugin out-of-the-box so integration is required on this
side.
Companion supports this plugin out-of-the-box, however it must be enabled in
Companion with the `enableUrlEndpoint` / `COMPANION_ENABLE_URL_ENDPOINT` option.

## API

Expand Down
36 changes: 15 additions & 21 deletions docs/uppy-core.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1036,14 +1036,10 @@ uppy.on('file-removed', (file) => {
Fired when the upload starts.
```js
uppy.on('upload', (data) => {
// data object consists of `id` with upload ID and `fileIDs` array
// with file IDs in current upload
// data: { id, fileIDs }
console.log(`Starting upload ${id} for files ${fileIDs}`);
});
```
**Parameters**
- `uploadID` (`string)`
- `files` (`UppyFile<M,B>`)
#### `preprocess-progress`
Expand Down Expand Up @@ -1097,6 +1093,15 @@ uppy.on('upload-progress', (file, progress) => {
});
```
#### `upload-pause`
Fired when an individual upload is (un)paused.
**Parameters**
- `file` (`UppyFile<M,B>`)
- `isPaused` (`boolean`)
#### `postprocess-progress`
Progress of the post-processors.
Expand Down Expand Up @@ -1236,7 +1241,7 @@ the `retry-all` event instead.
**Parameters**
- `fileID` - ID of the file that is being retried.
- `file` (`UppyFile<M,B>`)
**Example**
Expand Down Expand Up @@ -1272,7 +1277,7 @@ Fired when all failed uploads are retried
**Parameters**
- `fileIDs` - Arrays of IDs of the files being retried.
- `files` (`UppyFile<M,B>[]`)
**Example**
Expand Down Expand Up @@ -1323,17 +1328,6 @@ uppy.on('restriction-failed', (file, error) => {
});
```
#### `reset-progress`
Fired when `resetProgress()` is called, each file has its upload progress reset
to zero.
```js
uppy.on('reset-progress', () => {
// progress was reset
});
```
## `new BasePlugin(uppy, options?)`
The initial building block for a plugin.
Expand Down
1 change: 1 addition & 0 deletions e2e/start-companion-with-load-balancer.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const startCompanion = ({ name, port }) => {
COMPANION_SECRET: 'development', // multi instance will not work without secret set
COMPANION_PREAUTH_SECRET: 'development', // multi instance will not work without secret set
COMPANION_ALLOW_LOCAL_URLS: 'true',
COMPANION_ENABLE_URL_ENDPOINT: 'true',
COMPANION_LOGGER_PROCESS_NAME: name,
},
})
Expand Down
31 changes: 14 additions & 17 deletions examples/angular-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^17.3.0",
"@angular/common": "^17.3.0",
"@angular/compiler": "^17.3.0",
"@angular/core": "^17.3.0",
"@angular/forms": "^17.3.0",
"@angular/platform-browser": "^17.3.0",
"@angular/platform-browser-dynamic": "^17.3.0",
"@angular/router": "^17.3.0",
"@angular/animations": "^18.0.0",
"@angular/common": "^18.0.0",
"@angular/compiler": "^18.0.0",
"@angular/core": "^18.0.0",
"@angular/forms": "^18.0.0",
"@angular/platform-browser": "^18.0.0",
"@angular/platform-browser-dynamic": "^18.0.0",
"@angular/router": "^18.0.0",
"@uppy/angular": "workspace:*",
"@uppy/core": "workspace:*",
"@uppy/drag-drop": "workspace:*",
Expand All @@ -28,17 +28,14 @@
"@uppy/webcam": "workspace:*",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.4"
"zone.js": "~0.14.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.3.0",
"@angular-eslint/builder": "17.3.0",
"@angular-eslint/eslint-plugin": "17.3.0",
"@angular-eslint/eslint-plugin-template": "17.3.0",
"@angular-eslint/schematics": "17.3.0",
"@angular-eslint/template-parser": "17.3.0",
"@angular/cli": "~17.3.0",
"@angular/compiler-cli": "^17.3.0",
"@angular-devkit/build-angular": "^18.0.2",
"@angular-eslint/eslint-plugin": "18.0.1",
"@angular-eslint/eslint-plugin-template": "18.0.1",
"@angular/cli": "^18.0.2",
"@angular/compiler-cli": "^18.0.0",
"@types/jasmine": "~5.1.0",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/aws-nodejs/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ <h1>AWS upload example</h1>
return data
},

async abortMultipartUpload(file, { key, uploadId }, signal) {
async abortMultipartUpload(file, { key, uploadId, signal }) {
const filename = encodeURIComponent(key)
const uploadIdEnc = encodeURIComponent(uploadId)
const response = await fetch(
Expand Down
5 changes: 1 addition & 4 deletions examples/custom-provider/client/MyCustomProvider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default class MyCustomProvider extends UIPlugin {
this.type = 'acquirer'
this.storage = this.opts.storage || tokenStorage
this.files = []
this.rootFolderId = null

this.icon = () => (
<svg width="32" height="32" xmlns="http://www.w3.org/2000/svg">
Expand Down Expand Up @@ -70,10 +71,6 @@ export default class MyCustomProvider extends UIPlugin {
this.unmount()
}

onFirstRender() {
return this.view.getFolder()
}

render(state) {
return this.view.render(state)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-provider/server/CustomProvider.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function adaptData (res) {
class MyCustomProvider {
static version = 2

static get authProvider () {
static get oauthProvider () {
return 'myunsplash'
}

Expand Down
114 changes: 0 additions & 114 deletions examples/react-example/App.jsx

This file was deleted.

Loading

0 comments on commit ce6ded7

Please sign in to comment.