Commit graph

116 commits

Author SHA1 Message Date
Antoine du Hamel
2ef662140b
@uppy/transloadit: fix assemblyOptions option (#4316) 2023-02-13 18:33:42 +01:00
Merlijn Vos
2e825346b6
@uppy/transloadit: introduce assemblyOptions, deprecate other options (#4059) 2022-12-01 16:46:43 -03:00
Antoine du Hamel
4e26eb0212
@uppy/transloadit: improve deprecation notice (#4056) 2022-08-30 10:10:19 +02:00
Antoine du Hamel
e0f17e3753
meta: fix linter warnings (#4039) 2022-08-23 16:08:08 +02:00
Merlijn Vos
d7180dbb3c
@uppy/tus, @uppy/xhr-upload, @uppy/aws-s3: metaFields -> allowedMetaFields (#4023) 2022-08-22 16:48:39 +02:00
Antoine du Hamel
1efa053e45
@uppy/transloadit: deprecate static properties, export new names (#3987) 2022-08-16 18:01:17 +02:00
Antoine du Hamel
e65db58b29
@uppy/utils: use exports map (#3985) 2022-08-16 15:40:35 +02:00
Merlijn Vos
9a213b59da
Fix all breaking todo comments for 3.0 (#3907)
- `@uppy/aws/s3-multipart`: remove `client` getter and setter.
  - reason: internal usage only
  - migrate: use exposed options only
- `@uppy/core`: remove `AggregateError` polyfill
  - reason: [should be polyfilled by the user](https://github.com/transloadit/uppy/pull/3532#discussion_r818602636)
  - migrate: install `AggregateError` polyfill or use `core-js`
- `@uppy/core`: remove `reset()` method
  - reason: it's a duplicate of `cancelAll`, but with a less intention revealing name
  - migrate: use `cancelAll`
- `@uppy/core`: remove backwards compatible exports (static properties on `Uppy`)
  - reason: transition to ESM
  - migrate: import the `Uppy` class by default and/or use named exports for everything else.
- `@uppy/react`: don't expose `validProps`
  - reason: internal only
  - migrate: do not depend on this
- `@uppy/store-redux`: remove backwards compatible exports (static properties on `ReduxStore`)
  - reason: transition to ESM
  - migrate: use named imports
- `@uppy/thumbnail-generator`: remove `rotateImage`, `protect`, and `canvasToBlob` from prototype.
  - reason: internal only
  - migrate: don't depend on this
2022-08-03 20:07:24 +02:00
Antoine du Hamel
003b9518b3 Merge stable branch 2022-08-03 11:54:15 +02:00
Antoine du Hamel
376e3aa8f7
@uppy/transloadit: send assembly-cancelled only once (#3937) 2022-08-02 18:28:58 +02:00
Antoine du Hamel
a38ae901ed
@uppy/transloadit: remove static properties in favor of exports (#3927) 2022-08-02 13:17:57 +02:00
Antoine du Hamel
2e8f79787b
Merge stable branch 2022-07-27 19:47:25 +02:00
Antoine du Hamel
f808e9d741
@uppy/transloadit: cancel assemblies when all its files have been removed (#3893)
When starting an upload and removing it right away, it creates a race
condition when the assembly is created with no files and is never
closed. This commit ensures that the assembly is closed if all files
have been removed, or updated with the new expected number of
files otherwise.

Co-authored-by: Aaron Heimlich <aaron.heimlich@gmail.com>
2022-07-27 18:17:48 +02:00
Merlijn Vos
43fb673372
@uppy/transloadit: fix outdated file ids and incorrect usage of files (#3886)
* Fix outdated file ids and incorrect usage of files

* add e2e test

* Update packages/@uppy/transloadit/src/index.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2022-07-15 00:25:57 +01:00
Antoine du Hamel
418b25c39a
@uppy/transloadit: fix TypeError when file is cancelled asynchronously (#3872)
Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2022-07-11 15:06:26 +02:00
Antoine du Hamel
f36c732e73
@uppy/robodog,@uppy/transloadit: use modern syntax to simplify code (#3873) 2022-07-11 11:07:30 +02:00
Antoine du Hamel
4bdfbe7c48 Merge stable branch 2022-07-06 18:01:19 +02:00
Merlijn Vos
2925edb5aa
Fix undefined error in in onTusError (#3848) 2022-06-28 13:18:14 +02:00
Antoine du Hamel
a6029d0304 Merge stable branch 2022-06-09 21:15:10 +02:00
Antoine du Hamel
6355c23166
@uppy/transloadit: fix COMPANION_PATTERN export (#3820)
The export was renamed during during the ESM transition, which was an unintended breaking change. This commit restores the missing export.

Refs: https://github.com/transloadit/uppy/pull/3725
2022-06-09 13:09:36 +02:00
Antoine du Hamel
c223a1f204
@uppy/transloadit: remove IE 10 hack (#3777) 2022-05-30 18:32:53 +02:00
Renée Kooi
3121fae11b
transloadit: propagate error details when creating Assembly fails (#3794)
* transloadit: propagate error details when creating Assembly fails

Clients are expected to use `error.assembly` to inspect details about
failed Assemblies, but then we do need to always give that property
back.

I think we should have a test for this but not sure how to approach it,
since it depends on responses from the Transloadit API. I guess we'd
require a new e2e test for it?

* Apply suggestions from code review

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-05-30 16:50:30 +01:00
Antoine du Hamel
5a8a8d35be
meta: prepare test files for lint rule hardening (#3761) 2022-05-23 12:02:19 +02:00
Antoine du Hamel
3f5a03f504
@uppy/transloadit: refactor to ESM (#3725) 2022-05-17 15:17:50 +02:00
Antoine du Hamel
1413672f7c
@uppy/transloadit: add rate limiting for assembly creation and status polling (#3718)
Share one instance of `RateLimitedQueue` between Tus plugin and
Transloadit plugin, ensure all requests to transloadit.com go through
the `RateLimitedQueue` to handle rate limiting response globally.
2022-05-13 17:05:07 +02:00
Mikael Finstad
8ed210545c
proposal: Cancel assemblies optional (#3575)
* change cancel logic

to make canceling assemblies optional
possibly fixes #3547

* add forgotten file

* rewrite to reason='user'

* try to fix crash

* change reason to unmount

* Apply suggestions from code review

* add close+unmount in more code examples

also fix rule of hooks issue

* improve reason docs

* add tests

* add options also to reset

* update doc

* also prevent canceling uploads on unmount

* Update website/src/docs/transloadit.md

Co-authored-by: Merlijn Vos <merlijn@soverin.net>

* remove conflicting file

Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2022-05-06 01:53:46 +07:00
Antoine du Hamel
dceac85af5
@uppy/transloadit: improve fetch error handling (#3637)
Returning a non-2xx code is not a `NetworkError`, it's a rejection from
the server and we should handle it as such.
2022-04-19 19:15:40 +02:00
Renée Kooi
b22a812db3
Propagate isNetworkError through error wrappers (#3620)
The `ErrorWithCause` class uses the same signature as the builtin Error
does, but it supports the `{ cause }` option in older environments, and
it propagates the `isNetworkError` property from the underlying error.
2022-04-05 15:57:25 +02:00
Antoine du Hamel
aba7b29662
@uppy/transloadit: close assembly if upload is cancelled (#3591)
Fixes: https://github.com/transloadit/uppy/issues/3156
2022-03-24 13:57:00 +01:00
Antoine du Hamel
cc82f33137
@uppy/transloadit: fix handling of Tus errors and rate limiting (#3429) 2022-01-12 18:24:11 +03:00
Antoine du Hamel
fdb3c5e51d
@uppy/transloadit: simplify #onTusError (#3419)
And fixes few ESLint warnings
2022-01-11 14:02:07 +01:00
Antoine du Hamel
e2c62594a1
@uppy/transloadit: ignore rate limiting errors when polling (#3418)
Fixes: https://github.com/transloadit/uppy/issues/3156
2022-01-10 19:36:13 +01:00
Antoine du Hamel
fa140ead94
@uppy/transloadit: better defaults for rate limiting (#3414) 2022-01-10 15:33:05 +01:00
Antoine du Hamel
cd8af60bfb
examples: update angular-example to Angular v13 (#3325)
* examples: update angular-example to Angular v13

* meta: upgrade TS version accross the board

* meta: upgrade ESLint packages

* Fix angular-examples tests

* bump lock file

* fix type conflict

* Upgrade `ng-packagr`
2021-11-22 19:12:56 +01:00
Merlijn Vos
00094af525
Refactor locale scripts & generate types and docs (#3276)
Closes #3232 

### Summary

- Create `locale.js` for every plugin instead of `this.defaultLocale` in the class
- Complete refactor of locale scripts
  - No dynamic plugin class imports with hacks to mimic the environment in order to get the `defaultLocale`.
  - Separate tests and build in separate files
  - Add two modes for test file, `unused` (fails hard) and `warnings`
- Generate docs
  - Use remark to cleanly mutate the file
  - Rename some doc files to match the plugin name (such as `statusbar` --> `status-bar`)
  - Comments in `locale.js` are kept and are present in the docs as well.
- Generate types
2021-11-10 11:43:04 +01:00
Kevin van Zonneveld
bfe659820e
Upgrade linting to 2.0.0-0 (#3280)
* Upgrade linting to 2.0.0-0

* Adjust so we can pass without error

* Fix linting

* Update header-blacklist.js

* Update index.js

* Update Uppy.js

* Update Components.js

* Update StatusBar.js

* Update Assembly.js

* Upgrade to linting 2.0.0 (final release)
2021-11-09 11:19:05 +00:00
Antoine du Hamel
7cad0130dd
ci: fix tranloadit2 e2e tests (#3270)
* ci: fix tranloadit2 e2e tests

* ci: Re-enable tranloadit tests

* ci: update settings

* improve comments

* Remove cropping step from transloadit2 e2e test

* add steps back

* remove template id

* increase timeout

* transloadit2

* Re-enable all e2e tests

Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2021-10-19 15:23:32 +01:00
Antoine du Hamel
8fbabe4223
@uppy/transloadit: pass fields to transloadit (#3228)
* @uppy/transloadit: pass fields to transloadit

Co-authored-by: Merlijn Vos <Murderlon@users.noreply.github.com>
Fixes: https://github.com/transloadit/uppy/issues/3189

* inline `normalizeAssemblyOptions`

Co-authored-by: Merlijn Vos <Murderlon@users.noreply.github.com>
2021-10-06 14:25:01 +02:00
Antoine du Hamel
d69031524c
@uppy/core: move Uppy class to its own module (#3225)
* @uppy/core: move `Uppy` class to its own module

Fixes: https://github.com/transloadit/uppy/issues/3220

* Rename snapshot file

* Update docs

* Update website/src/_posts/2021-08-2.0.md

Co-authored-by: Merlijn Vos <merlijn@soverin.net>

* Update migration guide

* Do not bundle preact with non-UI plugin packages

Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2021-09-28 19:04:33 +02:00
Antoine du Hamel
b364708715
@uppy/transloadit: fix unhandledPromiseRejection failures (#3197)
* @uppy/transloadit: fix unhandledPromiseRejection failures

Fixes: https://github.com/transloadit/uppy/issues/3189

* Add transloadit2 to end2end test matrix
2021-09-16 15:24:20 +02:00
Artur Paikin
86cb2294b0
remove resume option from transloadit plugin (#3149) 2021-09-03 01:55:23 +01:00
Antoine du Hamel
ec87b232e9
meta: enforce no-unused-vars linter rule (#3118)
* meta: enforce `no-unused-vars` linter rule

* meta: fix `@typescript-eslint/no-unused-vars` linter warnings

* meta: enforce `no-unused-expressions` lint rule

* @uppy/companion: fix `tsc` build
2021-08-23 13:10:17 +01:00
Antoine du Hamel
6b7ad5e7c7
Stricter linter (#3095)
* enforce some eslint rules

* enforce accessibility linter rules

* harden lint rules with only 1 or 2 warnings

* fix remaining rules with less than 3 warnings

* fix e2e tests

* fix remaining rules with less than 4 warnings

* fix remaining rules with less than 6 warnings

* fix `shuffleTaglines`

* fix companion build
2021-08-17 20:32:57 +02:00
Antoine du Hamel
1d62071b92
@uppy/transloadit: upgrade socket.io-client version (#3065)
* @uppy/transloadit: upgrade `socket.io-client` version

Fixes: https://github.com/transloadit/uppy/issues/2875

* Disable `import/no-extraneous-dependencies` linter rules on website and endtoend files

* fixup! Disable `import/no-extraneous-dependencies` linter rules on website and endtoend files

* fixup! Disable `import/no-extraneous-dependencies` linter rules on website and endtoend files
2021-08-02 20:42:18 +01:00
Antoine du Hamel
86a5572900 @uppy/transloadit: fix tests on v16.x 2021-08-02 16:12:14 +02:00
Artur Paikin
4ca78ab543
Set plugin titles from locale (#3023)
* What is happening "*"

* Instead of re-creating i18nInit, we could just make it part of the BasePlugin

* set plugin title and allow changing it from locale

* remove i18nInit method, since we now include it in BasePlugin

* All provider titles should come from locale

* Update en_US.js

* make translator private

//cc @aduh95

* init locale after calling setOptions

* Update en_US.js

* Update packages/@uppy/core/src/BasePlugin.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update packages/@uppy/core/src/index.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Bind `i18n` functions

* Remove duplicate i18nInit — it’s in BasePlugin already

* fix formatting

* fix name

* Update en_US.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-07-30 13:02:32 +01:00
Antoine du Hamel
9a46b0d2da
@uppy/transloadit: refactor to use private properties (#3019) 2021-07-21 17:38:24 +02:00
Merlijn Vos
f01538ba41
Resolve all type TODO's (#2963) 2021-07-20 14:40:31 +02:00
Antoine du Hamel
d40b5241db
core: remove more IE hacks (#3015)
We can now use `Object.fromEntries`, `Object.values`, and `Symbol`.
Also changes polyfill suggestion for legacy browsers to use `core-js`
which includes almost all we need and more.
2021-07-16 09:27:51 +02:00
Artur Paikin
ce959456ed
companion: Remove deprecated serverHeaders in favour of companionHeaders (#2995)
* remove deprecated serverHeaders in favour of companionHeaders

* remove TL_UPPY_SERVER and exports.UPPY_SERVER

@kvz @goto-bus-stop ok to do this already, right?
2021-07-08 18:10:14 +01:00