add Polyfills

This commit is contained in:
Artur Paikin 2018-07-15 23:01:49 -04:00
parent cc7edeff9e
commit ec5e2fed3a

View file

@ -97,7 +97,7 @@ Alternatively, you can also use a pre-built bundle from Transloadit's CDN: Edgly
## Plugins
[List of plugins and their common options](https://uppy.io/docs/plugins/)
[List of plugins and their common options](https://uppy.io/docs/plugins/).
### Local Sources
@ -141,6 +141,21 @@ Alternatively, you can also use a pre-built bundle from Transloadit's CDN: Edgly
We aim to support IE10+ and recent versions of Safari, Edge, Chrome, Firefox, and Opera.
### Polyfills
Uppy heavily uses Promises. If your target environment [does not support Promises](https://caniuse.com/#feat=promises), use a polyfill like `es6-promise` before initialising Uppy.
When using remote providers like Google Drive or Dropbox, the Fetch API is used. If your target environment does not support the [Fetch API](https://caniuse.com/#feat=fetch), use a polyfill like `whatwg-fetch` before initialising Uppy. The Fetch API polyfill must be loaded _after_ the Promises polyfill, because Fetch uses Promises.
```shell
npm install es6-promise whatwg-fetch
```
```js
require('es6-promise/auto')
require('whatwg-fetch')
const Uppy = require('@uppy/core')
```
## FAQ
### Why not just use `<input type="file">`?