* 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>
* 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>
* 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:

All of the downward peaks are `setState()` calls and GC.
Now it takes around 60ms, and looks like this:

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.

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.

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>
* 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
🎉
* 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
* 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
* 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