Skip to content

Commit

Permalink
Merge branch '4.x' into pr/4623
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed May 8, 2024
2 parents 4eea288 + 12e7ca5 commit 82a25c0
Show file tree
Hide file tree
Showing 32 changed files with 105 additions and 52 deletions.
2 changes: 1 addition & 1 deletion BUNDLE-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Hi, thanks for trying out the bundled version of the Uppy File Uploader. You can
use this from a CDN
(`<script src="https://releases.transloadit.com/uppy/v4.0.0-beta.5/uppy.min.js"></script>`)
(`<script src="https://releases.transloadit.com/uppy/v4.0.0-beta.6/uppy.min.js"></script>`)
or bundle it with your webapp.

Note that the recommended way to use Uppy is to install it with yarn/npm and use
Expand Down
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ Please add your entries in this format:

In the current stage we aim to release a new version at least every month.

## 4.0.0-beta.6

Released: 2024-05-08

| Package | Version | Package | Version |
| ---------------- | ------------ | ---------------- | ------------ |
| @uppy/compressor | 2.0.0-beta.6 | @uppy/status-bar | 4.0.0-beta.6 |
| @uppy/core | 4.0.0-beta.6 | uppy | 4.0.0-beta.6 |
| @uppy/dashboard | 4.0.0-beta.6 | | |




## 4.0.0-beta.5

