Ver Fonte

core: Remove deprecated get state and allowMultipleUploads option in Core (#3982)

* Remove deprecated get state and allowMultipleUploads option in Core

* Fix tests?

* core.getState()
Artur Paikin há 2 anos atrás
pai
commit
c042f0220b

+ 0 - 14
packages/@uppy/core/src/Uppy.js

@@ -55,10 +55,6 @@ class Uppy {
     const defaultOptions = {
       id: 'uppy',
       autoProceed: false,
-      /**
-       * @deprecated The method should not be used
-       */
-      allowMultipleUploads: true,
       allowMultipleUploadBatches: true,
       debug: false,
       restrictions: defaultRestrictionOptions,
@@ -182,16 +178,6 @@ class Uppy {
     return this.store.getState()
   }
 
-  /**
-   * Back compat for when uppy.state is used instead of uppy.getState().
-   *
-   * @deprecated
-   */
-  get state () {
-    // Here, state is a non-enumerable property.
-    return this.getState()
-  }
-
   /**
    * Shorthand to set state for a specific file.
    */

+ 2 - 2
packages/@uppy/core/src/Uppy.test.js

@@ -1254,7 +1254,7 @@ describe('src/Core', () => {
           foo: 'bar',
         },
       })
-      expect(core.state.meta).toMatchObject({
+      expect(core.getState().meta).toMatchObject({
         foo: 'bar',
       })
 
@@ -1264,7 +1264,7 @@ describe('src/Core', () => {
         },
       })
 
-      expect(core.state.meta).toMatchObject({
+      expect(core.getState().meta).toMatchObject({
         foo: 'bar',
         beep: 'boop',
       })

+ 1 - 0
packages/uppy/package.json

@@ -53,6 +53,7 @@
     "@uppy/onedrive": "workspace:^",
     "@uppy/progress-bar": "workspace:^",
     "@uppy/provider-views": "workspace:^",
+    "@uppy/remote-sources": "workspace:^",
     "@uppy/redux-dev-tools": "workspace:^",
     "@uppy/screen-capture": "workspace:^",
     "@uppy/status-bar": "workspace:^",

+ 2 - 1
yarn.lock

@@ -10477,7 +10477,7 @@ __metadata:
   languageName: unknown
   linkType: soft
 
-"@uppy/remote-sources@workspace:packages/@uppy/remote-sources":
+"@uppy/remote-sources@workspace:^, @uppy/remote-sources@workspace:packages/@uppy/remote-sources":
   version: 0.0.0-use.local
   resolution: "@uppy/remote-sources@workspace:packages/@uppy/remote-sources"
   dependencies:
@@ -40354,6 +40354,7 @@ hexo-filter-github-emojis@arturi/hexo-filter-github-emojis:
     "@uppy/progress-bar": "workspace:^"
     "@uppy/provider-views": "workspace:^"
     "@uppy/redux-dev-tools": "workspace:^"
+    "@uppy/remote-sources": "workspace:^"
     "@uppy/screen-capture": "workspace:^"
     "@uppy/status-bar": "workspace:^"
     "@uppy/store-default": "workspace:^"