diff --git a/.eslintrc.js b/.eslintrc.js index e022b35ccd..b4a2743cbb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -148,6 +148,7 @@ module.exports = { { files: [ '*.mjs', + 'examples/aws-presigned-url/*.js', 'private/dev/*.js', 'private/release/*.js', 'private/remark-lint-uppy/*.js', diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 069edbc98d..97dc1726d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Tests +name: CI on: [push, pull_request] jobs: diff --git a/.github/workflows/companion-deploy.yml b/.github/workflows/companion-deploy.yml index 9d08465c34..d55a98d1be 100644 --- a/.github/workflows/companion-deploy.yml +++ b/.github/workflows/companion-deploy.yml @@ -1,5 +1,6 @@ name: Companion Deploy + on: push: branches: [main] @@ -43,10 +44,13 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v2 + - name: Alter dockerfile + run: | + sed -i 's/^EXPOSE 3020$/EXPOSE $PORT/g' Dockerfile - name: Deploy to heroku uses: akhileshns/heroku-deploy@v3.12.12 with: - appdir: packages/@uppy/companion heroku_api_key: ${{secrets.HEROKU_API_KEY}} heroku_app_name: companion-demo heroku_email: ${{secrets.HEROKU_EMAIL}} + usedocker: true diff --git a/.gitignore b/.gitignore index d206f42111..922e834c2a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ node_modules yarn-error.log env.sh +*.local dist/ lib/ diff --git a/BACKLOG.md b/BACKLOG.md index 47ba7868cc..1d0f8189d4 100644 --- a/BACKLOG.md +++ b/BACKLOG.md @@ -5,15 +5,13 @@ These are ideas that are planned for specific versions or act as a backlog without a clear date. PRs are welcome! Please do open an issue to discuss first if it's a big feature, priorities may have changed after something was added here. -## `2.3.0` +## `2.4.0` -To be released: 2021-11-29 +To be released: 2022-01-27 -- [ ] plugin: audio/memo recording similar to Webcam #143 #198 (@arturi) - [ ] compressor: move to Uppy repo, add resizing (@arturi) -- [ ] providers: Box on hosted Companion +- [ ] providers: Box on hosted Companion (@arturi, @mifi) - [ ] robodog: research simplifing Robodog — yes to easy “few lines of code Dashboard+Providers+(?Transloadit) experience”, but currently it’s hard to choose between modes, decide what you need (@Murderlon) -- [ ] build: add release automations (@aduh95) ## `3.0.0` diff --git a/BUNDLE-README.md b/BUNDLE-README.md index dce5c3f7cc..7e3e2b26cf 100644 --- a/BUNDLE-README.md +++ b/BUNDLE-README.md @@ -1,7 +1,7 @@ # Uppy Hi, thanks for trying out the bundled version of the Uppy File Uploader. You can use -this from a CDN (``) or bundle it with your webapp. +this from a CDN (``) or bundle it with your webapp. Note that the recommended way to use Uppy is to install it with yarn/npm and use a bundler like Webpack so that you can create a smaller custom build with only the diff --git a/CHANGELOG.md b/CHANGELOG.md index d2ea2f9d4b..ff704fd259 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,42 @@ Please add your entries in this format: In the current stage we aim to release a new version at least every month. +## 2.4.0 + +Released: 2022-01-10 + +| Package | Version | Package | Version | +| -------------------- | ------- | -------------------- | ------- | +| @uppy/drag-drop | 2.0.6 | @uppy/tus | 2.2.0 | +| @uppy/image-editor | 1.1.1 | @uppy/utils | 4.0.5 | +| @uppy/screen-capture | 2.0.6 | @uppy/robodog | 2.2.0 | +| @uppy/transloadit | 2.1.0 | uppy | 2.4.0 | + +- @uppy/transloadit: ignore rate limiting errors when polling (Antoine du Hamel / #3418) +- @uppy/tus: pause all requests in response to server rate limiting (Antoine du Hamel / #3394) +- @uppy/transloadit: better defaults for rate limiting (Antoine du Hamel / #3414) +- @uppy/companion: Fix Companion deploys (kiloreux / #3388) +- meta: update aws-presigned-url example to use esm (Antoine du Hamel / #3413) +- @uppy/image-editor: namespace input range css (Merlijn Vos / #3406) +- @uppy/screen-capture: Add missing option to the screen capture types (Mustafa Navruz / #3400) +- @uppy/drag-drop: fix `undefined is not a function` TypeError (Antoine du Hamel / #3397) +- website: update december 2021 blog post (Antoine du Hamel / #3396) +- website: Polished the latest update blog (AJvanLoon / #3390) +- website: docs: fix typo in audio.md (heocoi / #3389) +- website: 2.0-2.3 post draft (Artur Paikin / #3370) + + +## 2.3.3 + +Released: 2022-01-04 + +| Package | Version | Package | Version | +| --------------- | ------- | --------------- | ------- | +| @uppy/companion | 3.1.5 | uppy | 2.3.3 | + +- @uppy/companion: improve private ip check (Mikael Finstad / #3403) + + ## 2.3.2 Released: 2021-12-21 diff --git a/README.md b/README.md index 8db41dde61..9fe5787cba 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ $ npm install @uppy/core @uppy/dashboard @uppy/tus We recommend installing from npm and then using a module bundler such as [Webpack](https://webpack.js.org/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/). -Add CSS [uppy.min.css](https://releases.transloadit.com/uppy/v2.3.2/uppy.min.css), either to your HTML page’s `` or include in JS, if your bundler of choice supports it — transforms and plugins are available for Browserify and Webpack. +Add CSS [uppy.min.css](https://releases.transloadit.com/uppy/v2.4.0/uppy.min.css), either to your HTML page’s `` or include in JS, if your bundler of choice supports it — transforms and plugins are available for Browserify and Webpack. Alternatively, you can also use a pre-built bundle from Transloadit’s CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object. @@ -77,10 +77,10 @@ Alternatively, you can also use a pre-built bundle from Transloadit’s CDN: Edg ```html - + - +
@@ -190,7 +190,7 @@ If you’re using Uppy from CDN, those polyfills are already included in the leg bundle, so no need to include anything additionally: ```html - + ``` ## FAQ @@ -247,13 +247,13 @@ Use Uppy in your project? [Let us know](https://github.com/transloadit/uppy/issu ## Contributors -[arturi](https://github.com/arturi) |[goto-bus-stop](https://github.com/goto-bus-stop) |[kvz](https://github.com/kvz) |[ifedapoolarewaju](https://github.com/ifedapoolarewaju) |[hedgerh](https://github.com/hedgerh) |[AJvanLoon](https://github.com/AJvanLoon) | +[arturi](https://github.com/arturi) |[goto-bus-stop](https://github.com/goto-bus-stop) |[kvz](https://github.com/kvz) |[ifedapoolarewaju](https://github.com/ifedapoolarewaju) |[hedgerh](https://github.com/hedgerh) |[aduh95](https://github.com/aduh95) | :---: |:---: |:---: |:---: |:---: |:---: | -[arturi](https://github.com/arturi) |[goto-bus-stop](https://github.com/goto-bus-stop) |[kvz](https://github.com/kvz) |[ifedapoolarewaju](https://github.com/ifedapoolarewaju) |[hedgerh](https://github.com/hedgerh) |[AJvanLoon](https://github.com/AJvanLoon) | +[arturi](https://github.com/arturi) |[goto-bus-stop](https://github.com/goto-bus-stop) |[kvz](https://github.com/kvz) |[ifedapoolarewaju](https://github.com/ifedapoolarewaju) |[hedgerh](https://github.com/hedgerh) |[aduh95](https://github.com/aduh95) | -[nqst](https://github.com/nqst) |[aduh95](https://github.com/aduh95) |[Murderlon](https://github.com/Murderlon) |[lakesare](https://github.com/lakesare) |[kiloreux](https://github.com/kiloreux) |[mifi](https://github.com/mifi) | +[AJvanLoon](https://github.com/AJvanLoon) |[nqst](https://github.com/nqst) |[Murderlon](https://github.com/Murderlon) |[lakesare](https://github.com/lakesare) |[kiloreux](https://github.com/kiloreux) |[mifi](https://github.com/mifi) | :---: |:---: |:---: |:---: |:---: |:---: | -[nqst](https://github.com/nqst) |[aduh95](https://github.com/aduh95) |[Murderlon](https://github.com/Murderlon) |[lakesare](https://github.com/lakesare) |[kiloreux](https://github.com/kiloreux) |[mifi](https://github.com/mifi) | +[AJvanLoon](https://github.com/AJvanLoon) |[nqst](https://github.com/nqst) |[Murderlon](https://github.com/Murderlon) |[lakesare](https://github.com/lakesare) |[kiloreux](https://github.com/kiloreux) |[mifi](https://github.com/mifi) | [sadovnychyi](https://github.com/sadovnychyi) |[samuelayo](https://github.com/samuelayo) |[richardwillars](https://github.com/richardwillars) |[ajkachnic](https://github.com/ajkachnic) |[dependabot[bot]](https://github.com/apps/dependabot) |[zcallan](https://github.com/zcallan) | :---: |:---: |:---: |:---: |:---: |:---: | @@ -271,45 +271,45 @@ Use Uppy in your project? [Let us know](https://github.com/transloadit/uppy/issu :---: |:---: |:---: |:---: |:---: |:---: | [elenalape](https://github.com/elenalape) |[mejiaej](https://github.com/mejiaej) |[gavboulton](https://github.com/gavboulton) |[Hawxy](https://github.com/Hawxy) |[bertho-zero](https://github.com/bertho-zero) |[tranvansang](https://github.com/tranvansang) | -[ap--](https://github.com/ap--) |[mrbatista](https://github.com/mrbatista) |[MikeKovarik](https://github.com/MikeKovarik) |[pauln](https://github.com/pauln) |[toadkicker](https://github.com/toadkicker) |[ofhope](https://github.com/ofhope) | +[ap--](https://github.com/ap--) |[github-actions[bot]](https://github.com/apps/github-actions) |[mrbatista](https://github.com/mrbatista) |[MikeKovarik](https://github.com/MikeKovarik) |[pauln](https://github.com/pauln) |[toadkicker](https://github.com/toadkicker) | :---: |:---: |:---: |:---: |:---: |:---: | -[ap--](https://github.com/ap--) |[mrbatista](https://github.com/mrbatista) |[MikeKovarik](https://github.com/MikeKovarik) |[pauln](https://github.com/pauln) |[toadkicker](https://github.com/toadkicker) |[ofhope](https://github.com/ofhope) | +[ap--](https://github.com/ap--) |[github-actions[bot]](https://github.com/apps/github-actions) |[mrbatista](https://github.com/mrbatista) |[MikeKovarik](https://github.com/MikeKovarik) |[pauln](https://github.com/pauln) |[toadkicker](https://github.com/toadkicker) | -[johnnyperkins](https://github.com/johnnyperkins) |[dargmuesli](https://github.com/dargmuesli) |[juliangruber](https://github.com/juliangruber) |[manuelkiessling](https://github.com/manuelkiessling) |[nndevstudio](https://github.com/nndevstudio) |[ogtfaber](https://github.com/ogtfaber) | +[ofhope](https://github.com/ofhope) |[johnnyperkins](https://github.com/johnnyperkins) |[dargmuesli](https://github.com/dargmuesli) |[juliangruber](https://github.com/juliangruber) |[manuelkiessling](https://github.com/manuelkiessling) |[nndevstudio](https://github.com/nndevstudio) | :---: |:---: |:---: |:---: |:---: |:---: | -[johnnyperkins](https://github.com/johnnyperkins) |[dargmuesli](https://github.com/dargmuesli) |[juliangruber](https://github.com/juliangruber) |[manuelkiessling](https://github.com/manuelkiessling) |[nndevstudio](https://github.com/nndevstudio) |[ogtfaber](https://github.com/ogtfaber) | +[ofhope](https://github.com/ofhope) |[johnnyperkins](https://github.com/johnnyperkins) |[dargmuesli](https://github.com/dargmuesli) |[juliangruber](https://github.com/juliangruber) |[manuelkiessling](https://github.com/manuelkiessling) |[nndevstudio](https://github.com/nndevstudio) | -[sksavant](https://github.com/sksavant) |[suchoproduction](https://github.com/suchoproduction) |[sunil-shrestha](https://github.com/sunil-shrestha) |[timodwhit](https://github.com/timodwhit) |[yonahforst](https://github.com/yonahforst) |[a-kriya](https://github.com/a-kriya) | +[ogtfaber](https://github.com/ogtfaber) |[sksavant](https://github.com/sksavant) |[suchoproduction](https://github.com/suchoproduction) |[sunil-shrestha](https://github.com/sunil-shrestha) |[timodwhit](https://github.com/timodwhit) |[yonahforst](https://github.com/yonahforst) | :---: |:---: |:---: |:---: |:---: |:---: | -[sksavant](https://github.com/sksavant) |[suchoproduction](https://github.com/suchoproduction) |[sunil-shrestha](https://github.com/sunil-shrestha) |[timodwhit](https://github.com/timodwhit) |[yonahforst](https://github.com/yonahforst) |[a-kriya](https://github.com/a-kriya) | +[ogtfaber](https://github.com/ogtfaber) |[sksavant](https://github.com/sksavant) |[suchoproduction](https://github.com/suchoproduction) |[sunil-shrestha](https://github.com/sunil-shrestha) |[timodwhit](https://github.com/timodwhit) |[yonahforst](https://github.com/yonahforst) | -[bencergazda](https://github.com/bencergazda) |[stephentuso](https://github.com/stephentuso) |[jhen0409](https://github.com/jhen0409) |[mskelton](https://github.com/mskelton) |[ahmedkandel](https://github.com/ahmedkandel) |[btrice](https://github.com/btrice) | +[a-kriya](https://github.com/a-kriya) |[bencergazda](https://github.com/bencergazda) |[stephentuso](https://github.com/stephentuso) |[jhen0409](https://github.com/jhen0409) |[mskelton](https://github.com/mskelton) |[ahmedkandel](https://github.com/ahmedkandel) | :---: |:---: |:---: |:---: |:---: |:---: | -[bencergazda](https://github.com/bencergazda) |[stephentuso](https://github.com/stephentuso) |[jhen0409](https://github.com/jhen0409) |[mskelton](https://github.com/mskelton) |[ahmedkandel](https://github.com/ahmedkandel) |[btrice](https://github.com/btrice) | +[a-kriya](https://github.com/a-kriya) |[bencergazda](https://github.com/bencergazda) |[stephentuso](https://github.com/stephentuso) |[jhen0409](https://github.com/jhen0409) |[mskelton](https://github.com/mskelton) |[ahmedkandel](https://github.com/ahmedkandel) | -[behnammodi](https://github.com/behnammodi) |[BePo65](https://github.com/BePo65) |[Burkes](https://github.com/Burkes) |[craigjennings11](https://github.com/craigjennings11) |[davekiss](https://github.com/davekiss) |[DenysNosov](https://github.com/DenysNosov) | +[btrice](https://github.com/btrice) |[behnammodi](https://github.com/behnammodi) |[BePo65](https://github.com/BePo65) |[Burkes](https://github.com/Burkes) |[craigjennings11](https://github.com/craigjennings11) |[davekiss](https://github.com/davekiss) | :---: |:---: |:---: |:---: |:---: |:---: | -[behnammodi](https://github.com/behnammodi) |[BePo65](https://github.com/BePo65) |[Burkes](https://github.com/Burkes) |[craigjennings11](https://github.com/craigjennings11) |[davekiss](https://github.com/davekiss) |[DenysNosov](https://github.com/DenysNosov) | +[btrice](https://github.com/btrice) |[behnammodi](https://github.com/behnammodi) |[BePo65](https://github.com/BePo65) |[Burkes](https://github.com/Burkes) |[craigjennings11](https://github.com/craigjennings11) |[davekiss](https://github.com/davekiss) | -[ethanwillis](https://github.com/ethanwillis) |[frobinsonj](https://github.com/frobinsonj) |[geertclerx](https://github.com/geertclerx) |[ghasrfakhri](https://github.com/ghasrfakhri) |[jasonbosco](https://github.com/jasonbosco) |[jedwood](https://github.com/jedwood) | +[DenysNosov](https://github.com/DenysNosov) |[ethanwillis](https://github.com/ethanwillis) |[frobinsonj](https://github.com/frobinsonj) |[geertclerx](https://github.com/geertclerx) |[ghasrfakhri](https://github.com/ghasrfakhri) |[jasonbosco](https://github.com/jasonbosco) | :---: |:---: |:---: |:---: |:---: |:---: | -[ethanwillis](https://github.com/ethanwillis) |[frobinsonj](https://github.com/frobinsonj) |[geertclerx](https://github.com/geertclerx) |[ghasrfakhri](https://github.com/ghasrfakhri) |[jasonbosco](https://github.com/jasonbosco) |[jedwood](https://github.com/jedwood) | +[DenysNosov](https://github.com/DenysNosov) |[ethanwillis](https://github.com/ethanwillis) |[frobinsonj](https://github.com/frobinsonj) |[geertclerx](https://github.com/geertclerx) |[ghasrfakhri](https://github.com/ghasrfakhri) |[jasonbosco](https://github.com/jasonbosco) | -[dogrocker](https://github.com/dogrocker) |[lamartire](https://github.com/lamartire) |[lafe](https://github.com/lafe) |[Mactaivsh](https://github.com/Mactaivsh) |[maferland](https://github.com/maferland) |[Martin005](https://github.com/Martin005) | +[jedwood](https://github.com/jedwood) |[dogrocker](https://github.com/dogrocker) |[lamartire](https://github.com/lamartire) |[lafe](https://github.com/lafe) |[Mactaivsh](https://github.com/Mactaivsh) |[maferland](https://github.com/maferland) | :---: |:---: |:---: |:---: |:---: |:---: | -[dogrocker](https://github.com/dogrocker) |[lamartire](https://github.com/lamartire) |[lafe](https://github.com/lafe) |[Mactaivsh](https://github.com/Mactaivsh) |[maferland](https://github.com/maferland) |[Martin005](https://github.com/Martin005) | +[jedwood](https://github.com/jedwood) |[dogrocker](https://github.com/dogrocker) |[lamartire](https://github.com/lamartire) |[lafe](https://github.com/lafe) |[Mactaivsh](https://github.com/Mactaivsh) |[maferland](https://github.com/maferland) | -[martiuslim](https://github.com/martiuslim) |[MatthiasKunnen](https://github.com/MatthiasKunnen) |[msand](https://github.com/msand) |[paescuj](https://github.com/paescuj) |[richartkeil](https://github.com/richartkeil) |[richmeij](https://github.com/richmeij) | +[Martin005](https://github.com/Martin005) |[martiuslim](https://github.com/martiuslim) |[MatthiasKunnen](https://github.com/MatthiasKunnen) |[msand](https://github.com/msand) |[paescuj](https://github.com/paescuj) |[richartkeil](https://github.com/richartkeil) | :---: |:---: |:---: |:---: |:---: |:---: | -[martiuslim](https://github.com/martiuslim) |[MatthiasKunnen](https://github.com/MatthiasKunnen) |[msand](https://github.com/msand) |[paescuj](https://github.com/paescuj) |[richartkeil](https://github.com/richartkeil) |[richmeij](https://github.com/richmeij) | +[Martin005](https://github.com/Martin005) |[martiuslim](https://github.com/martiuslim) |[MatthiasKunnen](https://github.com/MatthiasKunnen) |[msand](https://github.com/msand) |[paescuj](https://github.com/paescuj) |[richartkeil](https://github.com/richartkeil) | -[rosenfeld](https://github.com/rosenfeld) |[jrschumacher](https://github.com/jrschumacher) |[ThomasG77](https://github.com/ThomasG77) |[sparanoid](https://github.com/sparanoid) |[zhuangya](https://github.com/zhuangya) |[yaegor](https://github.com/yaegor) | +[richmeij](https://github.com/richmeij) |[rosenfeld](https://github.com/rosenfeld) |[jrschumacher](https://github.com/jrschumacher) |[ThomasG77](https://github.com/ThomasG77) |[sparanoid](https://github.com/sparanoid) |[zhuangya](https://github.com/zhuangya) | :---: |:---: |:---: |:---: |:---: |:---: | -[rosenfeld](https://github.com/rosenfeld) |[jrschumacher](https://github.com/jrschumacher) |[ThomasG77](https://github.com/ThomasG77) |[sparanoid](https://github.com/sparanoid) |[zhuangya](https://github.com/zhuangya) |[yaegor](https://github.com/yaegor) | +[richmeij](https://github.com/richmeij) |[rosenfeld](https://github.com/rosenfeld) |[jrschumacher](https://github.com/jrschumacher) |[ThomasG77](https://github.com/ThomasG77) |[sparanoid](https://github.com/sparanoid) |[zhuangya](https://github.com/zhuangya) | -[allenfantasy](https://github.com/allenfantasy) |[Zyclotrop-j](https://github.com/Zyclotrop-j) |[anark](https://github.com/anark) |[fortrieb](https://github.com/fortrieb) |[github-actions[bot]](https://github.com/apps/github-actions) |[jarey](https://github.com/jarey) | +[yaegor](https://github.com/yaegor) |[allenfantasy](https://github.com/allenfantasy) |[Zyclotrop-j](https://github.com/Zyclotrop-j) |[anark](https://github.com/anark) |[fortrieb](https://github.com/fortrieb) |[jarey](https://github.com/jarey) | :---: |:---: |:---: |:---: |:---: |:---: | -[allenfantasy](https://github.com/allenfantasy) |[Zyclotrop-j](https://github.com/Zyclotrop-j) |[anark](https://github.com/anark) |[fortrieb](https://github.com/fortrieb) |[github-actions[bot]](https://github.com/apps/github-actions) |[jarey](https://github.com/jarey) | +[yaegor](https://github.com/yaegor) |[allenfantasy](https://github.com/allenfantasy) |[Zyclotrop-j](https://github.com/Zyclotrop-j) |[anark](https://github.com/anark) |[fortrieb](https://github.com/fortrieb) |[jarey](https://github.com/jarey) | [muhammadInam](https://github.com/muhammadInam) |[rettgerst](https://github.com/rettgerst) |[mkabatek](https://github.com/mkabatek) |[jukakoski](https://github.com/jukakoski) |[olemoign](https://github.com/olemoign) |[ajschmidt8](https://github.com/ajschmidt8) | :---: |:---: |:---: |:---: |:---: |:---: | @@ -371,29 +371,29 @@ Use Uppy in your project? [Let us know](https://github.com/transloadit/uppy/issu :---: |:---: |:---: |:---: |:---: |:---: | [janwilts](https://github.com/janwilts) |[vith](https://github.com/vith) |[jessica-coursera](https://github.com/jessica-coursera) |[Jmales](https://github.com/Jmales) |[theJoeBiz](https://github.com/theJoeBiz) |[profsmallpine](https://github.com/profsmallpine) | -[chromacoma](https://github.com/chromacoma) |[jonathanarbely](https://github.com/jonathanarbely) |[jderrough](https://github.com/jderrough) |[jonathanly](https://github.com/jonathanly) |[jorgeepc](https://github.com/jorgeepc) |[jszobody](https://github.com/jszobody) | +[chromacoma](https://github.com/chromacoma) |[jonathanarbely](https://github.com/jonathanarbely) |[jderrough](https://github.com/jderrough) |[jorgeepc](https://github.com/jorgeepc) |[jszobody](https://github.com/jszobody) |[julianocomg](https://github.com/julianocomg) | :---: |:---: |:---: |:---: |:---: |:---: | -[chromacoma](https://github.com/chromacoma) |[jonathanarbely](https://github.com/jonathanarbely) |[jderrough](https://github.com/jderrough) |[jonathanly](https://github.com/jonathanly) |[jorgeepc](https://github.com/jorgeepc) |[jszobody](https://github.com/jszobody) | +[chromacoma](https://github.com/chromacoma) |[jonathanarbely](https://github.com/jonathanarbely) |[jderrough](https://github.com/jderrough) |[jorgeepc](https://github.com/jorgeepc) |[jszobody](https://github.com/jszobody) |[julianocomg](https://github.com/julianocomg) | -[julianocomg](https://github.com/julianocomg) |[jmontoyaa](https://github.com/jmontoyaa) |[tykarol](https://github.com/tykarol) |[firesharkstudios](https://github.com/firesharkstudios) |[elkebab](https://github.com/elkebab) |[kyleparisi](https://github.com/kyleparisi) | +[jmontoyaa](https://github.com/jmontoyaa) |[tykarol](https://github.com/tykarol) |[firesharkstudios](https://github.com/firesharkstudios) |[elkebab](https://github.com/elkebab) |[kyleparisi](https://github.com/kyleparisi) |[leaanthony](https://github.com/leaanthony) | :---: |:---: |:---: |:---: |:---: |:---: | -[julianocomg](https://github.com/julianocomg) |[jmontoyaa](https://github.com/jmontoyaa) |[tykarol](https://github.com/tykarol) |[firesharkstudios](https://github.com/firesharkstudios) |[elkebab](https://github.com/elkebab) |[kyleparisi](https://github.com/kyleparisi) | +[jmontoyaa](https://github.com/jmontoyaa) |[tykarol](https://github.com/tykarol) |[firesharkstudios](https://github.com/firesharkstudios) |[elkebab](https://github.com/elkebab) |[kyleparisi](https://github.com/kyleparisi) |[leaanthony](https://github.com/leaanthony) | -[leaanthony](https://github.com/leaanthony) |[larowlan](https://github.com/larowlan) |[dviry](https://github.com/dviry) |[galli-leo](https://github.com/galli-leo) |[leods92](https://github.com/leods92) |[louim](https://github.com/louim) | +[larowlan](https://github.com/larowlan) |[dviry](https://github.com/dviry) |[galli-leo](https://github.com/galli-leo) |[leods92](https://github.com/leods92) |[louim](https://github.com/louim) |[lucaperret](https://github.com/lucaperret) | :---: |:---: |:---: |:---: |:---: |:---: | -[leaanthony](https://github.com/leaanthony) |[larowlan](https://github.com/larowlan) |[dviry](https://github.com/dviry) |[galli-leo](https://github.com/galli-leo) |[leods92](https://github.com/leods92) |[louim](https://github.com/louim) | +[larowlan](https://github.com/larowlan) |[dviry](https://github.com/dviry) |[galli-leo](https://github.com/galli-leo) |[leods92](https://github.com/leods92) |[louim](https://github.com/louim) |[lucaperret](https://github.com/lucaperret) | -[lucaperret](https://github.com/lucaperret) |[lucax88x](https://github.com/lucax88x) |[onhate](https://github.com/onhate) |[mperrando](https://github.com/mperrando) |[marcosthejew](https://github.com/marcosthejew) |[marcusforsberg](https://github.com/marcusforsberg) | +[lucax88x](https://github.com/lucax88x) |[onhate](https://github.com/onhate) |[mperrando](https://github.com/mperrando) |[marcosthejew](https://github.com/marcosthejew) |[marcusforsberg](https://github.com/marcusforsberg) |[Acconut](https://github.com/Acconut) | :---: |:---: |:---: |:---: |:---: |:---: | -[lucaperret](https://github.com/lucaperret) |[lucax88x](https://github.com/lucax88x) |[onhate](https://github.com/onhate) |[mperrando](https://github.com/mperrando) |[marcosthejew](https://github.com/marcosthejew) |[marcusforsberg](https://github.com/marcusforsberg) | +[lucax88x](https://github.com/lucax88x) |[onhate](https://github.com/onhate) |[mperrando](https://github.com/mperrando) |[marcosthejew](https://github.com/marcosthejew) |[marcusforsberg](https://github.com/marcusforsberg) |[Acconut](https://github.com/Acconut) | -[Acconut](https://github.com/Acconut) |[martin-brennan](https://github.com/martin-brennan) |[masaok](https://github.com/masaok) |[mattfik](https://github.com/mattfik) |[matthewhartstonge](https://github.com/matthewhartstonge) |[hrsh](https://github.com/hrsh) | +[martin-brennan](https://github.com/martin-brennan) |[masaok](https://github.com/masaok) |[mattfik](https://github.com/mattfik) |[matthewhartstonge](https://github.com/matthewhartstonge) |[hrsh](https://github.com/hrsh) |[mhulet](https://github.com/mhulet) | :---: |:---: |:---: |:---: |:---: |:---: | -[Acconut](https://github.com/Acconut) |[martin-brennan](https://github.com/martin-brennan) |[masaok](https://github.com/masaok) |[mattfik](https://github.com/mattfik) |[matthewhartstonge](https://github.com/matthewhartstonge) |[hrsh](https://github.com/hrsh) | +[martin-brennan](https://github.com/martin-brennan) |[masaok](https://github.com/masaok) |[mattfik](https://github.com/mattfik) |[matthewhartstonge](https://github.com/matthewhartstonge) |[hrsh](https://github.com/hrsh) |[mhulet](https://github.com/mhulet) | -[mhulet](https://github.com/mhulet) |[mkopinsky](https://github.com/mkopinsky) |[achmiral](https://github.com/achmiral) |[boudra](https://github.com/boudra) |[mnafees](https://github.com/mnafees) |[shahimclt](https://github.com/shahimclt) | +[mkopinsky](https://github.com/mkopinsky) |[achmiral](https://github.com/achmiral) |[boudra](https://github.com/boudra) |[mnafees](https://github.com/mnafees) |[shahimclt](https://github.com/shahimclt) |[navruzm](https://github.com/navruzm) | :---: |:---: |:---: |:---: |:---: |:---: | -[mhulet](https://github.com/mhulet) |[mkopinsky](https://github.com/mkopinsky) |[achmiral](https://github.com/achmiral) |[boudra](https://github.com/boudra) |[mnafees](https://github.com/mnafees) |[shahimclt](https://github.com/shahimclt) | +[mkopinsky](https://github.com/mkopinsky) |[achmiral](https://github.com/achmiral) |[boudra](https://github.com/boudra) |[mnafees](https://github.com/mnafees) |[shahimclt](https://github.com/shahimclt) |[navruzm](https://github.com/navruzm) | [pleasespammelater](https://github.com/pleasespammelater) |[naveed-ahmad](https://github.com/naveed-ahmad) |[nicojones](https://github.com/nicojones) |[coreprocess](https://github.com/coreprocess) |[nil1511](https://github.com/nil1511) |[leftdevel](https://github.com/leftdevel) | :---: |:---: |:---: |:---: |:---: |:---: | @@ -435,21 +435,21 @@ Use Uppy in your project? [Let us know](https://github.com/transloadit/uppy/issu :---: |:---: |:---: |:---: |:---: |:---: | [craigcbrunner](https://github.com/craigcbrunner) |[darthf1](https://github.com/darthf1) |[dkisic](https://github.com/dkisic) |[fingul](https://github.com/fingul) |[franckl](https://github.com/franckl) |[gaelicwinter](https://github.com/gaelicwinter) | -[green-mike](https://github.com/green-mike) |[hxgf](https://github.com/hxgf) |[johnmanjiro13](https://github.com/johnmanjiro13) |[kode-ninja](https://github.com/kode-ninja) |[magumbo](https://github.com/magumbo) |[ninesalt](https://github.com/ninesalt) | +[green-mike](https://github.com/green-mike) |[heocoi](https://github.com/heocoi) |[hxgf](https://github.com/hxgf) |[johnmanjiro13](https://github.com/johnmanjiro13) |[kode-ninja](https://github.com/kode-ninja) |[magumbo](https://github.com/magumbo) | :---: |:---: |:---: |:---: |:---: |:---: | -[green-mike](https://github.com/green-mike) |[hxgf](https://github.com/hxgf) |[johnmanjiro13](https://github.com/johnmanjiro13) |[kode-ninja](https://github.com/kode-ninja) |[magumbo](https://github.com/magumbo) |[ninesalt](https://github.com/ninesalt) | +[green-mike](https://github.com/green-mike) |[heocoi](https://github.com/heocoi) |[hxgf](https://github.com/hxgf) |[johnmanjiro13](https://github.com/johnmanjiro13) |[kode-ninja](https://github.com/kode-ninja) |[magumbo](https://github.com/magumbo) | -[phil714](https://github.com/phil714) |[luntta](https://github.com/luntta) |[rhymes](https://github.com/rhymes) |[rlebosse](https://github.com/rlebosse) |[rtaieb](https://github.com/rtaieb) |[slawexxx44](https://github.com/slawexxx44) | +[ninesalt](https://github.com/ninesalt) |[phil714](https://github.com/phil714) |[luntta](https://github.com/luntta) |[rhymes](https://github.com/rhymes) |[rlebosse](https://github.com/rlebosse) |[rtaieb](https://github.com/rtaieb) | :---: |:---: |:---: |:---: |:---: |:---: | -[phil714](https://github.com/phil714) |[luntta](https://github.com/luntta) |[rhymes](https://github.com/rhymes) |[rlebosse](https://github.com/rlebosse) |[rtaieb](https://github.com/rtaieb) |[slawexxx44](https://github.com/slawexxx44) | +[ninesalt](https://github.com/ninesalt) |[phil714](https://github.com/phil714) |[luntta](https://github.com/luntta) |[rhymes](https://github.com/rhymes) |[rlebosse](https://github.com/rlebosse) |[rtaieb](https://github.com/rtaieb) | -[thanhthot](https://github.com/thanhthot) |[tinny77](https://github.com/tinny77) |[tusharjkhunt](https://github.com/tusharjkhunt) |[vedran555](https://github.com/vedran555) |[yoann-hellopret](https://github.com/yoann-hellopret) |[olitomas](https://github.com/olitomas) | +[slawexxx44](https://github.com/slawexxx44) |[thanhthot](https://github.com/thanhthot) |[tinny77](https://github.com/tinny77) |[tusharjkhunt](https://github.com/tusharjkhunt) |[vedran555](https://github.com/vedran555) |[yoann-hellopret](https://github.com/yoann-hellopret) | :---: |:---: |:---: |:---: |:---: |:---: | -[thanhthot](https://github.com/thanhthot) |[tinny77](https://github.com/tinny77) |[tusharjkhunt](https://github.com/tusharjkhunt) |[vedran555](https://github.com/vedran555) |[yoann-hellopret](https://github.com/yoann-hellopret) |[olitomas](https://github.com/olitomas) | +[slawexxx44](https://github.com/slawexxx44) |[thanhthot](https://github.com/thanhthot) |[tinny77](https://github.com/tinny77) |[tusharjkhunt](https://github.com/tusharjkhunt) |[vedran555](https://github.com/vedran555) |[yoann-hellopret](https://github.com/yoann-hellopret) | -[JimmyLv](https://github.com/JimmyLv) | -:---: | -[JimmyLv](https://github.com/JimmyLv) | +[olitomas](https://github.com/olitomas) |[JimmyLv](https://github.com/JimmyLv) | +:---: |:---: | +[olitomas](https://github.com/olitomas) |[JimmyLv](https://github.com/JimmyLv) | diff --git a/babel.config.js b/babel.config.js index 24be08d968..fe70088e94 100644 --- a/babel.config.js +++ b/babel.config.js @@ -10,6 +10,7 @@ module.exports = (api) => { include: [ '@babel/plugin-proposal-nullish-coalescing-operator', '@babel/plugin-proposal-optional-chaining', + '@babel/plugin-proposal-numeric-separator', ], loose: true, targets, diff --git a/examples/aws-presigned-url/.gitignore b/examples/aws-presigned-url/.gitignore index a0e997abbb..22d0d82f80 100644 --- a/examples/aws-presigned-url/.gitignore +++ b/examples/aws-presigned-url/.gitignore @@ -1,4 +1 @@ vendor -bundle.js -uppy.min.css -bundle.js.* diff --git a/examples/aws-presigned-url/composer.lock b/examples/aws-presigned-url/composer.lock index b038891731..df8ef8ef3e 100644 --- a/examples/aws-presigned-url/composer.lock +++ b/examples/aws-presigned-url/composer.lock @@ -1,30 +1,84 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "e20f395162aaa593a890967537ff5f08", "packages": [ + { + "name": "aws/aws-crt-php", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/awslabs/aws-crt-php.git", + "reference": "3942776a8c99209908ee0b287746263725685732" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/3942776a8c99209908ee0b287746263725685732", + "reference": "3942776a8c99209908ee0b287746263725685732", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|^5.4.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "AWS SDK Common Runtime Team", + "email": "aws-sdk-common-runtime@amazon.com" + } + ], + "description": "AWS Common Runtime for PHP", + "homepage": "http://aws.amazon.com/sdkforphp", + "keywords": [ + "amazon", + "aws", + "crt", + "sdk" + ], + "support": { + "issues": "https://github.com/awslabs/aws-crt-php/issues", + "source": "https://github.com/awslabs/aws-crt-php/tree/v1.0.2" + }, + "time": "2021-09-03T22:57:30+00:00" + }, { "name": "aws/aws-sdk-php", - "version": "3.33.0", + "version": "3.208.5", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "980351b9468d85fd077e74e696ccf14d3f5b631e" + "reference": "58fa9d8b522b0afa260299179ff950c783ff0ee1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/980351b9468d85fd077e74e696ccf14d3f5b631e", - "reference": "980351b9468d85fd077e74e696ccf14d3f5b631e", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/58fa9d8b522b0afa260299179ff950c783ff0ee1", + "reference": "58fa9d8b522b0afa260299179ff950c783ff0ee1", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "^5.3.1|^6.2.1", - "guzzlehttp/promises": "~1.0", - "guzzlehttp/psr7": "^1.4.1", - "mtdowling/jmespath.php": "~2.2", + "aws/aws-crt-php": "^1.0.2", + "ext-json": "*", + "ext-pcre": "*", + "ext-simplexml": "*", + "guzzlehttp/guzzle": "^5.3.3|^6.2.1|^7.0", + "guzzlehttp/promises": "^1.4.0", + "guzzlehttp/psr7": "^1.7.0|^2.0", + "mtdowling/jmespath.php": "^2.6", "php": ">=5.5" }, "require-dev": { @@ -33,25 +87,27 @@ "behat/behat": "~3.0", "doctrine/cache": "~1.4", "ext-dom": "*", - "ext-json": "*", "ext-openssl": "*", - "ext-pcre": "*", - "ext-simplexml": "*", - "ext-spl": "*", + "ext-pcntl": "*", + "ext-sockets": "*", "nette/neon": "^2.3", - "phpunit/phpunit": "^4.8.35|^5.4.0", - "psr/cache": "^1.0" + "paragonie/random_compat": ">= 2", + "phpunit/phpunit": "^4.8.35|^5.4.3", + "psr/cache": "^1.0", + "psr/simple-cache": "^1.0", + "sebastian/comparator": "^1.2.3" }, "suggest": { "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications", "doctrine/cache": "To use the DoctrineCacheAdapter", "ext-curl": "To send requests using cURL", - "ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages" + "ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages", + "ext-sockets": "To use client-side monitoring" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -84,97 +140,161 @@ "s3", "sdk" ], - "time": "2017-08-14T19:22:37+00:00" + "support": { + "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", + "issues": "https://github.com/aws/aws-sdk-php/issues", + "source": "https://github.com/aws/aws-sdk-php/tree/3.208.5" + }, + "time": "2021-12-13T20:17:56+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "6.3.0", + "version": "7.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" + "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79", + "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79", "shasum": "" }, "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" + "ext-json": "*", + "guzzlehttp/promises": "^1.5", + "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", "ext-curl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", - "psr/log": "^1.0" + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.2-dev" + "dev-master": "7.4-dev" } }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\": "src/" - } + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", "keywords": [ "client", "curl", "framework", "http", "http client", + "psr-18", + "psr-7", "rest", "web service" ], - "time": "2017-06-22T18:50:49+00:00" + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.4.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2021-12-06T18:43:05+00:00" }, { "name": "guzzlehttp/promises", - "version": "v1.3.1", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", "shasum": "" }, "require": { - "php": ">=5.5.0" + "php": ">=5.5" }, "require-dev": { - "phpunit/phpunit": "^4.0" + "symfony/phpunit-bridge": "^4.4 || ^5.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -190,102 +310,187 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle promises library", "keywords": [ "promise" ], - "time": "2016-12-20T10:07:11+00:00" + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:56:57+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.4.2", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", "shasum": "" }, "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" }, "provide": { + "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "bamarni/composer-bin-plugin": "^1.4.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.4-dev" + "dev-master": "2.1-dev" } }, "autoload": { "psr-4": { "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, { "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" } ], "description": "PSR-7 message implementation that also provides common utility methods", "keywords": [ "http", "message", + "psr-7", "request", "response", "stream", "uri", "url" ], - "time": "2017-03-20T17:10:46+00:00" + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.1.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2021-10-06T17:43:30+00:00" }, { "name": "mtdowling/jmespath.php", - "version": "2.4.0", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/jmespath/jmespath.php.git", - "reference": "adcc9531682cf87dfda21e1fd5d0e7a41d292fac" + "reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/adcc9531682cf87dfda21e1fd5d0e7a41d292fac", - "reference": "adcc9531682cf87dfda21e1fd5d0e7a41d292fac", + "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/9b87907a81b87bc76d19a7fb2d61e61486ee9edb", + "reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": "^5.4 || ^7.0 || ^8.0", + "symfony/polyfill-mbstring": "^1.17" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "composer/xdebug-handler": "^1.4 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^7.5.15" }, "bin": [ "bin/jp.php" @@ -293,7 +498,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.0-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -320,7 +525,118 @@ "json", "jsonpath" ], - "time": "2016-12-03T22:08:25+00:00" + "support": { + "issues": "https://github.com/jmespath/jmespath.php/issues", + "source": "https://github.com/jmespath/jmespath.php/tree/2.6.1" + }, + "time": "2021-06-14T00:11:39+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, + "time": "2020-06-29T06:28:15+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, + "time": "2019-04-30T12:38:16+00:00" }, { "name": "psr/http-message", @@ -342,7 +658,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -370,7 +686,201 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", + "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", + "shasum": "" + }, + "require": { + "php": ">=8.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-01T23:48:49+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T12:26:48+00:00" } ], "packages-dev": [], @@ -380,5 +890,6 @@ "prefer-stable": false, "prefer-lowest": false, "platform": [], - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "2.1.0" } diff --git a/examples/aws-presigned-url/index.html b/examples/aws-presigned-url/index.html index 2d824e3b0d..6d2b161c27 100644 --- a/examples/aws-presigned-url/index.html +++ b/examples/aws-presigned-url/index.html @@ -7,6 +7,6 @@ - + diff --git a/examples/aws-presigned-url/main.js b/examples/aws-presigned-url/main.js index 12ed1877c8..927b5fe9c6 100644 --- a/examples/aws-presigned-url/main.js +++ b/examples/aws-presigned-url/main.js @@ -1,6 +1,6 @@ -const Uppy = require('@uppy/core') -const Dashboard = require('@uppy/dashboard') -const AwsS3 = require('@uppy/aws-s3') +import Uppy from '@uppy/core' +import Dashboard from '@uppy/dashboard' +import AwsS3 from '@uppy/aws-s3' const uppy = new Uppy({ debug: true, diff --git a/examples/aws-presigned-url/package.json b/examples/aws-presigned-url/package.json index e154024299..59bdc2ecd5 100644 --- a/examples/aws-presigned-url/package.json +++ b/examples/aws-presigned-url/package.json @@ -2,17 +2,18 @@ "name": "@uppy-example/aws-presigned-url", "version": "0.0.0", "dependencies": { - "@babel/core": "^7.4.4", "@uppy/aws-s3": "workspace:*", "@uppy/core": "workspace:*", "@uppy/dashboard": "workspace:*", - "babelify": "^10.0.0", - "browserify": "^17.0.0", - "fs-write-stream-atomic": "^1.0.10", - "watchify": "^4.0.0" + "uppy": "workspace:*" + }, + "devDependencies": { + "esbuild": "^0.14.1" }, "private": true, + "type": "module", "scripts": { - "start": "node ./serve.js" + "start": "php -S localhost:8080 serve.php", + "outputBundle": "esbuild --format=esm --sourcemap=inline --bundle ./main.js" } } diff --git a/examples/aws-presigned-url/readme.md b/examples/aws-presigned-url/readme.md index bd760fe457..990f9fbab1 100644 --- a/examples/aws-presigned-url/readme.md +++ b/examples/aws-presigned-url/readme.md @@ -7,18 +7,17 @@ This example uses a server-side PHP endpoint to sign uploads to S3. To run this example, make sure you've correctly installed the **repository root**: ```bash -npm install -npm run build +yarn || corepack yarn install +yarn build || corepack yarn build ``` That will also install the npm dependencies for this example. This example also uses the AWS PHP SDK. -To install it, [get composer](https://getcomposer.org) and run `composer update` in **this** folder. +To install it, [get composer](https://getcomposer.org) and run `composer update` in this folder. ```bash -cd ./examples/aws-presigned-url -composer update +corepack yarn workspace @uppy-example/aws-presigned-url exec "composer update" ``` Configure AWS S3 credentials using [environment variables](https://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/credentials.html#environment-credentials) or a [credentials file in `~/.aws/credentials`](https://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/credentials.html#credential-profiles). @@ -27,22 +26,16 @@ Configure a bucket name and region in the `s3-sign.php` file. Then, again in the **repository root**, start this example by doing: ```bash -npm run example aws-presigned-url +corepack yarn workspace @uppy-example/aws-presigned-url start ``` The demo should now be available at http://localhost:8080. -Optionally, provide a port in the `PORT` environment variable: - -```bash -PORT=8080 npm run example aws-presigned-url -``` - You can use a different S3-compatible service like GCS by configuring that service in `~/.aws/config` and `~/.aws/credentials`, and then providing appropriate environment variables: ```bash AWS_PROFILE="gcs" \ COMPANION_AWS_ENDPOINT="https://storage.googleapis.com" \ COMPANION_AWS_BUCKET="test-bucket-name" \ - npm run example aws-presigned-url + corepack yarn run example aws-presigned-url ``` diff --git a/examples/aws-presigned-url/serve.js b/examples/aws-presigned-url/serve.js deleted file mode 100644 index 8896d843ee..0000000000 --- a/examples/aws-presigned-url/serve.js +++ /dev/null @@ -1,41 +0,0 @@ -const { spawn } = require('child_process') -const path = require('path') -const fs = require('fs') -const createWriteStream = require('fs-write-stream-atomic') -const browserify = require('browserify') -const watchify = require('watchify') -const babelify = require('babelify') - -const port = process.env.PORT || 8080 - -const b = browserify({ - cache: {}, - packageCache: {}, - debug: true, - entries: path.join(__dirname, './main.js'), -}) - -b.plugin(watchify) -b.transform(babelify) - -function bundle () { - return b.bundle((err) => { - if (err) console.error(err.stack) - else console.log('bundle complete') - }).pipe(createWriteStream(path.join(__dirname, './bundle.js'))) -} - -b.on('log', console.log) -b.on('update', bundle) -b.on('error', console.error) - -fs.createReadStream(path.join(__dirname, '../../packages/uppy/dist/uppy.min.css')) - .pipe(fs.createWriteStream(path.join(__dirname, './uppy.min.css'))) - -console.log('bundling...') -bundle().on('finish', () => { - // Start the PHP delevopment server. - spawn('php', ['-S', `localhost:${port}`], { - stdio: 'inherit', - }) -}) diff --git a/examples/aws-presigned-url/serve.php b/examples/aws-presigned-url/serve.php new file mode 100644 index 0000000000..984197dc94 --- /dev/null +++ b/examples/aws-presigned-url/serve.php @@ -0,0 +1,17 @@ + - + - + + + + ``` Then, a global `Robodog` variable will be available. For usage instructions, please see the [main Robodog documentation](https://uppy.io/docs/robodog). diff --git a/packages/@uppy/robodog/package.json b/packages/@uppy/robodog/package.json index 9008213e3c..7f8396efc8 100644 --- a/packages/@uppy/robodog/package.json +++ b/packages/@uppy/robodog/package.json @@ -1,7 +1,7 @@ { "name": "@uppy/robodog", "description": "Transloadit SDK for browsers based on Uppy", - "version": "2.1.5", + "version": "2.2.0", "license": "MIT", "main": "lib/index.js", "jsnext:main": "src/index.js", diff --git a/packages/@uppy/screen-capture/CHANGELOG.md b/packages/@uppy/screen-capture/CHANGELOG.md index 1145efb967..272d4a7c40 100644 --- a/packages/@uppy/screen-capture/CHANGELOG.md +++ b/packages/@uppy/screen-capture/CHANGELOG.md @@ -1,5 +1,12 @@ # @uppy/screen-capture +## 2.0.6 + +Released: 2022-01-10 +Included in: Uppy v2.4.0 + +- @uppy/screen-capture: Add missing option to the screen capture types (Mustafa Navruz / #3400) + ## 2.0.5 Released: 2021-12-07 diff --git a/packages/@uppy/screen-capture/package.json b/packages/@uppy/screen-capture/package.json index 02abd00996..98b2d1938d 100644 --- a/packages/@uppy/screen-capture/package.json +++ b/packages/@uppy/screen-capture/package.json @@ -1,7 +1,7 @@ { "name": "@uppy/screen-capture", "description": "Uppy plugin that captures video from display or application.", - "version": "2.0.5", + "version": "2.0.6", "license": "MIT", "main": "lib/index.js", "style": "dist/style.min.css", diff --git a/packages/@uppy/screen-capture/types/index.d.ts b/packages/@uppy/screen-capture/types/index.d.ts index d43e81ad3c..8aef1a57e4 100644 --- a/packages/@uppy/screen-capture/types/index.d.ts +++ b/packages/@uppy/screen-capture/types/index.d.ts @@ -1,4 +1,4 @@ -import type { PluginOptions, UIPlugin } from '@uppy/core' +import type { PluginOptions, UIPlugin, PluginTarget } from '@uppy/core' // https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#Properties_of_shared_screen_tracks // TODO: use the global DisplayMediaStreamConstraints once typescript includes it by default @@ -12,6 +12,7 @@ import type { PluginOptions, UIPlugin } from '@uppy/core' } export interface ScreenCaptureOptions extends PluginOptions { + target?: PluginTarget displayMediaConstraints?: DisplayMediaStreamConstraints, userMediaConstraints?: MediaStreamConstraints, preferredVideoMimeType?: string diff --git a/packages/@uppy/transloadit/CHANGELOG.md b/packages/@uppy/transloadit/CHANGELOG.md index cccd2c9871..8939a086dc 100644 --- a/packages/@uppy/transloadit/CHANGELOG.md +++ b/packages/@uppy/transloadit/CHANGELOG.md @@ -1,5 +1,13 @@ # @uppy/transloadit +## 2.1.0 + +Released: 2022-01-10 +Included in: Uppy v2.4.0 + +- @uppy/transloadit: ignore rate limiting errors when polling (Antoine du Hamel / #3418) +- @uppy/transloadit: better defaults for rate limiting (Antoine du Hamel / #3414) + ## 2.0.5 Released: 2021-12-07 diff --git a/packages/@uppy/transloadit/package.json b/packages/@uppy/transloadit/package.json index c860dd7e8a..aa50b0d87a 100644 --- a/packages/@uppy/transloadit/package.json +++ b/packages/@uppy/transloadit/package.json @@ -1,7 +1,7 @@ { "name": "@uppy/transloadit", "description": "The Transloadit plugin can be used to upload files to Transloadit for all kinds of processing, such as transcoding video, resizing images, zipping/unzipping, and more", - "version": "2.0.5", + "version": "2.1.0", "license": "MIT", "main": "lib/index.js", "types": "types/index.d.ts", diff --git a/packages/@uppy/transloadit/src/Assembly.js b/packages/@uppy/transloadit/src/Assembly.js index 136bb5e2a3..5c2f1099be 100644 --- a/packages/@uppy/transloadit/src/Assembly.js +++ b/packages/@uppy/transloadit/src/Assembly.js @@ -79,11 +79,6 @@ class TransloaditAssembly extends Emitter { this.emit('connect') }) - socket.on('connect_failed', () => { - this.#onError(new NetworkError('Transloadit Socket.io connection error')) - this.socket = null - }) - socket.on('connect_error', () => { socket.disconnect() this.socket = null @@ -126,6 +121,7 @@ class TransloaditAssembly extends Emitter { #onError (err) { this.emit('error', Object.assign(new Error(err.message), err)) + this.close() } /** @@ -148,21 +144,35 @@ class TransloaditAssembly extends Emitter { * Pass `diff: false` to avoid emitting diff events, instead only emitting * 'status'. */ - #fetchStatus ({ diff = true } = {}) { - return fetchWithNetworkError(this.status.assembly_ssl_url) - .then((response) => response.json()) - .then((status) => { - // Avoid updating if we closed during this request's lifetime. - if (this.closed) return - this.emit('status', status) - - if (diff) { - this.updateStatus(status) - } else { - this.status = status - } - }) - .catch((err) => this.#onError(err)) + async #fetchStatus ({ diff = true } = {}) { + if (this.closed) return + + try { + const response = await fetchWithNetworkError(this.status.assembly_ssl_url) + + if (this.closed) return + + // In case of rate-limiting, ignore the error. + if (response.status === 429) return + + if (!response.ok) { + this.#onError(new NetworkError(response.statusText)) + return + } + + const status = await response.json() + // Avoid updating if we closed during this request's lifetime. + if (this.closed) return + this.emit('status', status) + + if (diff) { + this.updateStatus(status) + } else { + this.status = status + } + } catch (err) { + this.#onError(err) + } } update () { diff --git a/packages/@uppy/transloadit/src/index.js b/packages/@uppy/transloadit/src/index.js index 50d9f6c041..aca89f7154 100644 --- a/packages/@uppy/transloadit/src/index.js +++ b/packages/@uppy/transloadit/src/index.js @@ -19,6 +19,7 @@ function defaultGetAssemblyOptions (file, options) { const sendErrorToConsole = originalErr => err => { const error = new Error('Failed to send error to the client') error.cause = err + // eslint-ignore-next-line no-console console.error(error, originalErr) } @@ -53,7 +54,8 @@ module.exports = class Transloadit extends BasePlugin { params: null, fields: {}, getAssemblyOptions: defaultGetAssemblyOptions, - limit: 0, + limit: 20, + retryDelays: [7_000, 10_000, 15_000, 20_000], } this.opts = { ...defaultOptions, ...opts } @@ -241,7 +243,7 @@ module.exports = class Transloadit extends BasePlugin { }) watcher.on('assembly-error', (id, error) => { - // Clear postprocessing state for all our files. + // Clear postprocessing state for all our files. const files = this.getAssemblyFiles(id) files.forEach((file) => { // TODO Maybe make a postprocess-error event here? @@ -707,10 +709,9 @@ module.exports = class Transloadit extends BasePlugin { } #onTusError = (err) => { - if (err && /^tus: /.test(err.message)) { - const xhr = err.originalRequest ? err.originalRequest.getUnderlyingObject() : null - const url = xhr && xhr.responseURL ? xhr.responseURL : null - this.client.submitError(err, { url, type: 'TUS_ERROR' }) + if (err?.message?.startsWith('tus: ')) { + const endpoint = err.originalRequest?.getUnderlyingObject()?.responseURL + this.client.submitError(err, { endpoint, type: 'TUS_ERROR' }) // if we can't report the error that sucks .catch(sendErrorToConsole(err)) } @@ -751,6 +752,7 @@ module.exports = class Transloadit extends BasePlugin { metaFields: ['assembly_url', 'filename', 'fieldname'], // Pass the limit option to @uppy/tus limit: this.opts.limit, + retryDelays: this.opts.retryDelays, }) } diff --git a/packages/@uppy/tus/CHANGELOG.md b/packages/@uppy/tus/CHANGELOG.md new file mode 100644 index 0000000000..9e8ca7b8a8 --- /dev/null +++ b/packages/@uppy/tus/CHANGELOG.md @@ -0,0 +1,8 @@ +# @uppy/tus + +## 2.2.0 + +Released: 2022-01-10 +Included in: Uppy v2.4.0 + +- @uppy/tus: pause all requests in response to server rate limiting (Antoine du Hamel / #3394) diff --git a/packages/@uppy/tus/package.json b/packages/@uppy/tus/package.json index 4239c0eba2..abe49d30d3 100644 --- a/packages/@uppy/tus/package.json +++ b/packages/@uppy/tus/package.json @@ -1,7 +1,7 @@ { "name": "@uppy/tus", "description": "Resumable uploads for Uppy using Tus.io", - "version": "2.1.2", + "version": "2.2.0", "license": "MIT", "main": "lib/index.js", "types": "types/index.d.ts", diff --git a/packages/@uppy/tus/src/index.js b/packages/@uppy/tus/src/index.js index 75586f5b61..5ff2b3388d 100644 --- a/packages/@uppy/tus/src/index.js +++ b/packages/@uppy/tus/src/index.js @@ -40,7 +40,7 @@ const tusDefaultOptions = { addRequestId: false, chunkSize: Infinity, - retryDelays: [0, 1000, 3000, 5000], + retryDelays: [100, 1000, 3000, 5000], parallelUploads: 1, removeFingerprintOnSuccess: false, uploadLengthDeferred: false, @@ -51,8 +51,11 @@ const tusDefaultOptions = { * Tus resumable file uploader */ module.exports = class Tus extends BasePlugin { + // eslint-disable-next-line global-require static VERSION = require('../package.json').version + #retryDelayIterator + /** * @param {Uppy} uppy * @param {TusOptions} opts @@ -66,8 +69,8 @@ module.exports = class Tus extends BasePlugin { // set default options const defaultOptions = { useFastRemoteRetry: true, - limit: 5, - retryDelays: [0, 1000, 3000, 5000], + limit: 20, + retryDelays: tusDefaultOptions.retryDelays, withCredentials: false, } @@ -85,6 +88,7 @@ module.exports = class Tus extends BasePlugin { * @type {RateLimitedQueue} */ this.requests = new RateLimitedQueue(this.opts.limit) + this.#retryDelayIterator = this.opts.retryDelays?.values() this.uploaders = Object.create(null) this.uploaderEvents = Object.create(null) @@ -178,6 +182,9 @@ module.exports = class Tus extends BasePlugin { // Create a new tus upload return new Promise((resolve, reject) => { + let queuedRequest + let qRequest + this.uppy.emit('upload-started', file) const opts = { @@ -219,7 +226,7 @@ module.exports = class Tus extends BasePlugin { } this.resetUploaderReferences(file.id) - queuedRequest.done() + queuedRequest.abort() this.uppy.emit('upload-error', file, err) @@ -252,6 +259,46 @@ module.exports = class Tus extends BasePlugin { resolve(upload) } + uploadOptions.onShouldRetry = (err, retryAttempt, options) => { + const status = err?.originalResponse?.getStatus() + if (status === 429) { + // HTTP 429 Too Many Requests => to avoid the whole download to fail, pause all requests. + if (!this.requests.isPaused) { + const next = this.#retryDelayIterator?.next() + if (next == null || next.done) { + return false + } + this.requests.rateLimit(next.value) + } + queuedRequest.abort() + queuedRequest = this.requests.run(qRequest) + } else if (status > 400 && status < 500 && status !== 409) { + // HTTP 4xx, the server won't send anything, it's doesn't make sense to retry + return false + } else if (typeof navigator !== 'undefined' && navigator.onLine === false) { + // The navigator is offline, let's wait for it to come back online. + if (!this.requests.isPaused) { + this.requests.pause() + window.addEventListener('online', () => { + this.requests.resume() + }, { once: true }) + } + queuedRequest.abort() + queuedRequest = this.requests.run(qRequest) + } else { + // For a non-4xx error, we can re-queue the request. + setTimeout(() => { + queuedRequest.abort() + queuedRequest = this.requests.run(qRequest) + }, options.retryDelays[retryAttempt]) + } + // Aborting the timeout set by tus-js-client to not short-circuit the rate limiting. + // eslint-disable-next-line no-underscore-dangle + queueMicrotask(() => clearTimeout(queuedRequest._retryTimeout)) + // We need to return true here so tus-js-client increments the retryAttempt and do not emit an error event. + return true + } + const copyProp = (obj, srcProp, destProp) => { if (hasProperty(obj, srcProp) && !hasProperty(obj, destProp)) { obj[destProp] = obj[srcProp] @@ -278,15 +325,7 @@ module.exports = class Tus extends BasePlugin { this.uploaders[file.id] = upload this.uploaderEvents[file.id] = new EventTracker(this.uppy) - upload.findPreviousUploads().then((previousUploads) => { - const previousUpload = previousUploads[0] - if (previousUpload) { - this.uppy.log(`[Tus] Resuming upload of ${file.id} started at ${previousUpload.creationTime}`) - upload.resumeFromPreviousUpload(previousUpload) - } - }) - - let queuedRequest = this.requests.run(() => { + qRequest = () => { if (!file.isPaused) { upload.start() } @@ -297,8 +336,18 @@ module.exports = class Tus extends BasePlugin { // Also, we need to remove the request from the queue _without_ destroying everything // related to this upload to handle pauses. return () => {} + } + + upload.findPreviousUploads().then((previousUploads) => { + const previousUpload = previousUploads[0] + if (previousUpload) { + this.uppy.log(`[Tus] Resuming upload of ${file.id} started at ${previousUpload.creationTime}`) + upload.resumeFromPreviousUpload(previousUpload) + } }) + queuedRequest = this.requests.run(qRequest) + this.onFileRemove(file.id, (targetFileID) => { queuedRequest.abort() this.resetUploaderReferences(file.id, { abort: !!upload.url }) @@ -314,10 +363,7 @@ module.exports = class Tus extends BasePlugin { // Resuming an upload should be queued, else you could pause and then // resume a queued upload to make it skip the queue. queuedRequest.abort() - queuedRequest = this.requests.run(() => { - upload.start() - return () => {} - }) + queuedRequest = this.requests.run(qRequest) } }) @@ -337,10 +383,7 @@ module.exports = class Tus extends BasePlugin { if (file.error) { upload.abort() } - queuedRequest = this.requests.run(() => { - upload.start() - return () => {} - }) + queuedRequest = this.requests.run(qRequest) }) }).catch((err) => { this.uppy.emit('upload-error', file, err) @@ -412,6 +455,8 @@ module.exports = class Tus extends BasePlugin { this.uploaderSockets[file.id] = socket this.uploaderEvents[file.id] = new EventTracker(this.uppy) + let queuedRequest + this.onFileRemove(file.id, () => { queuedRequest.abort() socket.send('cancel', {}) @@ -512,7 +557,7 @@ module.exports = class Tus extends BasePlugin { resolve() }) - let queuedRequest = this.requests.run(() => { + queuedRequest = this.requests.run(() => { socket.open() if (file.isPaused) { socket.send('pause', {}) diff --git a/packages/@uppy/utils/package.json b/packages/@uppy/utils/package.json index 650ce6cc6c..26051f0d3d 100644 --- a/packages/@uppy/utils/package.json +++ b/packages/@uppy/utils/package.json @@ -1,7 +1,7 @@ { "name": "@uppy/utils", "description": "Shared utility functions for Uppy Core and plugins maintained by the Uppy team.", - "version": "4.0.4", + "version": "4.0.5", "license": "MIT", "main": "lib/index.js", "types": "types/index.d.ts", diff --git a/packages/@uppy/utils/src/RateLimitedQueue.js b/packages/@uppy/utils/src/RateLimitedQueue.js index 77e0589c2a..56bf3ac502 100644 --- a/packages/@uppy/utils/src/RateLimitedQueue.js +++ b/packages/@uppy/utils/src/RateLimitedQueue.js @@ -7,6 +7,16 @@ class RateLimitedQueue { #queuedHandlers = [] + #paused = false + + #pauseTimer + + #downLimit = 1 + + #upperLimit + + #rateLimitingTimer + constructor (limit) { if (typeof limit !== 'number' || limit === 0) { this.limit = Infinity @@ -54,7 +64,7 @@ class RateLimitedQueue { } #next () { - if (this.#activeRequests >= this.limit) { + if (this.#paused || this.#activeRequests >= this.limit) { return } if (this.#queuedHandlers.length === 0) { @@ -101,7 +111,7 @@ class RateLimitedQueue { } run (fn, queueOptions) { - if (this.#activeRequests < this.limit) { + if (!this.#paused && this.#activeRequests < this.limit) { return this.#call(fn) } return this.#queue(fn, queueOptions) @@ -149,6 +159,69 @@ class RateLimitedQueue { return outerPromise } } + + resume () { + this.#paused = false + clearTimeout(this.#pauseTimer) + for (let i = 0; i < this.limit; i++) { + this.#queueNext() + } + } + + #resume = () => this.resume() + + /** + * Freezes the queue for a while or indefinitely. + * + * @param {number | null } [duration] Duration for the pause to happen, in milliseconds. + * If omitted, the queue won't resume automatically. + */ + pause (duration = null) { + this.#paused = true + clearTimeout(this.#pauseTimer) + if (duration != null) { + this.#pauseTimer = setTimeout(this.#resume, duration) + } + } + + /** + * Pauses the queue for a duration, and lower the limit of concurrent requests + * when the queue resumes. When the queue resumes, it tries to progressively + * increase the limit in `this.#increaseLimit` until another call is made to + * `this.rateLimit`. + * Call this function when using the RateLimitedQueue for network requests and + * the remote server responds with 429 HTTP code. + * + * @param {number} duration in milliseconds. + */ + rateLimit (duration) { + clearTimeout(this.#rateLimitingTimer) + this.pause(duration) + if (this.limit > 1 && Number.isFinite(this.limit)) { + this.#upperLimit = this.limit - 1 + this.limit = this.#downLimit + this.#rateLimitingTimer = setTimeout(this.#increaseLimit, duration) + } + } + + #increaseLimit = () => { + if (this.#paused) { + this.#rateLimitingTimer = setTimeout(this.#increaseLimit, 0) + return + } + this.#downLimit = this.limit + this.limit = Math.ceil((this.#upperLimit + this.#downLimit) / 2) + for (let i = this.#downLimit; i <= this.limit; i++) { + this.#queueNext() + } + if (this.#upperLimit - this.#downLimit > 3) { + this.#rateLimitingTimer = setTimeout(this.#increaseLimit, 2000) + } else { + this.#downLimit = Math.floor(this.#downLimit / 2) + } + } + + get isPaused () { return this.#paused } } module.exports = { diff --git a/packages/uppy/package.json b/packages/uppy/package.json index 46e0d59ce4..bfa17e66a7 100644 --- a/packages/uppy/package.json +++ b/packages/uppy/package.json @@ -1,12 +1,12 @@ { "name": "uppy", "description": "Extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:", - "version": "2.3.2", + "version": "2.4.0", "license": "MIT", "main": "index.js", "module": "index.mjs", "unpkg": "dist/uppy.min.js", - "style": "dist/style.min.css", + "style": "dist/uppy.min.css", "types": "types/index.d.ts", "keywords": [ "file uploader", diff --git a/private/dev/.env b/private/dev/.env new file mode 100644 index 0000000000..82edb5c149 --- /dev/null +++ b/private/dev/.env @@ -0,0 +1,24 @@ +VITE_UPLOADER=tus + +#### To customize this, create a .env.local file that overrides those values + +# VITE_UPLOADER=tus +# VITE_UPLOADER=s3 +# VITE_UPLOADER=s3-multipart +# xhr will use protocol 'multipart' in companion, if used with a remote service, e.g. google drive. +# If local upload will use browser XHR +# VITE_UPLOADER=xhr +# VITE_UPLOADER=transloadit +# VITE_UPLOADER=transloadit-s3 +# VITE_UPLOADER=transloadit-xhr + +### DEV CONFIG: Endpoint URLs + +VITE_COMPANION_URL=http://localhost:3020 +VITE_TUS_ENDPOINT=https://tusd.tusdemo.net/files/ +VITE_XHR_ENDPOINT=https://xhr-server.herokuapp.com/upload + +### DEV CONFIG: Transloadit keys +VITE_TRANSLOADIT_KEY=... +VITE_TRANSLOADIT_TEMPLATE=... +VITE_TRANSLOADIT_SERVICE_URL=https://api2.transloadit.com diff --git a/private/dev/Dashboard.js b/private/dev/Dashboard.js index b7f5bb99f4..1bd90d245f 100644 --- a/private/dev/Dashboard.js +++ b/private/dev/Dashboard.js @@ -25,29 +25,19 @@ import DropTarget from '@uppy/drop-target' import Audio from '@uppy/audio' /* eslint-enable import/no-extraneous-dependencies */ -// DEV CONFIG: pick an uploader +// DEV CONFIG: create a .env.local file to customize those values. +const { + VITE_UPLOADER : UPLOADER, + VITE_COMPANION_URL : COMPANION_URL, + VITE_TUS_ENDPOINT : TUS_ENDPOINT, + VITE_XHR_ENDPOINT : XHR_ENDPOINT, + VITE_TRANSLOADIT_KEY : TRANSLOADIT_KEY, + VITE_TRANSLOADIT_TEMPLATE : TRANSLOADIT_TEMPLATE, + VITE_TRANSLOADIT_SERVICE_URL : TRANSLOADIT_SERVICE_URL, +} = import.meta.env -const UPLOADER = 'tus' -// const UPLOADER = 's3' -// const UPLOADER = 's3-multipart' -// xhr will use protocol 'multipart' in companion, if used with a remote service, e.g. google drive. -// If local upload will use browser XHR -// const UPLOADER = 'xhr' -// const UPLOADER = 'transloadit' -// const UPLOADER = 'transloadit-s3' -// const UPLOADER = 'transloadit-xhr' - -// DEV CONFIG: Endpoint URLs - -const COMPANION_URL = 'http://localhost:3020' -const TUS_ENDPOINT = 'https://tusd.tusdemo.net/files/' -const XHR_ENDPOINT = 'https://xhr-server.herokuapp.com/upload' - -// DEV CONFIG: Transloadit keys - -const TRANSLOADIT_KEY = '...' -const TRANSLOADIT_TEMPLATE = '...' -const TRANSLOADIT_SERVICE_URL = 'https://api2.transloadit.com' +import.meta.env.VITE_TRANSLOADIT_KEY = '***' // to avoid leaking secrets in screenshots. +console.log(import.meta.env) // DEV CONFIG: enable or disable Golden Retriever diff --git a/private/dev/DragDrop.js b/private/dev/DragDrop.js index ecec190df9..253d61a9e7 100644 --- a/private/dev/DragDrop.js +++ b/private/dev/DragDrop.js @@ -6,6 +6,14 @@ import DragDrop from '@uppy/drag-drop' import ProgressBar from '@uppy/progress-bar' /* eslint-enable import/no-extraneous-dependencies */ +// DEV CONFIG: create a .env.local file to customize those values. +const { + VITE_TUS_ENDPOINT : TUS_ENDPOINT, +} = import.meta.env + +import.meta.env.VITE_TRANSLOADIT_KEY = '***' // to avoid leaking secrets in screenshots. +console.log(import.meta.env) + export default () => { const uppyDragDrop = new Uppy({ debug: true, @@ -15,7 +23,7 @@ export default () => { target: '#uppyDragDrop', }) .use(ProgressBar, { target: '#uppyDragDrop-progress', hideAfterFinish: false }) - .use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' }) + .use(Tus, { endpoint: TUS_ENDPOINT }) window.uppy = uppyDragDrop diff --git a/website/src/_posts/2021-12-2.1-2.3.md b/website/src/_posts/2021-12-2.1-2.3.md index df12c20457..7e43b9e7a3 100644 --- a/website/src/_posts/2021-12-2.1-2.3.md +++ b/website/src/_posts/2021-12-2.1-2.3.md @@ -10,9 +10,11 @@ image: https://uppy.io/images/blog/2.1-2.3/audio-cover.jpg published: true --- + + Last Christmas, we gave you [Uppy 1.24](https://uppy.io/blog/2020/12/1.24/), but this very next year, we’ll take it away (since it’s outdated by now) and give you a brand-new Uppy 2.3 🎁! -After the [release](https://uppy.io/blog/2021/08/2.0/) of our latest major version, 2.0.0, we’ve been busy with many things. First of all is the long-awaited Audio plugin to record and upload live audio directly. We then worked on adding a fast and efficient streaming interface to Companion and made Unsplash production ready. Housekeeping was also part of the job: we made Status Bar improvements, moved from NPM to Yarn 3, did some refactoring, and updated dependencies. +After the [release](https://uppy.io/blog/2021/08/2.0/) of our latest major version, 2.0.0, we’ve been busy with many things. First of all is the long-awaited Audio plugin to record and upload live audio directly. We then worked on adding a fast and efficient streaming interface to Companion and made Unsplash production ready. Housekeeping was also part of the job: we made Status Bar improvements, moved from npm to Yarn 3, did some refactoring, and updated dependencies. Last but not least, we got the issue count down from around 110 since 2.0.0 to around 45 now. @@ -58,7 +60,7 @@ The Status Bar plugin would get confused about upload errors in Uppy, and we’v ## Internal housekeeping -### Yarn v3 instead of NPM +### Yarn v3 instead of npm We’ve switched the Uppy repo to Yarn 3 to improve package install performance. With our complex dependency graph and over thirty packages in a monorepo, we are seeing install times reduced by more than a few minutes! @@ -88,7 +90,7 @@ Here are some highlights: * A changelog will be generated. * The contributions table will be updated. * GitHub Actions will create a release candidate pull request. -* When approved, GitHub Actions automatically merges, publishes to NPM, and creates CDN bundles. +* When approved, GitHub Actions automatically merges, publishes to the npm public registry, and creates CDN bundles. [View the PR](https://github.com/transloadit/uppy/pull/3304). diff --git a/website/src/docs/index.md b/website/src/docs/index.md index 2d110d3718..2d9693b19b 100644 --- a/website/src/docs/index.md +++ b/website/src/docs/index.md @@ -19,12 +19,12 @@ Here’s the simplest example html page with Uppy (it uses a CDN bundle, while w Uppy - +
- + + ``` 2\. Add CSS to ``: ```html - + ``` 3\. Initialize at the bottom of the closing `` tag: @@ -183,5 +183,5 @@ export * from '@uppy/core' If you’re using Uppy from CDN, those polyfills are already included in the bundle, no need to include anything additionally: ```html - + ``` diff --git a/website/src/docs/locales.md b/website/src/docs/locales.md index b8c7bcda99..8ad952f579 100644 --- a/website/src/docs/locales.md +++ b/website/src/docs/locales.md @@ -34,7 +34,7 @@ const uppy = new Uppy({ Add a ` + + - - + + ``` Please note that while you may be able to get 2.0 to work in IE11 this way, we do not officially support it anymore. diff --git a/website/src/docs/robodog-form.md b/website/src/docs/robodog-form.md index c0d544b1cd..9ec2b8501b 100644 --- a/website/src/docs/robodog-form.md +++ b/website/src/docs/robodog-form.md @@ -150,7 +150,7 @@ Make sure to also include the Uppy css file in your `` tag in case you wan ```html - + ``` @@ -162,7 +162,7 @@ Notice how the form is submitted to the inexistant `/uploads` route once all tra Testing Robodog - +
@@ -172,7 +172,7 @@ Notice how the form is submitted to the inexistant `/uploads` route once all tra
- + + + ``` diff --git a/website/src/examples/i18n/app.html b/website/src/examples/i18n/app.html index d0339f9f47..27606833a8 100644 --- a/website/src/examples/i18n/app.html +++ b/website/src/examples/i18n/app.html @@ -1,7 +1,7 @@ - +
@@ -12,7 +12,7 @@
Uploaded files:
- + +// const robodog = require('@uppy/robodog') const TRANSLOADIT_EXAMPLE_KEY = '35c1aed03f5011e982b6afe82599b6a0' diff --git a/website/src/examples/markdown-snippets/app.html b/website/src/examples/markdown-snippets/app.html index 1b32625a03..592becd7bd 100644 --- a/website/src/examples/markdown-snippets/app.html +++ b/website/src/examples/markdown-snippets/app.html @@ -1,6 +1,6 @@ + -->

Create a new snippet

diff --git a/website/themes/uppy/layout/index.ejs b/website/themes/uppy/layout/index.ejs index 6bdfc8ae41..fa94b3326f 100644 --- a/website/themes/uppy/layout/index.ejs +++ b/website/themes/uppy/layout/index.ejs @@ -187,8 +187,8 @@

© <%- date(Date.now(), 'YYYY') %> Transloadit

- - + +