From 1586f991e3005be3e7586de543271ef03ae7df78 Mon Sep 17 00:00:00 2001 From: Murderlon Date: Wed, 27 Jul 2022 16:06:46 +0200 Subject: [PATCH 01/20] Fix exports in propTypes.js to fix website build --- packages/@uppy/react/src/propTypes.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/@uppy/react/src/propTypes.js b/packages/@uppy/react/src/propTypes.js index b06db10d20..e744a3dd1d 100644 --- a/packages/@uppy/react/src/propTypes.js +++ b/packages/@uppy/react/src/propTypes.js @@ -55,4 +55,7 @@ export { uppy, locale, dashboard, + plugins, + metaFields, + cssSize, } From 163e64b35f7d6369d7eb5f902835ec99437a0960 Mon Sep 17 00:00:00 2001 From: Murderlon Date: Wed, 27 Jul 2022 16:10:38 +0200 Subject: [PATCH 02/20] Add migration guide for Uppy 3.x and Companion 4.x --- website/src/docs/migration-guides.md | 63 +++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/website/src/docs/migration-guides.md b/website/src/docs/migration-guides.md index 0129754e36..5bc4c22018 100644 --- a/website/src/docs/migration-guides.md +++ b/website/src/docs/migration-guides.md @@ -8,7 +8,66 @@ category: "Docs" These cover all the major Uppy versions and how to migrate to them. -## Migrate to 2.0.0 +## Migrate from Uppy 2.x to 3.x + +### Uppy is pure ESM + +Following the footsteps of many packages, we now only ship [ECMAScript Modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) (ESM). Uppy can’t be `require()`’d from CommonJS. + +Before Uppy 3.x, you could use `require` or `import` as we shipped CommonJS: + + + +```js +const Uppy = require('@uppy/core') +const Dashboard = require('@uppy/dashboard') +``` + +Now Uppy can only be `import`’ed: + +```js +import Uppy from '@uppy/core' +import Dashboard from '@uppy/dashboard' +``` + +Refer to the [Pure ESM package](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) gist for added information and help. + +## Migrate from Companion 3.x to 4.x + +### Minimum required Node.js version is v14.19.0 + +Aligning with the Node.js [Long Term Support (LTS) schedule](https://nodejs.org/en/about/releases/) and to use modern syntax features. + +### `companion.app()` returns `{ app, emitter }` instead of `app` + +Companion 3.x provides the emitter as `companionEmitter` on `app`. As of 4.x, an object is returned with `app` (express middleware) and `emitter` (event emitter). This provides more flexibility in the future and follows best practices. + +### Removed compatibility for legacy Custom Provider implementations + +[Custom Provider](https://uppy.io/docs/companion/#Adding-custom-providers) implementations must use the Promise API, instead of the callback API. + +### Default to no ACL for AWS S3 + +Default to no [ACL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html) for S3 uploads. Before the default was `public-read` but AWS now discourages ACLs. The environment variable `COMPANION_AWS_DISABLE_ACL` is also removed, instead Companion only uses `COMPANION_AWS_ACL`. + +### `protocol` sent from Uppy in any `get` request is now required (before it would default to Multipart). + +If you use any official Uppy plugins, then no migration is needed. For custom plugins that talk to Companion, make to send along the `protocol` header with a value of `multipart`, `s3Multipart`, or `tus`. + +### `emitSuccess` and `emitError` are now private methods on the `Uploader` class. + +It’s unlikely you’re using this, but it’s technically a breaking change. +In general, don’t depend on implicitly internal methods, use exposed APIs instead. + +### Removed `chunkSize` backwards compatibility for AWS S3 Multipart + +`chunkSize` option will now be used as `partSize` in AWS multipart. Before only valid values would be respected. Invalid values would be ignored. Now any value will be passed on to the AWS SDK, possibly throwing an error on invalid values. + +### Removed backwards compatibility for `/metrics` endpoint + +TODO @mifi + +## Migrate from Uppy 1.x to 2.x ### New bundle requires manual polyfilling @@ -247,7 +306,7 @@ Uppy 1.0 will continue to receive bug fixes for three more months (until