Skip to content

Commit

Permalink
Merge branch '4.x' into migration-guide
Browse files Browse the repository at this point in the history
* 4.x: (43 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 d848ea1 + b81b7fb commit 3e680c9
Show file tree
Hide file tree
Showing 136 changed files with 2,807 additions and 4,461 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
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
11 changes: 0 additions & 11 deletions docs/uppy-core.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1328,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.

49 changes: 49 additions & 0 deletions examples/react-example/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* eslint-disable */
import React from 'react'
import Uppy from '@uppy/core'
import Tus from '@uppy/tus'
import Webcam from '@uppy/webcam'
import RemoteSources from '@uppy/remote-sources'
import { Dashboard, useUppyState } from '@uppy/react'

import '@uppy/core/dist/style.css'
import '@uppy/dashboard/dist/style.css'
import '@uppy/drag-drop/dist/style.css'
import '@uppy/file-input/dist/style.css'
import '@uppy/progress-bar/dist/style.css'

const metaFields = [
{ id: 'license', name: 'License', placeholder: 'specify license' },
]

function createUppy() {
return new Uppy({ restrictions: { requiredMetaFields: ['license'] } })
.use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' })
.use(Webcam)
.use(RemoteSources, {
companionUrl: 'https://companion.uppy.io',
})
}

export default function App() {
// IMPORTANT: passing an initaliser function to useState
// to prevent creating a new Uppy instance on every render.
// useMemo is a performance hint, not a guarantee.
const [uppy] = React.useState(createUppy)
// You can access state reactively with useUppyState
const fileCount = useUppyState(
uppy,
(state) => Object.keys(state.files).length,
)
const totalProgress = useUppyState(uppy, (state) => state.totalProgress)
// Also possible to get the state of all plugins.
const plugins = useUppyState(uppy, (state) => state.plugins)

return (
<>
<p>File count: {fileCount}</p>
<p>Total progress: {totalProgress}</p>
<Dashboard uppy={uppy} metaFields={metaFields} />
</>
)
}
2 changes: 1 addition & 1 deletion examples/react-example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
</head>
<body>
<div id="app"></div>
<script src="./main.jsx" type="module"></script>
<script src="./main.tsx" type="module"></script>
</body>
</html>
8 changes: 0 additions & 8 deletions examples/react-example/main.jsx

This file was deleted.

6 changes: 6 additions & 0 deletions examples/react-example/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* eslint-disable */
import React from 'react'
import { createRoot } from 'react-dom/client'
import App from './App.tsx'

createRoot(document.querySelector('#app')).render(<App />)
5 changes: 1 addition & 4 deletions examples/react-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
"dependencies": {
"@uppy/core": "workspace:*",
"@uppy/dashboard": "workspace:*",
"@uppy/drag-drop": "workspace:*",
"@uppy/file-input": "workspace:*",
"@uppy/google-drive": "workspace:*",
"@uppy/progress-bar": "workspace:*",
"@uppy/react": "workspace:*",
"@uppy/remote-sources": "workspace:*",
"@uppy/tus": "workspace:*",
"react": "^18.0.0",
"react-dom": "^18.0.0"
Expand Down
21 changes: 21 additions & 0 deletions examples/react-example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"jsxImportSource": "react",
"jsx": "react-jsx",
"esModuleInterop": true,
"skipLibCheck": true,
"target": "es2022",
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"isolatedModules": true,
"verbatimModuleSyntax": true,
"strict": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
"module": "NodeNext",
"outDir": "dist",
"sourceMap": true,
"lib": ["es2022", "dom", "dom.iterable"],
},
}
Loading

0 comments on commit 3e680c9

Please sign in to comment.