Released: 2024-05-03
Expand Down Expand Up @@ -274,6 +287,19 @@ Released: 2024-03-28
- @uppy/vue: [v4.x] remove manual types (Antoine du Hamel / #4803)
- meta: prepare release workflow for beta versions (Antoine du Hamel)

## 3.25.2

Released: 2024-05-07

| Package | Version | Package | Version |
| ---------------- | ------- | ---------------- | ------- |
| @uppy/compressor | 1.1.4 | @uppy/status-bar | 3.3.3 |
| @uppy/core | 3.11.2 | uppy | 3.25.2 |
| @uppy/dashboard | 3.8.3 | | |

- @uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/status-bar: Upgrade @transloadit/prettier-bytes (Merlijn Vos / #5150)
- meta: run Prettier in the release workflow (Antoine du Hamel)


## 3.25.1

Expand Down Expand Up @@ -3049,7 +3075,7 @@ In this release we’ve improved testing DX and CORS handling in Companion, adde
- @uppy/aws-s3: removeUploader triggered on uninstall (#2824 / @slawexxx44)
- @uppy/companion: Add additional Google Drive Metadata (#2795 / @ajh-sr)
- @uppy/companion: Feature: add redis pubsub scope setting (#2804 / @coreprocess)
- @uppy/companion: fix running on a subpath (#2841, #2797 / @coreprocess, @goto-bus-stop)
- @uppy/companion: fix running on a subpath (#2841, #2797 / @coreprocess, @goto-bus-stop)
- @uppy/companion: Fix videoMediaMetadata property name (6cb90c613c5d3b256194e039bfce30d6de6a6dac / @goto-bus-stop)
- @uppy/companion: Improve companion unit testing DX (#2827 / @mifi)
- @uppy/companion: Use `cors` module instead of custom cors logic (#2823 / @mifi)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ npm install @uppy/core @uppy/dashboard @uppy/tus
```

Add CSS
[uppy.min.css](https://releases.transloadit.com/uppy/v4.0.0-beta.5/uppy.min.css),
[uppy.min.css](https://releases.transloadit.com/uppy/v4.0.0-beta.6/uppy.min.css),
either to your HTML page’s `<head>` or include in JS, if your bundler of choice
supports it.

Expand All @@ -94,7 +94,7 @@ object.
```html
<!-- 1. Add CSS to `<head>` -->
<link
href="https://releases.transloadit.com/uppy/v4.0.0-beta.5/uppy.min.css"
href="https://releases.transloadit.com/uppy/v4.0.0-beta.6/uppy.min.css"
rel="stylesheet"
/>

Expand All @@ -105,7 +105,7 @@ object.
Uppy,
Dashboard,
Tus,
} from 'https://releases.transloadit.com/uppy/v4.0.0-beta.5/uppy.min.mjs'
} from 'https://releases.transloadit.com/uppy/v4.0.0-beta.6/uppy.min.mjs'
const uppy = new Uppy()
uppy.use(Dashboard, { target: '#files-drag-drop' })
Expand Down
4 changes: 2 additions & 2 deletions e2e/cypress/integration/dashboard-ui.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('dashboard-ui', () => {
cy.get('.uppy-Dashboard-AddFiles').as('drop-target')
})

it('should not throw when calling uppy.close()', () => {
it('should not throw when calling uppy.destroy()', () => {
cy.get('@file-input').selectFile(
[
'cypress/fixtures/images/cat.jpg',
Expand All @@ -15,7 +15,7 @@ describe('dashboard-ui', () => {
)

cy.window().then(({ uppy }) => {
expect(uppy.close()).to.not.throw
expect(uppy.destroy()).to.not.throw
})
})

Expand Down
4 changes: 2 additions & 2 deletions examples/aws-nodejs/public/drag.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<title>Uppy</title>
<link
href="https://releases.transloadit.com/uppy/v4.0.0-beta.5/uppy.min.css"
href="https://releases.transloadit.com/uppy/v4.0.0-beta.6/uppy.min.css"
rel="stylesheet"
/>
</head>
Expand All @@ -22,7 +22,7 @@ <h5>Uploaded files:</h5>
DragDrop,
ProgressBar,
AwsS3,
} from 'https://releases.transloadit.com/uppy/v4.0.0-beta.5/uppy.min.mjs'
} from 'https://releases.transloadit.com/uppy/v4.0.0-beta.6/uppy.min.mjs'

// Function for displaying uploaded files
const onUploadSuccess = (elForUploadedFiles) => (file, response) => {
Expand Down
4 changes: 2 additions & 2 deletions examples/aws-nodejs/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<title>Uppy – AWS upload example</title>
<link
href="https://releases.transloadit.com/uppy/v4.0.0-beta.5/uppy.min.css"
href="https://releases.transloadit.com/uppy/v4.0.0-beta.6/uppy.min.css"
rel="stylesheet"
/>
</head>
Expand All @@ -16,7 +16,7 @@ <h1>AWS upload example</h1>
Uppy,
Dashboard,
AwsS3,
} from 'https://releases.transloadit.com/uppy/v4.0.0-beta.5/uppy.min.mjs'
} from 'https://releases.transloadit.com/uppy/v4.0.0-beta.6/uppy.min.mjs'
/**
* This generator transforms a deep object into URL-encodable pairs
* to work with `URLSearchParams` on the client and `body-parser` on the server.
Expand Down
4 changes: 2 additions & 2 deletions examples/cdn-example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
href="https://releases.transloadit.com/uppy/v4.0.0-beta.5/uppy.min.css"
href="https://releases.transloadit.com/uppy/v4.0.0-beta.6/uppy.min.css"
rel="stylesheet"
/>
</head>
Expand All @@ -19,7 +19,7 @@
Dashboard,
Webcam,
Tus,
} from 'https://releases.transloadit.com/uppy/v4.0.0-beta.5/uppy.min.mjs'
} from 'https://releases.transloadit.com/uppy/v4.0.0-beta.6/uppy.min.mjs'

const uppy = new Uppy({ debug: true, autoProceed: false })
.use(Dashboard, { trigger: '#uppyModalOpener' })
Expand Down
4 changes: 2 additions & 2 deletions examples/uppy-with-companion/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
href="https://releases.transloadit.com/uppy/v4.0.0-beta.5/uppy.min.css"
href="https://releases.transloadit.com/uppy/v4.0.0-beta.6/uppy.min.css"
rel="stylesheet"
/>
</head>
Expand All @@ -19,7 +19,7 @@
Instagram,
GoogleDrive,
Tus,
} from 'https://releases.transloadit.com/uppy/v4.0.0-beta.5/uppy.min.mjs'
} from 'https://releases.transloadit.com/uppy/v4.0.0-beta.6/uppy.min.mjs'

const uppy = new Uppy({ debug: true, autoProceed: false })
.use(Dashboard, { trigger: '#uppyModalOpener' })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { UIPluginOptions } from '@uppy/core'
import type { tokenStorage } from './index.js'

export interface CompanionPluginOptions extends UIPluginOptions {
title?: string
storage?: typeof tokenStorage
companionUrl: string
companionHeaders?: Record<string, string>
Expand Down
7 changes: 7 additions & 0 deletions packages/@uppy/compressor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ Included in: Uppy v4.0.0-beta.5

- @uppy/audio,@uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/remote-sources,@uppy/tus,@uppy/utils: Format (Murderlon)

## 1.1.4

Released: 2024-05-07
Included in: Uppy v3.25.2

- @uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/status-bar: Upgrade @transloadit/prettier-bytes (Merlijn Vos / #5150)

## 1.1.1

Released: 2024-02-20
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/compressor/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@uppy/compressor",
"description": "Uppy plugin that compresses images before upload, saving up to 60% in size",
"version": "2.0.0-beta.5",
"version": "2.0.0-beta.6",
"license": "MIT",
"main": "lib/index.js",
"style": "dist/style.min.css",
Expand Down
7 changes: 7 additions & 0 deletions packages/@uppy/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ Included in: Uppy v4.0.0-beta.1
- @uppy/core: various type fixes (Antoine du Hamel / #4995)
- @uppy/core,@uppy/provider-views: Fix breadcrumbs (Evgenia Karunus / #4986)

## 3.11.2

Released: 2024-05-07
Included in: Uppy v3.25.2

- @uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/status-bar: Upgrade @transloadit/prettier-bytes (Merlijn Vos / #5150)

## 3.11.1

Released: 2024-05-03
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@uppy/core",
"description": "Core module for the extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:",
"version": "4.0.0-beta.5",
"version": "4.0.0-beta.6",
"license": "MIT",
"main": "lib/index.js",
"style": "dist/style.min.css",
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/core/src/UIPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class UIPlugin<
// API for plugins that require a synchronous rerender.
this.#updateUI = debounce((state) => {
// plugin could be removed, but this.rerender is debounced below,
// so it could still be called even after uppy.removePlugin or uppy.close
// so it could still be called even after uppy.removePlugin or uppy.destroy
// hence the check
if (!this.uppy.getPlugin(this.id)) return
render(this.render(state), uppyRootElement)
Expand Down
6 changes: 3 additions & 3 deletions packages/@uppy/core/src/Uppy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ describe('src/Core', () => {
core.on('cancel-all', coreCancelEventMock)
core.on('state-update', coreStateUpdateEventMock)

core.close()
core.destroy()

expect(coreCancelEventMock).toHaveBeenCalledWith(
{ reason: 'user' },
Expand Down Expand Up @@ -1808,7 +1808,7 @@ describe('src/Core', () => {

await uploadPromise

core.close()
core.destroy()
})

it('should estimate progress for unsized files', () => {
Expand Down Expand Up @@ -1852,7 +1852,7 @@ describe('src/Core', () => {
// foo.jpg at 35%, bar.jpg at 0%
expect(core.getState().totalProgress).toBe(18)

core.close()
core.destroy()
})

it('should calculate the total progress of all file uploads', () => {
Expand Down
11 changes: 2 additions & 9 deletions packages/@uppy/core/src/Uppy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,6 @@ export class Uppy<M extends Meta, B extends Body> {
this.setState(undefined) // so that UI re-renders with new options
}

// todo next major: remove
resetProgress(): void {
const defaultProgress: Omit<FileProgressNotStarted, 'bytesTotal'> = {
percentage: 0,
Expand All @@ -597,9 +596,7 @@ export class Uppy<M extends Meta, B extends Body> {
this.emit('reset-progress')
}

// @todo next major: rename to `clear()`, make it also cancel ongoing uploads
// or throw and say you need to cancel manually
clearUploadedFiles(): void {
clear(): void {
this.setState({ ...defaultUploadState, files: {} })
}

Expand Down Expand Up @@ -1799,11 +1796,7 @@ export class Uppy<M extends Meta, B extends Body> {
/**
* Uninstall all plugins and close down this Uppy instance.
*/
// @todo next major: rename to `destroy`.
// Cancel local uploads, cancel remote uploads, DON'T cancel assemblies
// document that if you do want to cancel assemblies, you need to call smth manually.
// Potentially remove reason, as it’s confusing, just come up with a default behaviour.
close({ reason }: { reason?: FileRemoveReason } | undefined = {}): void {
destroy({ reason }: { reason?: FileRemoveReason } | undefined = {}): void {
this.log(
`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`,
)
Expand Down
6 changes: 6 additions & 0 deletions packages/@uppy/dashboard/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ Included in: Uppy v4.0.0-beta.1
- @uppy/dashboard: refactor to TypeScript (Antoine du Hamel / #4984)
- @uppy/dashboard: refactor to stable lifecycle method (Antoine du Hamel / #4999)

## 3.8.3

Released: 2024-05-07
Included in: Uppy v3.25.2

- @uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/status-bar: Upgrade @transloadit/prettier-bytes (Merlijn Vos / #5150)

## 3.8.2

Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@uppy/dashboard",
"description": "Universal UI plugin for Uppy.",
"version": "4.0.0-beta.5",
"version": "4.0.0-beta.6",
"license": "MIT",
"main": "lib/index.js",
"style": "dist/style.min.css",
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/dashboard/src/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export default class Dashboard<M extends Meta, B extends Body> extends UIPlugin<

// Dynamic default options:
this.opts.doneButtonHandler ??= () => {
this.uppy.clearUploadedFiles()
this.uppy.clear()
this.requestCloseModal()
}
this.opts.onRequestCloseModal ??= () => this.closeModal()
Expand Down
14 changes: 7 additions & 7 deletions packages/@uppy/dashboard/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Dashboard', () => {
core.use(DashboardPlugin, { inline: false })
}).not.toThrow()

core.close()
core.destroy()
})

it('works without any remote provider plugins', () => {
Expand All @@ -48,7 +48,7 @@ describe('Dashboard', () => {
})
}).not.toThrow()

core.close()
core.destroy()
})

it('works when targeting remote provider plugins using `target`', () => {
Expand All @@ -64,7 +64,7 @@ describe('Dashboard', () => {
})
}).not.toThrow()

core.close()
core.destroy()
})

it('works when passing plugins in `plugins` array', () => {
Expand All @@ -79,7 +79,7 @@ describe('Dashboard', () => {
})
}).not.toThrow()

core.close()
core.destroy()
})

it('should automatically add plugins which have no target', () => {
Expand All @@ -98,7 +98,7 @@ describe('Dashboard', () => {
true,
)

core.close()
core.destroy()
})

it('should not automatically add plugins which have a non-Dashboard target', () => {
Expand All @@ -118,7 +118,7 @@ describe('Dashboard', () => {
false,
)

core.close()
core.destroy()
})

it('should change options on the fly', () => {
Expand Down Expand Up @@ -168,6 +168,6 @@ describe('Dashboard', () => {
})
}).not.toThrow()

core.close()
core.destroy()
})
})
2 changes: 1 addition & 1 deletion packages/@uppy/dropbox/src/Dropbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default class Dropbox<M extends Meta, B extends Body> extends UIPlugin<
this.defaultLocale = locale

this.i18nInit()
this.title = this.opts.title || this.i18n('pluginNameDropbox')
this.title = this.i18n('pluginNameDropbox')

this.onFirstRender = this.onFirstRender.bind(this)
this.render = this.render.bind(this)
Expand Down

0 comments on commit 82a25c0

Please sign in to comment.