Ver código fonte

@uppy/companion: make streaming upload default to `true` (#5315)

Mikael Finstad 9 meses atrás
pai
commit
682de7ad99

+ 2 - 4
docs/companion.md

@@ -290,7 +290,7 @@ const options = {
 	allowLocalUrls: false,
 	logClientVersion: true,
 	periodicPingUrls: [],
-	streamingUpload: false,
+	streamingUpload: true,
 	clientSocketConnectTimeout: 60000,
 	metrics: true,
 };
@@ -600,9 +600,7 @@ Prometheus metrics (by default metrics are enabled.)
 A boolean flag to tell Companion whether to enable streaming uploads. If
 enabled, it will lead to _faster uploads_ because companion will start uploading
 at the same time as downloading using `stream.pipe`. If `false`, files will be
-fully downloaded first, then uploaded. Defaults to `false`, but we recommended
-enabling it, especially if you’re expecting to upload large files. In future
-versions the default might change to `true`.
+fully downloaded first, then uploaded. Defaults to `true`.
 
 #### `maxFileSize` `COMPANION_MAX_FILE_SIZE`
 

+ 2 - 0
docs/guides/migration-guides.md

@@ -16,6 +16,8 @@ These cover all the major Uppy versions and how to migrate to them.
 - The URL endpoint (used by the `Url`/`Link` plugin) is now turned off by
   default and must be explicitly enabled with
   `COMPANION_ENABLE_URL_ENDPOINT=true` or `enableUrlEndpoint: true`.
+- The option `streamingUpload` / `COMPANION_STREAMING_UPLOAD` now defaults to
+  `true`.
 - The option `getKey(req, filename, metadata)` has changed signature to
   `getKey({ filename, metadata, req })`.
 - The option `bucket(req, metadata)` has changed signature to

+ 1 - 1
packages/@uppy/companion/src/config/companion.js

@@ -19,7 +19,7 @@ const defaultOptions = {
   enableUrlEndpoint: false,
   allowLocalUrls: false,
   periodicPingUrls: [],
-  streamingUpload: false,
+  streamingUpload: true,
   clientSocketConnectTimeout: 60000,
   metrics: true,
 }

+ 1 - 1
packages/@uppy/companion/src/standalone/helper.js

@@ -181,7 +181,7 @@ const getConfigFromEnv = () => {
     allowLocalUrls: process.env.COMPANION_ALLOW_LOCAL_URLS === 'true',
     // cookieDomain is kind of a hack to support distributed systems. This should be improved but we never got so far.
     cookieDomain: process.env.COMPANION_COOKIE_DOMAIN,
-    streamingUpload: process.env.COMPANION_STREAMING_UPLOAD === 'true',
+    streamingUpload: process.env.COMPANION_STREAMING_UPLOAD ? process.env.COMPANION_STREAMING_UPLOAD === 'true' : undefined,
     maxFileSize: process.env.COMPANION_MAX_FILE_SIZE ? parseInt(process.env.COMPANION_MAX_FILE_SIZE, 10) : undefined,
     chunkSize: process.env.COMPANION_CHUNK_SIZE ? parseInt(process.env.COMPANION_CHUNK_SIZE, 10) : undefined,
     clientSocketConnectTimeout: process.env.COMPANION_CLIENT_SOCKET_CONNECT_TIMEOUT