Commit graph

99 commits

Author SHA1 Message Date
Artur Paikin
4b782ffbbb Release 2021-06-30 23:07:21 +01:00
Artur Paikin
23e4a537a6 Release 2021-05-28 11:54:17 +01:00
Artur Paikin
12b7bd34e8 Release 2021-05-27 21:35:08 +01:00
Artur Paikin
1751241362 Release 2021-03-31 23:59:08 +01:00
Kevin van Zonneveld
764c2ccada
Update Linter (#2796)
* relocate .vscode

* Switch to transloadit linter

* Update .eslintrc.json

* autofix code

* unlink and install eslint-config-transloadit@1.1.1

* Change 0 to "off"

* Don't change 'use strict'

* Do not vertically align

* disable key-spacing

* add import/no-extraneous-dependencies per package

* add more react/a11y warnings

* Revert "autofix code"

This reverts commit 14c8a8cde8.

* add import/no-extraneous-dependencies per example and main package

* autofix code (2)

* Allow devDependencies in ./bin

* Change import/no-extraneous-dependencies to warn again

* upgrade linter

* Set import/no-extraneous-dependencies to warn
2021-03-15 16:25:17 +00:00
Renée Kooi
4bf1072363
Release 2021-03-10 13:11:28 +01:00
Artur Paikin
2eabc33099 Release 2021-02-10 18:55:14 +00:00
Artur Paikin
7c55bd855e Release 2021-01-28 16:08:14 +00:00
Artur Paikin
e1efe07927 Release 2021-01-27 16:22:43 +00:00
Renée Kooi
c81780230d
Add all the CI badges (#2725)
* Add all the CI badges

* flip the CI / npm version order

* add github actions tests badges to all package readmes

* remove |

Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2021-01-13 00:30:59 +00:00
Artur Paikin
1493a807fe Release 2020-12-23 18:04:51 +00:00
ifedapoolarewaju
3ff9ab042f
Release 2020-11-13 11:52:51 +01:00
Artur Paikin
84f7b4d37d Release 2020-10-30 03:27:41 +00:00
ifedapoolarewaju
7bf5ca55a7
Release 2020-09-07 12:40:44 +01:00
Andrew
0533357d61
Remove the --save flag (#2503) 2020-09-04 14:32:21 +02:00
ifedapoolarewaju
36ab6f1d49
Release 2020-07-30 15:52:20 +01:00
Renée Kooi
2d91641ddd
Release 2020-07-29 16:50:45 +02:00
Renée Kooi
8c826313b6
A few docs things (#2371) 2020-07-29 12:17:27 +02:00
Renée Kooi
16686fc0ca
Release 2020-07-15 13:59:56 +02:00
Artur Paikin
b00ba13912 Release 2020-06-13 03:12:22 +01:00
Renée Kooi
6a01523273
Release 2020-05-25 15:51:21 +02:00
ifedapoolarewaju
5528c6f6ea
Release 2020-04-30 12:52:46 +01:00
Renée Kooi
6e2dfd7c0f
Release 2020-04-29 17:45:02 +02:00
ifedapoolarewaju
323233488f
Release 2020-04-15 20:07:42 +01:00
Artur Paikin
5752662a93 Release 2020-04-14 22:25:47 +02:00
ifedapoolarewaju
0481589f3b
Release 2020-04-08 17:37:56 +01:00
ifedapoolarewaju
fa32da7cf3
Release 2020-03-25 12:37:44 +01:00
Artur Paikin
2c98271103 Release 2020-02-14 23:17:48 +01:00
Renée Kooi
be66c47deb
Actually check types (#1918)
* types: stronger typings

* Remove remaining `declare module` things for uppy.use

* Format types standard-style-like

* Add `target` properties to plugin typings

* Add type for `replaceTargetContent` option

* xhr-upload: allow lowercase method

* opt in to stricter typechecks

* use the strictly typed version in all typings tests

* endtoend: use strict types in typescript test

* Add some comments to the typings file so IDEs will warn about untyped use()

* informer: remove obsolete option from typings

* react: generate prop types based on actual options types

* react: update types

* react: fix import in typings test

* companion-client: add `pluginId` property to ProviderOptions type

Co-Authored-By: Ifedapo .A. Olarewaju <ifedapoolarewaju@gmail.com>

* core: remove some `any` types

* *: add locale string types

* *: generate locale typings

* core: fix LocaleStrings<> type

* dashboard: add locale string type tests

* tus: inherit options typings from tus-js-client

* transloadit: add missing options types

* ci: do the required build steps before testing typings

* Support TokenStorage in types, add `title?: string` options

* form: update typings

* types: put TokenStorage type in dependents

* Document Uppy.StrictTypes

* if we pin at least we should use the latest

* Allow document.querySelector

I think it's a eslint-plugin-compat bug that it's marking querySelector
as not available in Android Chrome 78.

Co-authored-by: Ifedapo .A. Olarewaju <ifedapoolarewaju@gmail.com>
2020-02-12 16:22:09 +01:00
Artur Paikin
07e9909bfc Release 2020-02-12 12:24:41 +01:00
Artur Paikin
77ef346cb0 Release 2020-02-11 21:17:04 +01:00
Renée Kooi
2b91a96c95
Release 2020-01-15 16:39:45 +01:00
Renée Kooi
1463ee79ce
Improve performance of adding and removing files (#1949)
* core: add an addFiles() method that only updates state once

Previously, adding 1300-ish files took around 260ms, and looked like
this in Firefox's performance tab:

![Flamegraph](https://i.imgur.com/08veuoU.png)

All of the downward peaks are `setState()` calls and GC.

Now it takes around 60ms, and looks like this:

![Flamegraph](https://i.imgur.com/xFdwVBV.png)

Here, most of the time is spent generating file IDs and guessing file
types. Those would be areas to look at next.

* dashboard: prevent frequent state update if nothing changed

After the last commit, `addFiles()` still spends a lot of time in
`emit()` and `hideAllPanels()`. The reason is that `addFiles()` still
emits all the hundreds of file-added events, and the Dashboard responds
to each with `hideAllPanels()`, which does a state update. But this all
happens synchronously, and the state almost certainly did not change
since the last `file-added` event that fired a millisecond ago.

This adds a check to avoid the state update if it is not necessary.

![Flamegraph](https://i.imgur.com/KhuD035.png)

Adding 1300 files takes about 40ms now.

With this change, the `addFiles()` call is no longer the slowest
part—now preact rendering all the items is!

* utils: optimize generateFileID and getFileNameAndExtension

Replaces some clever things with more mundane and faster things!

Now, generateFileID is a bunch of string concatenations.
Now, getFileNameAndExtension uses `lastIndexOf()` instead of a regex.

![Flamegraph](https://i.imgur.com/ZQ1IhxI.png)

Adding 1300 files takes about 25ms.

* dashboard: use preact-virtual-list

* thumbnail-generator: add `lazy` option

* dashboard: request thumbnails once file item renders the first time

* dashboard: fork preact-virtual-list

* core: add removeFiles() to remove files in bulk

* Implement removeFile() in terms of removeFiles()

* thumbnail-generator: only queue files that can be previewed

* rename size constants to accommodate WIDTH/HEIGHT

* Use new uppy.addFiles in DragDrop and FileInput

* utils: fix getFileNameAndExtension() type

* Rip out the lazy thumbnail generation

* Rip out virtualization.

* Remove virtualization leftovers

* tell future people that this is intentionally verbose

* Update package-lock.json

* henlo i am spell

* Make `addFiles()` respect maxNumberOfFiles

* core: show an informer error if some files fail in bulk add

* locales: fix quotes to make build:locale-pack happy

Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2020-01-13 12:29:08 +01:00
Renée Kooi
18180d5778
Release 2019-12-16 12:53:23 +01:00
Renée Kooi
c370dba0b6
Release 2019-11-04 10:56:06 +01:00
Artur Paikin
4e54483e61 core: setOptions for Core and plugins (#1728)
* Add a method to update options in Core

* Add a method to update options in Plugin (for any plugins)

* Allow re-initializing i18n locales after they’ve been updated with .setOptions

* use rest spread instead of Object.assign

* override setOptions in plugins to include i18nInit

* merge restrictions object in setOptions

* check that newOpts exists

* add spread ...

* don’t double merge

* add i18nInit to all plugins that use translation strings

* add setOptions tests to Core and Dashboard

* add setOptions docs for Core and Plugins

* fix tests for thumbnail-generator by adding plugins: {} to mock core

cause ThumbnailGenerator now calls this.setPluginState, which expects `core.state.plugins`

* also update meta with setOptions if it’s passed, change the way this.opts is set in core

@goto-bus-stop does this look ok? merging restrictions opts in core

* if locale was passed to setOptions(), call plugin.setOptions() on all plugins, so that i18n updates

* add Dashboard test that checks if locale is updated from Core via setOptions()

* Reafactor website Dashboard example to use setOptions and allow selecting a locale

🎉
2019-11-04 10:33:30 +01:00
Renée Kooi
4e32e61d7c
Release 2019-10-09 21:00:46 +02:00
Renée Kooi
733de659da
Upgrade standard to v14 (#1860)
* Update eslint dependencies.

* standard --fix

* build: disable handler name lint rule

* status-bar: manually fix lint errors

* webcam: manually fix lint errors

* url: manually fix lint errors

* react-native: manually fix lint errors

* dashboard: manually fix lint errors

* informer: manually fix linting errors

* progress-bar: manually fix lint errors

* provider-views: manually fix lint errors

* redux-dev-tools: manually fix lint errors

* build: disable buggy no-unused-vars rule

* examples: manually fix lint errors

* ` quotes for code things, ' for text things
2019-10-09 14:53:02 +02:00
Artur Paikin
056a7114a1 Release 2019-08-30 15:24:04 +03:00
Renée Kooi
c62ec3665d Update eslint to v6 (#1777)
* Update eslint

* Do eslint --fix

* Do not access Object.prototype method 'hasOwnProperty' from target object

* utils: add hasProperty

* eslint --fix

* Disable quote-props for locale files

* add back quotes in locale files

* revert locale files to state on master

* Update react-scripts
2019-08-13 21:45:30 +03:00
Renée Kooi
10bc79574e
lerna link convert (#1730)
* lerna link convert

* ci: use npm ci

* update lockfile

* companion: set `bin` to source file

Since typescript doesn't actually transform anything, we can just use
this.

In a next major version we could set `noEmit: true` in the tsconfig and
stop publishing `lib`.

* companion: do chmod +x on start-server.js

* build: remove obsolete lerna config

* build: explicitly install latest versions when building e2e tests for ci

* Remove versions from private packages

* fix regex

* try fix

* ci: force npm to install to endtoend folder

* ci: fold up e2e build output

* Update netlify deploy preview command

* Remove mentions of npm run bootstrap

* Edit .github/CONTRIBUTING.md instead

* companion: add proxy executable

* companion: fix publish

* Downgrade jest to appease create-react-app
2019-07-19 12:16:36 +02:00
Artur Paikin
bd2beedcff Release 2019-07-18 17:21:42 +02:00
Artur Paikin
5e35987079
Log error in uppy.addFile try/catch (#1680)
* Log error in uppy.addFile try/catch

* Add `.isRestriction` to a custom RestrictionError, check for that before logging

* keep throwing for robodog.upload

//cc @goto-bus-stop
2019-06-28 20:25:17 +03:00
Renée Kooi
d57403025e
robodog: use chooseFiles string like @uppy/file-input (#1669)
* robodog: use chooseFiles string like @uppy/file-input

* robodog: add default chooseFiles string

* file-input: add update notice above chooseFiles default

* Add locale docs
2019-06-17 18:38:47 +02:00
Artur Paikin
28d235fe2f Release 2019-06-05 19:07:20 +03:00
Renée Kooi
b64705fce2
New sync version (#1600)
New sync version
2019-06-05 16:19:48 +02:00
Artur Paikin
9926853b18 Clear input[type=file] in FileInput too, updated comments and changed ev to event 2019-05-30 17:46:58 +03:00
Renée Kooi
980210f76c
Add VERSION properties to all plugins.
And remove the proposal-object-rest-spread plugin because it is built
into preset-env now.
2019-05-27 16:53:47 +02:00
Artur Paikin
5c9e1a836d Release 2019-05-17 19:17:03 +03:00
Renée Kooi
1ad322497f
Release 2019-05-08 15:27:15 +02:00