DEV: Revert uppy upgrade

DEV: Revert uppy upgrade

This rolls uppy back to the previous bundle that was used, which will break multipart functionality (which is not yet enabled anywhere).

No other upload functionality should be affected by this change, it will be as if d295a16dab994c45e33e1df8da46c337ebd6a917 had not been merged.

diff --git a/app/assets/javascripts/discourse-shims.js b/app/assets/javascripts/discourse-shims.js
index 3f038c1..71ce847 100644
--- a/app/assets/javascripts/discourse-shims.js
+++ b/app/assets/javascripts/discourse-shims.js
@@ -32,7 +32,7 @@ define("@popperjs/core", ["exports"], function (__exports__) {
 
 define("@uppy/core", ["exports"], function (__exports__) {
   __exports__.default = window.Uppy.Core;
-  __exports__.BasePlugin = window.Uppy.BasePlugin;
+  __exports__.Plugin = window.Uppy.Plugin;
 });
 
 define("@uppy/aws-s3", ["exports"], function (__exports__) {
diff --git a/app/assets/javascripts/discourse/app/lib/uppy-checksum-plugin.js b/app/assets/javascripts/discourse/app/lib/uppy-checksum-plugin.js
index 3e74b36..4cd0cea 100644
--- a/app/assets/javascripts/discourse/app/lib/uppy-checksum-plugin.js
+++ b/app/assets/javascripts/discourse/app/lib/uppy-checksum-plugin.js
@@ -1,8 +1,8 @@
-import { BasePlugin } from "@uppy/core";
+import { Plugin } from "@uppy/core";
 import { warn } from "@ember/debug";
 import { Promise } from "rsvp";
 
-export default class UppyChecksum extends BasePlugin {
+export default class UppyChecksum extends Plugin {
   constructor(uppy, opts) {
     super(uppy, opts);
     this.id = opts.id || "uppy-checksum";
diff --git a/app/assets/javascripts/discourse/app/lib/uppy-media-optimization-plugin.js b/app/assets/javascripts/discourse/app/lib/uppy-media-optimization-plugin.js
index dcf3c31..862a55a 100644
--- a/app/assets/javascripts/discourse/app/lib/uppy-media-optimization-plugin.js
+++ b/app/assets/javascripts/discourse/app/lib/uppy-media-optimization-plugin.js
@@ -1,8 +1,8 @@
-import { BasePlugin } from "@uppy/core";
+import { Plugin } from "@uppy/core";
 import { warn } from "@ember/debug";
 import { Promise } from "rsvp";
 
-export default class UppyMediaOptimization extends BasePlugin {
+export default class UppyMediaOptimization extends Plugin {
   constructor(uppy, opts) {
     super(uppy, opts);
     this.id = opts.id || "uppy-media-optimization";
diff --git a/vendor/assets/javascripts/uppy.js b/vendor/assets/javascripts/uppy.js
index ef9e451..36cf75c 100644
--- a/vendor/assets/javascripts/uppy.js
+++ b/vendor/assets/javascripts/uppy.js
@@ -1,18 +1,4 @@
 (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
-// We need a custom build of Uppy because we do not use webpack for
-// our JS modules/build. The only way to get what you want from Uppy
-// is to use the webpack modules or to include the entire Uppy project
-// including all plugins in a single JS file. This way we can just
-// use the plugins we actually want.
-window.Uppy = {}
-Uppy.Core = require('./packages/@uppy/core/lib/index.js')
-Uppy.BasePlugin = Uppy.Core.BasePlugin
-Uppy.XHRUpload = require('./packages/@uppy/xhr-upload/lib/index.js')
-Uppy.AwsS3 = require('./packages/@uppy/aws-s3/lib/index.js')
-Uppy.AwsS3Multipart = require('./packages/@uppy/aws-s3-multipart/lib/index.js')
-Uppy.DropTarget = require('./packages/@uppy/drop-target/lib/index.js')
-
-},{"./packages/@uppy/aws-s3-multipart/lib/index.js":14,"./packages/@uppy/aws-s3/lib/index.js":34,"./packages/@uppy/core/lib/index.js":60,"./packages/@uppy/drop-target/lib/index.js":75,"./packages/@uppy/xhr-upload/lib/index.js":83}],2:[function(require,module,exports){
 // Adapted from https://github.com/Flet/prettier-bytes/
 // Changing 1000 bytes to 1024, so we can keep uppercase KB vs kB
 // ISC License (c) Dan Flettre https://github.com/Flet/prettier-bytes/blob/master/LICENSE
@@ -45,7780 +31,8859 @@ module.exports = function prettierBytes (num) {
   }
 }
 
-},{}],3:[function(require,module,exports){
-/**
- * cuid.js
- * Collision-resistant UID generator for browsers and node.
- * Sequential for fast db lookups and recency sorting.
- * Safe for element IDs and server-side lookups.
- *
- * Extracted from CLCTR
- *
- * Copyright (c) Eric Elliott 2012
- * MIT License
- */
+},{}],2:[function(require,module,exports){
+function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
 
-var fingerprint = require('./lib/fingerprint.js');
-var pad = require('./lib/pad.js');
-var getRandomValue = require('./lib/getRandomValue.js');
+var _require = require('@uppy/utils/lib/AbortController'),
+    AbortController = _require.AbortController,
+    createAbortError = _require.createAbortError;
 
-var c = 0,
-  blockSize = 4,
-  base = 36,
-  discreteValues = Math.pow(base, blockSize);
+var delay = require('@uppy/utils/lib/delay');
 
-function randomBlock () {
-  return pad((getRandomValue() *
-    discreteValues << 0)
-    .toString(base), blockSize);
-}
+var MB = 1024 * 1024;
+var defaultOptions = {
+  limit: 1,
+  retryDelays: [0, 1000, 3000, 5000],
+  getChunkSize: function getChunkSize(file) {
+    return Math.ceil(file.size / 10000);
+  },
+  onStart: function onStart() {},
+  onProgress: function onProgress() {},
+  onPartComplete: function onPartComplete() {},
+  onSuccess: function onSuccess() {},
+  onError: function onError(err) {
+    throw err;
+  }
+};
 
-function safeCounter () {
-  c = c < discreteValues ? c : 0;
-  c++; // this is not subliminal
-  return c - 1;
+function ensureInt(value) {
+  if (typeof value === 'string') {
+    return parseInt(value, 10);
+  }
+
+  if (typeof value === 'number') {
+    return value;
+  }
+
+  throw new TypeError('Expected a number');
 }
 
-function cuid () {
-  // Starting with a lowercase letter makes
-  // it HTML element ID friendly.
-  var letter = 'c', // hard-coded allows for sequential access
+var MultipartUploader = /*#__PURE__*/function () {
+  function MultipartUploader(file, options) {
+    this.options = _extends({}, defaultOptions, options); // Use default `getChunkSize` if it was null or something
 
-    // timestamp
-    // warning: this exposes the exact date and time
-    // that the uid was created.
-    timestamp = (new Date().getTime()).toString(base),
+    if (!this.options.getChunkSize) {
+      this.options.getChunkSize = defaultOptions.getChunkSize;
+    }
 
-    // Prevent same-machine collisions.
-    counter = pad(safeCounter().toString(base), blockSize),
+    this.file = file;
+    this.abortController = new AbortController();
+    this.key = this.options.key || null;
+    this.uploadId = this.options.uploadId || null;
+    this.parts = []; // Do `this.createdPromise.then(OP)` to execute an operation `OP` _only_ if the
+    // upload was created already. That also ensures that the sequencing is right
+    // (so the `OP` definitely happens if the upload is created).
+    //
+    // This mostly exists to make `_abortUpload` work well: only sending the abort request if
+    // the upload was already created, and if the createMultipartUpload request is still in flight,
+    // aborting it immediately after it finishes.
 
-    // A few chars to generate distinct ids for different
-    // clients (so different computers are far less
-    // likely to generate the same id)
-    print = fingerprint(),
+    this.createdPromise = Promise.reject(); // eslint-disable-line prefer-promise-reject-errors
 
-    // Grab some more chars from Math.random()
-    random = randomBlock() + randomBlock();
+    this.isPaused = false;
+    this.partsInProgress = 0;
+    this.chunks = null;
+    this.chunkState = null;
 

[... diff too long, it was truncated ...]

GitHub sha: 2eddf210d3b3cea2f34ce97928afbeaf77cfd22a

This commit appears in #14160 which was approved by eviltrout. It was merged by eviltrout.