Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add migration guide for Uppy 3.x, Companion 4.x, and Robodog #3913

Merged
merged 22 commits into from Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1586f99
Fix exports in propTypes.js to fix website build
Murderlon Jul 27, 2022
ad5b6bc
Merge branch '3.x' of https://github.com/transloadit/uppy into 3.x
Murderlon Jul 27, 2022
163e64b
Add migration guide for Uppy 3.x and Companion 4.x
Murderlon Jul 27, 2022
ee1143b
Apply suggestions from code review
Murderlon Aug 3, 2022
04efa23
Merge branch '3.x' into migration-guide
Murderlon Aug 3, 2022
d774051
Add Robodog section
Murderlon Aug 3, 2022
37cb030
Add breaking changes from todos
Murderlon Aug 3, 2022
0f7cc66
Update website/src/docs/migration-guides.md
Murderlon Aug 3, 2022
40ddfc2
Small tweaks
Murderlon Aug 3, 2022
9cf9a13
Add section about s3 option changes
Murderlon Aug 3, 2022
78387c9
Add aws-s3-multipart changes
Murderlon Aug 3, 2022
83e3725
Add Robodog migration guide
Murderlon Aug 4, 2022
ebedbcc
Remove unused code in example
Murderlon Aug 4, 2022
38c48ac
Add section for metrics endpoint
Murderlon Aug 4, 2022
923a503
Update website/src/docs/migration-guides.md
Murderlon Aug 8, 2022
a1be411
Add missing @uppy/transloadit breaking changes
Murderlon Aug 22, 2022
049e10d
Add `validateRestrictions` breaking change
Murderlon Aug 22, 2022
be6d816
Small rewrites + improved formatting
Murderlon Aug 22, 2022
e757341
Add `metaFields` -> `allowedMetaFields` breaking change
Murderlon Aug 22, 2022
d1adeba
Update website/src/docs/migration-guides.md
arturi Aug 22, 2022
1de0ffe
Add peer dependencies breaking changes
Murderlon Aug 22, 2022
018040a
Improve paragraph about Robodog migration commit
Murderlon Aug 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/@uppy/react/src/propTypes.js
Expand Up @@ -55,4 +55,7 @@ export {
uppy,
locale,
dashboard,
plugins,
metaFields,
cssSize,
}
63 changes: 61 additions & 2 deletions website/src/docs/migration-guides.md
Expand Up @@ -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:

<!-- eslint-disable no-restricted-globals -->

```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.
Murderlon marked this conversation as resolved.
Show resolved Hide resolved

Murderlon marked this conversation as resolved.
Show resolved Hide resolved
## Migrate from Companion 3.x to 4.x

### Minimum required Node.js version is v14.19.0
Murderlon marked this conversation as resolved.
Show resolved Hide resolved

Aligning with the Node.js [Long Term Support (LTS) schedule](https://nodejs.org/en/about/releases/) and to use modern syntax features.
Murderlon marked this conversation as resolved.
Show resolved Hide resolved

### `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.
Murderlon marked this conversation as resolved.
Show resolved Hide resolved

### 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.
Murderlon marked this conversation as resolved.
Show resolved Hide resolved

### Default to no ACL for AWS S3
Murderlon marked this conversation as resolved.
Show resolved Hide resolved

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
Murderlon marked this conversation as resolved.
Show resolved Hide resolved
Murderlon marked this conversation as resolved.
Show resolved Hide resolved

## Migrate from Uppy 1.x to 2.x

### New bundle requires manual polyfilling

Expand Down Expand Up @@ -247,7 +306,7 @@ Uppy 1.0 will continue to receive bug fixes for three more months (until <time d

We hope you’ll waste no time in taking Uppy 2.0 out for a walk. When you do, please let us know what you thought of it on [Reddit](https://www.reddit.com/r/javascript/comments/penbr7/uppy_file_uploader_20_smaller_and_faster_modular/), [HN](https://news.ycombinator.com/item?id=28359287), ProductHunt, or [Twitter](https://twitter.com/uppy_io/status/1432399270846603264). We’re howling at the moon to hear from you!

## Migrating Companion v1 to v2
## Migrate from Companion 1.x to 2.x

### Prerequisite

Expand Down