Pārlūkot izejas kodu

A few docs things (#2371)

Renée Kooi 4 gadi atpakaļ
vecāks
revīzija
8c826313b6
77 mainītis faili ar 244 papildinājumiem un 136 dzēšanām
  1. 1 1
      README.md
  2. 1 1
      bin/locale-packs.js
  3. 1 1
      examples/aws-companion/main.js
  4. 1 1
      examples/aws-presigned-url/main.js
  5. 1 1
      examples/bundled/index.js
  6. 1 1
      examples/custom-provider/client/main.js
  7. 1 1
      examples/dev/Dashboard.js
  8. 1 1
      examples/dev/DragDrop.js
  9. 1 1
      examples/digitalocean-spaces/main.js
  10. 2 2
      examples/multiple-instances/main.js
  11. 1 1
      examples/node-xhr/main.js
  12. 3 3
      examples/php-xhr/main.js
  13. 3 3
      examples/python-xhr/main.js
  14. 1 1
      examples/react-native-expo/App.js
  15. 1 1
      examples/redux/main.js
  16. 1 1
      examples/xhr-bundle/main.js
  17. 1 1
      packages/@uppy/aws-s3-multipart/README.md
  18. 1 1
      packages/@uppy/aws-s3/README.md
  19. 1 1
      packages/@uppy/companion-client/README.md
  20. 1 1
      packages/@uppy/core/README.md
  21. 1 1
      packages/@uppy/dashboard/README.md
  22. 1 1
      packages/@uppy/drag-drop/README.md
  23. 1 1
      packages/@uppy/dropbox/README.md
  24. 1 1
      packages/@uppy/facebook/README.md
  25. 1 1
      packages/@uppy/file-input/README.md
  26. 1 1
      packages/@uppy/form/README.md
  27. 1 1
      packages/@uppy/golden-retriever/README.md
  28. 1 1
      packages/@uppy/google-drive/README.md
  29. 1 1
      packages/@uppy/informer/README.md
  30. 1 1
      packages/@uppy/instagram/README.md
  31. 1 1
      packages/@uppy/locales/README.md
  32. 1 1
      packages/@uppy/onedrive/README.md
  33. 1 1
      packages/@uppy/progress-bar/README.md
  34. 1 1
      packages/@uppy/react/README.md
  35. 1 1
      packages/@uppy/react/src/Dashboard.test.js
  36. 3 3
      packages/@uppy/react/src/DashboardModal.test.js
  37. 1 1
      packages/@uppy/react/src/DragDrop.test.js
  38. 1 1
      packages/@uppy/react/src/ProgressBar.test.js
  39. 1 1
      packages/@uppy/react/src/StatusBar.test.js
  40. 1 1
      packages/@uppy/redux-dev-tools/README.md
  41. 1 1
      packages/@uppy/robodog/src/createUppy.js
  42. 1 1
      packages/@uppy/robodog/src/form.js
  43. 1 1
      packages/@uppy/screen-capture/README.md
  44. 1 1
      packages/@uppy/status-bar/README.md
  45. 1 1
      packages/@uppy/store-default/README.md
  46. 1 1
      packages/@uppy/store-redux/README.md
  47. 1 1
      packages/@uppy/thumbnail-generator/README.md
  48. 1 1
      packages/@uppy/transloadit/README.md
  49. 1 1
      packages/@uppy/tus/README.md
  50. 1 1
      packages/@uppy/url/README.md
  51. 1 1
      packages/@uppy/webcam/README.md
  52. 7 7
      packages/@uppy/webcam/src/index.test.js
  53. 1 1
      packages/@uppy/xhr-upload/README.md
  54. 1 1
      test/endtoend/chaos-monkey/main.js
  55. 1 1
      test/endtoend/i18n-drag-drop/main.js
  56. 1 1
      test/endtoend/providers/main.js
  57. 1 1
      test/endtoend/thumbnails/main.js
  58. 1 1
      test/endtoend/transloadit/main.js
  59. 1 1
      test/endtoend/tus-dashboard/main.js
  60. 1 1
      test/endtoend/tus-drag-drop/main.js
  61. 1 1
      test/endtoend/url-plugin/main.js
  62. 1 1
      test/endtoend/xhr-limit/main.js
  63. 1 1
      website/src/docs/fileinput.md
  64. 1 1
      website/src/docs/index.md
  65. 2 2
      website/src/docs/locales.md
  66. 2 2
      website/src/docs/plugin-common-options.md
  67. 1 1
      website/src/docs/providers.md
  68. 3 3
      website/src/docs/react-initializing.md
  69. 1 1
      website/src/docs/react.md
  70. 4 4
      website/src/docs/redux.md
  71. 3 3
      website/src/docs/stores.md
  72. 16 6
      website/src/docs/transloadit.md
  73. 131 33
      website/src/docs/uppy.md
  74. 1 1
      website/src/examples/dashboard/app.es6
  75. 1 1
      website/src/examples/dashboard/index.ejs
  76. 1 1
      website/src/examples/transloadit/app.es6
  77. 1 1
      website/src/examples/transloadit/index.ejs

+ 1 - 1
README.md

@@ -31,7 +31,7 @@ const Instagram = require('@uppy/instagram')
 const Webcam = require('@uppy/webcam')
 const Tus = require('@uppy/tus')
 
-const uppy = Uppy({ autoProceed: false })
+const uppy = new Uppy({ autoProceed: false })
   .use(Dashboard, { trigger: '#select-files' })
   .use(GoogleDrive, { target: Dashboard, companionUrl: 'https://companion.uppy.io' })
   .use(Instagram, { target: Dashboard, companionUrl: 'https://companion.uppy.io' })

+ 1 - 1
bin/locale-packs.js

@@ -4,7 +4,7 @@ const chalk = require('chalk')
 const path = require('path')
 const stringifyObject = require('stringify-object')
 const fs = require('fs')
-const uppy = Uppy()
+const uppy = new Uppy()
 let localePack = {}
 const plugins = {}
 const sources = {}

+ 1 - 1
examples/aws-companion/main.js

@@ -4,7 +4,7 @@ const Webcam = require('@uppy/webcam')
 const Dashboard = require('@uppy/dashboard')
 const AwsS3 = require('@uppy/aws-s3')
 
-const uppy = Uppy({
+const uppy = new Uppy({
   debug: true,
   autoProceed: false
 })

+ 1 - 1
examples/aws-presigned-url/main.js

@@ -2,7 +2,7 @@ const Uppy = require('@uppy/core')
 const Dashboard = require('@uppy/dashboard')
 const AwsS3 = require('@uppy/aws-s3')
 
-const uppy = Uppy({
+const uppy = new Uppy({
   debug: true
 })
 

+ 1 - 1
examples/bundled/index.js

@@ -13,7 +13,7 @@ require('@uppy/webcam/dist/style.css')
 
 const TUS_ENDPOINT = 'https://master.tus.io/files/'
 
-const uppy = Uppy({
+const uppy = new Uppy({
   debug: true,
   meta: {
     username: 'John',

+ 1 - 1
examples/custom-provider/client/main.js

@@ -4,7 +4,7 @@ const Tus = require('@uppy/tus')
 const MyCustomProvider = require('./MyCustomProvider')
 const Dashboard = require('@uppy/dashboard')
 
-const uppy = Uppy({
+const uppy = new Uppy({
   debug: true
 })
 

+ 1 - 1
examples/dev/Dashboard.js

@@ -43,7 +43,7 @@ const RESTORE = false
 // Rest is implementation! Obviously edit as necessary...
 
 module.exports = () => {
-  const uppyDashboard = Uppy({
+  const uppyDashboard = new Uppy({
     logger: Uppy.debugLogger,
     meta: {
       username: 'John',

+ 1 - 1
examples/dev/DragDrop.js

@@ -5,7 +5,7 @@ const DragDrop = require('@uppy/drag-drop/src')
 const ProgressBar = require('@uppy/progress-bar/src')
 
 module.exports = () => {
-  const uppyDragDrop = Uppy({
+  const uppyDragDrop = new Uppy({
     debug: true,
     autoProceed: true
   })

+ 1 - 1
examples/digitalocean-spaces/main.js

@@ -2,7 +2,7 @@ const Uppy = require('@uppy/core')
 const Dashboard = require('@uppy/dashboard')
 const AwsS3 = require('@uppy/aws-s3')
 
-const uppy = Uppy({
+const uppy = new Uppy({
   debug: true
 })
 

+ 2 - 2
examples/multiple-instances/main.js

@@ -4,7 +4,7 @@ const GoldenRetriever = require('@uppy/golden-retriever')
 
 // Initialise two Uppy instances with the GoldenRetriever plugin,
 // but with different `id`s.
-const a = Uppy({
+const a = new Uppy({
   id: 'a',
   debug: true
 })
@@ -15,7 +15,7 @@ const a = Uppy({
   })
   .use(GoldenRetriever, { serviceWorker: false })
 
-const b = Uppy({
+const b = new Uppy({
   id: 'b',
   debug: true
 })

+ 1 - 1
examples/node-xhr/main.js

@@ -3,7 +3,7 @@ const Webcam = require('@uppy/webcam')
 const Dashboard = require('@uppy/dashboard')
 const xhr = require('@uppy/xhr-upload')
 
-const uppy = Uppy({
+const uppy = new Uppy({
   debug: true,
   autoProceed: false
 })

+ 3 - 3
examples/php-xhr/main.js

@@ -1,9 +1,9 @@
 const Uppy = require('@uppy/core')
 const Webcam = require('@uppy/webcam')
 const Dashboard = require('@uppy/dashboard')
-const xhr = require('@uppy/xhr-upload')
+const XHRUpload = require('@uppy/xhr-upload')
 
-const uppy = Uppy({
+const uppy = new Uppy({
   debug: true,
   autoProceed: false
 })
@@ -14,6 +14,6 @@ uppy.use(Dashboard, {
   target: 'body',
   plugins: ['Webcam']
 })
-uppy.use(xhr, {
+uppy.use(XHRUpload, {
   endpoint: 'http://localhost:3020/upload.php'
 })

+ 3 - 3
examples/python-xhr/main.js

@@ -1,9 +1,9 @@
 const Uppy = require('@uppy/core')
 const Webcam = require('@uppy/webcam')
 const Dashboard = require('@uppy/dashboard')
-const xhr = require('@uppy/xhr-upload')
+const XHRUpload = require('@uppy/xhr-upload')
 
-const uppy = Uppy({
+const uppy = new Uppy({
   debug: true,
   autoProceed: false
 })
@@ -14,6 +14,6 @@ uppy.use(Dashboard, {
   target: 'body',
   plugins: ['Webcam']
 })
-uppy.use(xhr, {
+uppy.use(XHRUpload, {
   endpoint: 'http://localhost:3020/upload'
 })

+ 1 - 1
examples/react-native-expo/App.js

@@ -41,7 +41,7 @@ export default class App extends React.Component {
     this.togglePauseResume = this.togglePauseResume.bind(this)
 
     console.log('Is this React Native?', this.isReactNative)
-    this.uppy = Uppy({ autoProceed: true, debug: true })
+    this.uppy = new Uppy({ autoProceed: true, debug: true })
     this.uppy.use(Tus, {
       endpoint: 'https://master.tus.io/files/',
       urlStorage: AsyncStorage,

+ 1 - 1
examples/redux/main.js

@@ -59,7 +59,7 @@ document.querySelector('#incrementAsync').onclick = () => {
 }
 
 // Uppy using the same store
-const uppy = Uppy({
+const uppy = new Uppy({
   id: 'redux',
   store: uppyReduxStore({ store: store }),
   // If we had placed our `reducer` elsewhere in Redux, eg. under an `uppy` key in the state for a profile page,

+ 1 - 1
examples/xhr-bundle/main.js

@@ -2,7 +2,7 @@ const Uppy = require('@uppy/core')
 const Dashboard = require('@uppy/dashboard')
 const XHRUpload = require('@uppy/xhr-upload')
 
-const uppy = Uppy({
+const uppy = new Uppy({
   debug: true,
   meta: { something: 'xyz' }
 })

+ 1 - 1
packages/@uppy/aws-s3-multipart/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const AwsS3Multipart = require('@uppy/aws-s3-multipart')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(AwsS3Multipart, {
   limit: 2,
   companionUrl: 'https://companion.myapp.com/'

+ 1 - 1
packages/@uppy/aws-s3/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const AwsS3 = require('@uppy/aws-s3')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(AwsS3, {
   limit: 2,
   timeout: ms('1 minute'),

+ 1 - 1
packages/@uppy/companion-client/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const { Provider, RequestClient, Socket } = require('@uppy/companion-client')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 
 const client = new RequestClient(uppy, { companionUrl: 'https://uppy.mywebsite.com/' })
 client.get('/drive/list').then(() => {})

+ 1 - 1
packages/@uppy/core/README.md

@@ -20,7 +20,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 ```js
 const Uppy = require('@uppy/core')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(SomePlugin)
 ```
 

+ 1 - 1
packages/@uppy/dashboard/README.md

@@ -24,7 +24,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const Dashboard = require('@uppy/dashboard')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(Dashboard, {
   target: 'body',
   inline: true

+ 1 - 1
packages/@uppy/drag-drop/README.md

@@ -17,7 +17,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const DragDrop = require('@uppy/drag-drop')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(DragDrop, {
   target: '#upload'
 })

+ 1 - 1
packages/@uppy/dropbox/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const Dropbox = require('@uppy/dropbox')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(Dropbox, {
   // Options
 })

+ 1 - 1
packages/@uppy/facebook/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const Facebook = require('@uppy/facebook')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(Facebook, {
   // Options
 })

+ 1 - 1
packages/@uppy/file-input/README.md

@@ -17,7 +17,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const FileInput = require('@uppy/file-input')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(FileInput, {
   // Options
 })

+ 1 - 1
packages/@uppy/form/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const Form = require('@uppy/form')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(Form, {
   target: document.querySelector('form'),
   getMetaFromForm: true,

+ 1 - 1
packages/@uppy/golden-retriever/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const GoldenRetriever = require('@uppy/golden-retriever')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(GoldenRetriever, {
   // Options
 })

+ 1 - 1
packages/@uppy/google-drive/README.md

@@ -18,7 +18,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const GoogleDrive = require('@uppy/google-drive')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(GoogleDrive, {
   // Options
 })

+ 1 - 1
packages/@uppy/informer/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const Informer = require('@uppy/informer')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(Informer, {
   target: '#mount-point'
 })

+ 1 - 1
packages/@uppy/instagram/README.md

@@ -17,7 +17,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const Instagram = require('@uppy/instagram')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(Instagram, {
 })
 ```

+ 1 - 1
packages/@uppy/locales/README.md

@@ -22,7 +22,7 @@ $ npm install @uppy/core @uppy/locales --save
 ```js
 const Uppy = require('@uppy/core')
 const Russian = require('@uppy/locales/lib/ru_RU')
-const uppy = Uppy({
+const uppy = new Uppy({
   debug: true,
   meta: {
     username: 'John',

+ 1 - 1
packages/@uppy/onedrive/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const Facebook = require('@uppy/facebook')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(Facebook, {
   // Options
 })

+ 1 - 1
packages/@uppy/progress-bar/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const ProgressBar = require('@uppy/progress-bar')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(ProgressBar, {
   // Options
 })

+ 1 - 1
packages/@uppy/react/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const { DashboardModal } = require('@uppy/react')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 
 class Example extends React.Component {
   state = { open: false }

+ 1 - 1
packages/@uppy/react/src/Dashboard.test.js

@@ -15,7 +15,7 @@ describe('react <Dashboard />', () => {
   it('can be mounted and unmounted', () => {
     const oninstall = jest.fn()
     const onuninstall = jest.fn()
-    const uppy = Uppy()
+    const uppy = new Uppy()
     const dash = mount((
       <Dashboard
         uppy={uppy}

+ 3 - 3
packages/@uppy/react/src/DashboardModal.test.js

@@ -22,7 +22,7 @@ describe('react <DashboardModal />', () => {
   it('can be mounted and unmounted', () => {
     const oninstall = jest.fn()
     const onuninstall = jest.fn()
-    const uppy = Uppy()
+    const uppy = new Uppy()
     const dash = mount((
       <DashboardModal
         uppy={uppy}
@@ -41,7 +41,7 @@ describe('react <DashboardModal />', () => {
   })
 
   it('opens the modal using the `open={true}` prop', () => {
-    const uppy = Uppy()
+    const uppy = new Uppy()
     const dash = mount((
       <DashboardModal
         uppy={uppy}
@@ -60,7 +60,7 @@ describe('react <DashboardModal />', () => {
   })
 
   it('closes the modal using the `open={false}` prop', () => {
-    const uppy = Uppy()
+    const uppy = new Uppy()
     const dash = mount((
       <DashboardModal
         uppy={uppy}

+ 1 - 1
packages/@uppy/react/src/DragDrop.test.js

@@ -15,7 +15,7 @@ describe('react <DragDrop />', () => {
   it('can be mounted and unmounted', () => {
     const oninstall = jest.fn()
     const onuninstall = jest.fn()
-    const uppy = Uppy()
+    const uppy = new Uppy()
     const dash = mount((
       <DragDrop
         uppy={uppy}

+ 1 - 1
packages/@uppy/react/src/ProgressBar.test.js

@@ -15,7 +15,7 @@ describe('react <ProgressBar />', () => {
   it('can be mounted and unmounted', () => {
     const oninstall = jest.fn()
     const onuninstall = jest.fn()
-    const uppy = Uppy()
+    const uppy = new Uppy()
     const dash = mount((
       <ProgressBar
         uppy={uppy}

+ 1 - 1
packages/@uppy/react/src/StatusBar.test.js

@@ -15,7 +15,7 @@ describe('react <StatusBar />', () => {
   it('can be mounted and unmounted', () => {
     const oninstall = jest.fn()
     const onuninstall = jest.fn()
-    const uppy = Uppy()
+    const uppy = new Uppy()
     const dash = mount((
       <StatusBar
         uppy={uppy}

+ 1 - 1
packages/@uppy/redux-dev-tools/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const ReduxDevTools = require('uppy/redux-dev-tools')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(ReduxDevTools)
 ```
 

+ 1 - 1
packages/@uppy/robodog/src/createUppy.js

@@ -42,7 +42,7 @@ function createUppy (opts, overrides = {}) {
   })
   Object.assign(uppyOptions, overrides)
 
-  const uppy = Uppy(uppyOptions)
+  const uppy = new Uppy(uppyOptions)
 
   // Builtin event aliases
   Object.keys(eventNames).forEach((optionName) => {

+ 1 - 1
packages/@uppy/robodog/src/form.js

@@ -29,7 +29,7 @@ function form (target, opts) {
     locale: mergeDefaultLocale(defaultLocaleStrings, opts.locale)
   }
 
-  const uppy = Uppy(opts)
+  const uppy = new Uppy(opts)
   addTransloaditPlugin(uppy, opts)
 
   uppy.use(TransloaditFormResult, {

+ 1 - 1
packages/@uppy/screen-capture/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const ScreenCapture = require('@uppy/screen-capture')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(ScreenCapture)
 ```
 

+ 1 - 1
packages/@uppy/status-bar/README.md

@@ -16,7 +16,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const StatusBar = require('@uppy/status-bar')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(StatusBar, {
   target: 'body',
   hideUploadButton: false,

+ 1 - 1
packages/@uppy/store-default/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const DefaultStore = require('@uppy/store-default')
 
-const uppy = Uppy({
+const uppy = new Uppy({
   store: DefaultStore()
 })
 ```

+ 1 - 1
packages/@uppy/store-redux/README.md

@@ -27,7 +27,7 @@ const reducer = combineReducers({
 
 const store = createStore(reducer)
 
-const uppy = Uppy({
+const uppy = new Uppy({
   store: ReduxStore({
     store: store
   })

+ 1 - 1
packages/@uppy/thumbnail-generator/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const ThumbnailGenerator = require('@uppy/thumbnail-generator')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(ThumbnailGenerator, {
   thumbnailWidth: 200
 })

+ 1 - 1
packages/@uppy/transloadit/README.md

@@ -17,7 +17,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const Transloadit = require('@uppy/transloadit')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(Transloadit, {
   // Plugins
 })

+ 1 - 1
packages/@uppy/tus/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const Tus = require('@uppy/tus')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(Tus, {
   endpoint: 'https://master.tus.io/files/', // use your tus endpoint here
   resume: true,

+ 1 - 1
packages/@uppy/url/README.md

@@ -17,7 +17,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const Url = require('@uppy/url')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(Url, {
   // Options
 })

+ 1 - 1
packages/@uppy/webcam/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const Webcam = require('@uppy/webcam')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(Webcam, {
   mirror: true,
   facingMode: 'user',

+ 7 - 7
packages/@uppy/webcam/src/index.test.js

@@ -8,7 +8,7 @@ describe('Webcam', () => {
         isTypeSupported: () => true
       }
 
-      const uppy = Uppy().use(Webcam)
+      const uppy = new Uppy().use(Webcam)
       expect(
         uppy.getPlugin('Webcam')._getMediaRecorderOptions().mimeType
       ).not.toBeDefined()
@@ -19,7 +19,7 @@ describe('Webcam', () => {
         isTypeSupported: (ty) => ty === 'video/webm'
       }
 
-      const uppy = Uppy().use(Webcam, { preferredVideoMimeType: 'video/webm' })
+      const uppy = new Uppy().use(Webcam, { preferredVideoMimeType: 'video/webm' })
       expect(
         uppy.getPlugin('Webcam')._getMediaRecorderOptions().mimeType
       ).toEqual('video/webm')
@@ -30,7 +30,7 @@ describe('Webcam', () => {
         isTypeSupported: (ty) => ty === 'video/webm'
       }
 
-      const uppy = Uppy().use(Webcam, { preferredVideoMimeType: 'video/mp4' })
+      const uppy = new Uppy().use(Webcam, { preferredVideoMimeType: 'video/mp4' })
       expect(
         uppy.getPlugin('Webcam')._getMediaRecorderOptions().mimeType
       ).not.toBeDefined()
@@ -41,7 +41,7 @@ describe('Webcam', () => {
         isTypeSupported: () => true
       }
 
-      const uppy = Uppy({
+      const uppy = new Uppy({
         restrictions: { allowedFileTypes: ['video/mp4', 'video/webm'] }
       }).use(Webcam)
       expect(
@@ -54,7 +54,7 @@ describe('Webcam', () => {
         isTypeSupported: (ty) => ty === 'video/webm'
       }
 
-      const uppy = Uppy({
+      const uppy = new Uppy({
         restrictions: { allowedFileTypes: ['video/mp4', 'video/webm'] }
       }).use(Webcam)
       expect(
@@ -67,7 +67,7 @@ describe('Webcam', () => {
         isTypeSupported: () => true
       }
 
-      const uppy = Uppy({
+      const uppy = new Uppy({
         restrictions: { allowedFileTypes: ['video/mp4', 'video/webm'] }
       })
         .use(Webcam, { preferredVideoMimeType: 'video/webm' })
@@ -81,7 +81,7 @@ describe('Webcam', () => {
         isTypeSupported: () => false
       }
 
-      const uppy = Uppy({
+      const uppy = new Uppy({
         restrictions: { allowedFileTypes: ['video/mp4', 'video/webm'] }
       }).use(Webcam)
       expect(

+ 1 - 1
packages/@uppy/xhr-upload/README.md

@@ -15,7 +15,7 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 const Uppy = require('@uppy/core')
 const XHRUpload = require('@uppy/xhr-upload')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(Uppy, {
   // Options
 })

+ 1 - 1
test/endtoend/chaos-monkey/main.js

@@ -13,7 +13,7 @@ window.setup = function (options) {
   id += 1
 
   // Initialise Uppy with Drag & Drop
-  const uppy = Uppy({ id: `uppy${id}`, debug: true })
+  const uppy = new Uppy({ id: `uppy${id}`, debug: true })
 
   uppy.use(Dashboard, { inline: true, target: '#dash' })
   uppy.use(Tus, {

+ 1 - 1
test/endtoend/i18n-drag-drop/main.js

@@ -5,7 +5,7 @@ const DragDrop = require('@uppy/drag-drop')
 const XHRUpload = require('@uppy/xhr-upload')
 const ProgressBar = require('@uppy/progress-bar')
 
-const uppyi18n = Uppy({
+const uppyi18n = new Uppy({
   id: 'uppyi18n',
   debug: true,
   autoProceed: true

+ 1 - 1
test/endtoend/providers/main.js

@@ -10,7 +10,7 @@ const Tus = require('@uppy/tus')
 const isOnTravis = !!(process.env.TRAVIS && process.env.CI)
 const companionUrl = isOnTravis ? 'http://companion.test:3030' : 'http://localhost:3020'
 
-window.uppy = Uppy({
+window.uppy = new Uppy({
   id: 'uppyProvider',
   debug: true,
   autoProceed: true

+ 1 - 1
test/endtoend/thumbnails/main.js

@@ -5,7 +5,7 @@ const Uppy = require('@uppy/core')
 const ThumbnailGenerator = require('@uppy/thumbnail-generator')
 const FileInput = require('@uppy/file-input')
 
-const uppyThumbnails = Uppy({
+const uppyThumbnails = new Uppy({
   id: 'uppyThumbnails',
   autoProceed: false,
   debug: true

+ 1 - 1
test/endtoend/transloadit/main.js

@@ -5,7 +5,7 @@ const Dashboard = require('@uppy/dashboard')
 const Transloadit = require('@uppy/transloadit')
 
 function initUppyTransloadit (transloaditKey) {
-  var uppyTransloadit = Uppy({
+  var uppyTransloadit = new Uppy({
     id: 'uppyTransloadit',
     debug: true,
     autoProceed: true

+ 1 - 1
test/endtoend/tus-dashboard/main.js

@@ -7,7 +7,7 @@ const Tus = require('@uppy/tus')
 const isOnTravis = !!(process.env.TRAVIS && process.env.CI)
 const endpoint = isOnTravis ? 'http://companion.test:1080' : 'http://localhost:1080'
 
-const uppyDashboard = Uppy({
+const uppyDashboard = new Uppy({
   id: 'uppyDashboard',
   debug: true
 })

+ 1 - 1
test/endtoend/tus-drag-drop/main.js

@@ -9,7 +9,7 @@ const isOnTravis = !!(process.env.TRAVIS && process.env.CI)
 const endpoint = isOnTravis ? 'http://companion.test:1080' : 'http://localhost:1080'
 
 // Initialise Uppy with Drag & Drop
-const uppyDragDrop = Uppy({
+const uppyDragDrop = new Uppy({
   id: 'uppyDragDrop',
   debug: true,
   autoProceed: true

+ 1 - 1
test/endtoend/url-plugin/main.js

@@ -9,7 +9,7 @@ const isOnTravis = !!(process.env.TRAVIS && process.env.CI)
 const companionUrl = isOnTravis ? 'http://companion.test:3030' : 'http://localhost:3030'
 const endpoint = isOnTravis ? 'http://companion.test:1080' : 'http://localhost:1080'
 
-window.uppy = Uppy({
+window.uppy = new Uppy({
   id: 'uppyProvider',
   debug: true
 })

+ 1 - 1
test/endtoend/xhr-limit/main.js

@@ -6,7 +6,7 @@ const FileInput = require('@uppy/file-input')
 const XHRUpload = require('@uppy/xhr-upload')
 
 function startXHRLimitTest (endpoint) {
-  const uppy = Uppy({
+  const uppy = new Uppy({
     id: 'uppyXhrLimit',
     debug: true,
     autoProceed: false

+ 1 - 1
website/src/docs/fileinput.md

@@ -103,7 +103,7 @@ If you don’t like the look/feel of the button rendered by `@uppy/file-input`,
 Then add this JS to attach it to Uppy:
 
 ```js
-const uppy = Uppy(...)
+const uppy = new Uppy(...)
 const fileInput = document.querySelector('#my-file-input')
 
 fileInput.addEventListener('change', (event) => {

+ 1 - 1
website/src/docs/index.md

@@ -77,7 +77,7 @@ const Dashboard = require('@uppy/dashboard')
 require('@uppy/core/dist/style.css')
 require('@uppy/dashboard/dist/style.css')
  
-const uppy = Uppy()
+const uppy = new Uppy()
   .use(Dashboard, {
     trigger: '#select-files'
   })

+ 2 - 2
website/src/docs/locales.md

@@ -22,7 +22,7 @@ npm i @uppy/core @uppy/locales
 ```js
 const Uppy = require('@uppy/core')
 const German = require('@uppy/locales/lib/de_DE') // see below for the full list of locales
-const uppy = Uppy({
+const uppy = new Uppy({
   debug: true,
   locale: German
 })
@@ -52,7 +52,7 @@ Many plugins come with their own locale strings, and the packs we provide consis
 const Uppy = require('@uppy/core')
 const DragDrop = require('@uppy/drag-drop')
 const Russian = require('@uppy/locales/lib/ru_RU')
-const uppy = Uppy({
+const uppy = new Uppy({
   debug: true,
   autoProceed: true,
   locale: Russian

+ 2 - 2
website/src/docs/plugin-common-options.md

@@ -19,7 +19,7 @@ Can be a `string` CSS selector, a DOM element, or a Plugin class. Consider the f
 ```js
 const Uppy = require('@uppy/core')
 const DragDrop = require('@uppy/drag-drop')
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(DragDrop, { target: 'body' })
 // or: uppy.use(DragDrop, { target: document.body })
 ```
@@ -30,7 +30,7 @@ While in this one, we are using the `@uppy/dashboard` plugin, which can act as a
 const Uppy = require('@uppy/core')
 const Dashboard = require('@uppy/dashboard')
 const GoogleDrive = require('@uppy/google-drive')
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(Dashboard, {
   trigger: '#uppyModalOpener'
 })

+ 1 - 1
website/src/docs/providers.md

@@ -17,7 +17,7 @@ Here's a quick example:
 ```js
 const Uppy = require('@uppy/core')
 const Dashboard = require('@uppy/dashboard')
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(Dashboard, {
   trigger: '#pick-files'
 })

+ 3 - 3
website/src/docs/react-initializing.md

@@ -18,7 +18,7 @@ With React Hooks, the `useMemo` hook can be used to create an instance once and
 const MyComponent = () => {
   const uppy = React.useMemo(() => {
     // Do all the configuration here
-    return Uppy()
+    return new Uppy()
       .use(Transloadit, {})
   }, []);
 
@@ -37,12 +37,12 @@ function useUppy (factory) {
   React.useEffect(() => {
     return () => uppy.close()
   }, [])
-  return uppy
+  return new uppy
 }
 
 // Then use it as:
 const uppy = useUppy(() => {
-  return Uppy()
+  return new Uppy()
     .use(Tus, {})
 })
 ```

+ 1 - 1
website/src/docs/react.md

@@ -36,7 +36,7 @@ import Uppy from '@uppy/core'
 import Tus from '@uppy/tus'
 import { DragDrop } from '@uppy/react'
 
-const uppy = Uppy({
+const uppy = new Uppy({
   meta: { type: 'avatar' },
   restrictions: { maxNumberOfFiles: 1 },
   autoProceed: true

+ 4 - 4
website/src/docs/redux.md

@@ -16,15 +16,15 @@ You can tell Uppy to use your app’s Redux store for its files and UI state. Pl
 
 ```js
 const { createStore } = require('redux')
-const ReduxStore = require('@uppy/store-redux')
+const createReduxStore = require('@uppy/store-redux')
 
 const reducer = combineReducers({
   ...reducers,
   uppy: ReduxStore.reducer
 })
 
-const uppy = Uppy({
-  store: ReduxStore({
+const uppy = new Uppy({
+  store: createReduxStore({
     store: createStore(reducer) // That’s a lot of stores!
   })
 })
@@ -42,7 +42,7 @@ This is a `ReduxDevTools` plugin that simply syncs with the [redux-devtools](htt
 const Uppy = require('@uppy/core')
 const ReduxDevTools = require('@uppy/redux-dev-tools')
 
-const uppy = Uppy({
+const uppy = new Uppy({
   debug: true,
   meta: {
     username: 'John',

+ 3 - 3
website/src/docs/stores.md

@@ -28,7 +28,7 @@ To use a store, pass an instance to the [`store` option](/docs/uppy#store-defaul
 ```js
 const defaultStore = require('@uppy/store-default')
 
-const uppy = Uppy({
+const uppy = new Uppy({
   store: defaultStore()
 })
 ```
@@ -62,7 +62,7 @@ const { createStore } = require('redux')
 const ReduxStore = require('@uppy/store-redux')
 
 const store = createStore(reducer)
-const uppy = Uppy({
+const uppy = new Uppy({
   store: ReduxStore({
     store: store // That's a lot of stores!
   })
@@ -91,7 +91,7 @@ ReduxStore({
 If you'd rather not store the Uppy state under the `state.uppy` key at all, use the `selector` option to the `ReduxStore` constructor to tell it where to find state instead:
 
 ```js
-const uppy = Uppy({
+const uppy = new Uppy({
   store: ReduxStore({
     store: store,
     id: 'avatarUpload',

+ 16 - 6
website/src/docs/transloadit.md

@@ -120,8 +120,8 @@ uppy.use(Transloadit, {
       encode: {
         robot: '/video/encode',
         use: {
-          steps: [ ':original' ],
-          fields: [ 'file_input_field2' ]
+          steps: [':original'],
+          fields: ['file_input_field2']
         },
         preset: 'iphone'
       }
@@ -130,13 +130,23 @@ uppy.use(Transloadit, {
 })
 ```
 
-### `waitForEncoding`
+<a id="waitForEncoding"></a>
+### `waitForEncoding: false`
 
-Configures whether or not to wait for all Assemblies to complete before completing the upload.
+By default, the Transloadit plugin uploads files to Assemblies and then marks the files as complete in Uppy. The Assemblies will complete (or error) in the background but Uppy won't know or care about it.
 
-### `waitForMetadata`
+When `waitForEncoding` is set to true, the Transloadit plugin waits for Assemblies to complete before the files are marked as completed. This means users have to wait for a potentially long time, depending on how complicated your Assembly instructions are. But, you can receive transcoding results on the client side, and have a fully client-side experience this way.
 
-Configures whether or not to wait for metadata to be extracted from uploaded files before completing the upload. If `waitForEncoding` is enabled, this has no effect.
+When this is enabled, you can listen for the [`transloadit:result`](#transloadit-result) and [`transloadit:complete`](#transloadit-complete) events.
+
+<a id="waitForMetadata"></a>
+### `waitForMetadata: false`
+
+By default, the Transloadit plugin uploads files to Assemblies and then marks the files as complete in Uppy. The Assemblies will complete (or error) in the background but Uppy won't know or care about it.
+
+When `waitForMetadata` is set to true, the Transloadit plugin waits for Transloadit's backend to extract metadata from all the uploaded files. This is mostly handy if you want to have a quick user experience (so your users don't necessarily need to wait for all the encoding to complete), but you do want to let users know about some types of errors that can be caught early on, like file format issues.
+
+When this is enabled, you can listen for the [`transloadit:upload`](#transloadit-upload) event.
 
 ### `importFromUploadURLs`
 

+ 131 - 33
website/src/docs/uppy.md

@@ -13,7 +13,7 @@ This is the core module that orchestrates everything in Uppy, managing state and
 ```js
 const Uppy = require('@uppy/core')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 ```
 
 ## Installation
@@ -36,7 +36,7 @@ When using TypeScript, Uppy has weak type checking by default. That means that t
 ```ts
 import Uppy = require('@uppy/core')
 import Tus = require('@uppy/tus')
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(Tus, {
   invalidOption: null,
   endpoint: ['a', 'wrong', 'type']
@@ -68,7 +68,7 @@ In Uppy 2.0, this generic parameter will be removed, and your plugin options wil
 The Uppy core module has the following configurable options:
 
 ```js
-const uppy = Uppy({
+const uppy = new Uppy({
   id: 'uppy',
   autoProceed: false,
   allowMultipleUploads: true,
@@ -98,8 +98,8 @@ Note that this ID should be persistent across page reloads and navigation—it s
 For example, if one Uppy instance is used to upload user avatars, and another to add photos to a blog post, you might use:
 
 ```js
-const avatarUploader = Uppy({ id: 'avatar' })
-const photoUploader = Uppy({ id: 'post' })
+const avatarUploader = new Uppy({ id: 'avatar' })
+const photoUploader = new Uppy({ id: 'post' })
 ```
 
 ### `autoProceed: false`
@@ -122,7 +122,7 @@ Set `logger: Uppy.debugLogger` to get debug info output to the browser console:
 
 ```js
 const Uppy = require('@uppy/core')
-const uppy = Uppy({
+const uppy = new Uppy({
   logger: Uppy.debugLogger
 })
 ```
@@ -309,7 +309,7 @@ Instead of overriding strings yourself, consider using [one of our language pack
 ```js
 const russianLocale = require('@uppy/locales/lib/ru_RU')
 // ^-- OR: import russianLocale from '@uppy/locales/lib/ru_RU'
-const uppy = Uppy({
+const uppy = new Uppy({
   locale: russianLocale,
 })
 ```
@@ -339,6 +339,66 @@ This option can be used to plug Uppy state into an external state management lib
 
 <!-- TODO document store API -->
 
+## File Objects
+
+Uppy internally uses file objects that abstract over local files and files from remote providers, and that contain additional data like user-specified metadata and upload progress information.
+
+### `file.source`
+
+Name of the plugin that was responsible for adding this file. Typically a remote provider plugin like `'GoogleDrive'` or a UI plugin like `'DragDrop'`.
+
+### `file.id`
+
+Unique ID for the file.
+
+### `file.meta`
+
+Object containing file metadata. Any file metadata should be JSON-serializable.
+
+### `file.type`
+
+MIME type of the file. This may actually be guessed if a file type was not provided by the user's browser, so this is a best-effort value and not guaranteed to be accurate.
+
+### `file.data`
+
+For local files, this is the actual [`File`][] or [`Blob`][] object representing the file contents.
+
+For files that are imported from remote providers, the file data is not available in the browser.
+
+[`File`]: https://developer.mozilla.org/en-US/docs/Web/API/File
+[`Blob`]: https://developer.mozilla.org/en-US/docs/Web/API/Blob
+
+### `file.progress`
+
+An object with upload progress data.
+
+**Properties**
+- `bytesUploaded` - Number of bytes uploaded so far.
+- `bytesTotal` - Number of bytes that must be uploaded in total.
+- `uploadStarted` - Null if the upload has not started yet. Once started, this property contains a UNIX timestamp. Note that this is only set _after_ preprocessing.
+- `uploadComplete` - Boolean indicating if the upload has completed. Note this does _not_ mean that postprocessing has completed, too.
+- `percentage` - Integer percentage between 0 and 100.
+
+### `file.size`
+
+Size in bytes of the file.
+
+### `file.isRemote`
+
+Boolean: is this file imported from a remote provider?
+
+### `file.remote`
+
+Grab bag of data for remote providers. Generally not interesting for end users.
+
+### `file.preview`
+
+An optional URL to a visual thumbnail for the file.
+
+### `file.uploadURL`
+
+When an upload is completed, this may contain a URL to the uploaded file. Depending on server configuration it may not be accessible or accurate.
+
 ## Methods
 
 ### `uppy.use(plugin, opts)`
@@ -349,7 +409,7 @@ Add a plugin to Uppy, with an optional plugin options object.
 const Uppy = require('@uppy/core')
 const DragDrop = require('@uppy/drag-drop')
 
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.use(DragDrop, { target: 'body' })
 ```
 
@@ -407,7 +467,7 @@ Removing a file that is already being uploaded cancels that upload.
 
 ### `uppy.getFile(fileID)`
 
-Get a specific file object by its ID.
+Get a specific [File Object][File Objects] by its ID.
 
 ```js
 const file = uppy.getFile('uppyteamkongjpg1501851828779')
@@ -423,7 +483,7 @@ file.preview   // value that can be used to populate "src" attribute of an "img"
 
 ### `uppy.getFiles()`
 
-Get an array of all file objects in Uppy. See [uppy.getFile()](#uppy-getFile-fileID) for an example of the file object format.
+Get an array of all [File Objects][] that have been added to Uppy.
 
 ```js
 const prettierBytes = require('@transloadit/prettier-bytes')
@@ -440,7 +500,7 @@ Start uploading selected files.
 Returns a Promise `result` that resolves with an object containing two arrays of uploaded files:
 
 - `result.successful` - Files that were uploaded successfully.
-- `result.failed` - Files that did not upload successfully. These file objects will have a `.error` property describing what went wrong.
+- `result.failed` - Files that did not upload successfully. These [File Objects][] will have a `.error` property describing what went wrong.
 
 ```js
 uppy.upload().then((result) => {
@@ -534,7 +594,7 @@ Returns the current state from the [Store](#store-defaultStore).
 
 ### `uppy.setFileState(fileID, state)`
 
-Update the state for a single file. This is mostly useful for plugins that may want to store data on file objects, or that need to pass file-specific configurations to other plugins that support it.
+Update the state for a single file. This is mostly useful for plugins that may want to store data on [File Objects][], or that need to pass file-specific configurations to other plugins that support it.
 
 `fileID` is the string file ID. `state` is an object that will be merged into the file's state object.
 
@@ -563,7 +623,7 @@ uppy.setFileMeta('myfileID', { resize: 1500 })
 Change Uppy options on the fly. For example, to conditionally change `restrictions.allowedFileTypes` or `locale`:
 
 ```js
-const uppy = Uppy()
+const uppy = new Uppy()
 uppy.setOptions({
   restrictions: { maxNumberOfFiles: 3 },
   autoProceed: true
@@ -649,6 +709,9 @@ Uppy exposes events that you can subscribe to in your app:
 
 Fired each time a file is added.
 
+**Parameters**
+- `file` - The [File Object][File Objects] representing the file that was added.
+
 ```javascript
 uppy.on('file-added', (file) => {
   console.log('Added file', file)
@@ -659,16 +722,18 @@ uppy.on('file-added', (file) => {
 
 Fired each time a file is removed.
 
+**Parameters**
+- `file` - The [File Object][File Objects] representing the file that was removed.
+- `reason` - A string explaining why the file was removed. See [#2301](https://github.com/transloadit/uppy/issues/2301#issue-628931176) for details. Current reasons are: `removed-by-user` and `cancel-all`.
+
+**Example**
+
 ```javascript
 uppy.on('file-removed', (file, reason) => {
   console.log('Removed file', file)
 })
 ```
 
-Reason is provided as a second argument, so that you can distinguish when a user manually removed a file in the UI vs API calling `uppy.reset()` or `uppy.cancel()`. See [#2301](https://github.com/transloadit/uppy/issues/2301#issue-628931176) for details.
-
-Current reasons are: `removed-by-user` and `cancel-all`.
-
 ```js
 uppy.on('file-removed', (file, reason) => {
   removeFileFromUploadingCounterUI(file)
@@ -696,6 +761,11 @@ uppy.on('upload', (data) => {
 
 Fired each time file upload progress is available:
 
+**Parameters**
+- `file` - The [File Object][File Objects] for the file whose upload has progressed.
+- `progress` - [Progress object](#file-progress).
+
+**Example**
 
 ```javascript
 uppy.on('upload-progress', (file, progress) => {
@@ -709,15 +779,21 @@ uppy.on('upload-progress', (file, progress) => {
 
 Fired each time a single upload is completed.
 
-`response` object (depending on the uploader plugin used, it might contain less info, the example is for `@uppy/xhr-upload`):
+**Parameters**
+- `file` - The [File Object][File Objects] that has just been fully uploaded.
+- `response` - An object with response data from the remote endpoint. The actual contents depend on the uploader plugin that is used.
 
-```js
-{
-  status, // HTTP status code (0, 200, 300)
-  body, // response body
-  uploadURL // the file url, if it was returned
-}
-```
+  For `@uppy/xhr-upload`, the shape is:
+
+  ```js
+  {
+    status, // HTTP status code (0, 200, 300)
+    body, // response body
+    uploadURL // the file url, if it was returned
+  }
+  ```
+
+**Example**
 
 ``` javascript
 uppy.on('upload-success', (file, response) => {
@@ -747,19 +823,35 @@ uppy.on('complete', (result) => {
 
 Fired when Uppy fails to upload/encode the entire upload. That error is then set to `uppy.getState().error`.
 
+**Parameters**
+- `error` - The error object.
+
+**Example**
+```js
+uppy.on('error', (error) => {
+  console.error(error.stack)
+})
+```
+
 ### `upload-error`
 
 Fired each time a single upload has errored.
 
-`response` object is an optional parameter and may be undefined depending on the uploader plugin used, it might contain less info, the example is for `@uppy/xhr-upload`:
+**Parameters**
+- `file` - The [File Object][File Objects] for the file whose upload has just errored.
+- `error` - The error object.
+- `response` - an optional parameter with response data from the upload endpoint. It may be undefined or contain different data depending on the uploader plugin in use.
 
-```js
-{
-  status, // HTTP status code (0, 200, 300)
-  body // response body
-}
-```
+  For `@uppy/xhr-upload`, the shape is:
+
+  ```js
+  {
+    status, // HTTP status code (0, 200, 300)
+    body // response body
+  }
+  ```
 
+**Example**
 ``` javascript
 uppy.on('upload-error', (file, error, response) => {
   console.log('error with file:', file.id)
@@ -781,8 +873,12 @@ uppy.on('upload-error', (file, error, response) => {
 
 ### `upload-retry`
 
-Fired when an upload has been retried (after an error, for example):
+Fired when an upload has been retried (after an error, for example).
 
+**Parameters**
+- `fileID` - ID of the file that is being retried.
+
+**Example**
 ```js
 uppy.on('upload-retry', (fileID) => {
   console.log('upload retried:', fileID)
@@ -833,3 +929,5 @@ uppy.on('reset-progress', () => {
   // progress was reset
 })
 ```
+
+[File Objects]: #File-Objects

+ 1 - 1
website/src/examples/dashboard/app.es6

@@ -29,7 +29,7 @@ function uppyInit () {
 
   const opts = window.uppyOptions
 
-  const uppy = Uppy({
+  const uppy = new Uppy({
     logger: Uppy.debugLogger
   })
 

+ 1 - 1
website/src/examples/dashboard/index.ejs

@@ -34,7 +34,7 @@ const ScreenCapture = require('@uppy/screen-capture')
 const ImageEditor = require('@uppy/image-editor')
 const Tus = require('@uppy/tus')
 
-const uppy = Uppy({
+const uppy = new Uppy({
   debug: true,
   autoProceed: false,
   restrictions: {

+ 1 - 1
website/src/examples/transloadit/app.es6

@@ -20,7 +20,7 @@ function initUppy (opts = {}) {
     window.uppy.close()
   }
 
-  const uppy = Uppy({
+  const uppy = new Uppy({
     debug: true,
     autoProceed: false,
     restrictions: {

+ 1 - 1
website/src/examples/transloadit/index.ejs

@@ -96,7 +96,7 @@ const Webcam = require('@uppy/webcam')
 const Transloadit = require('@uppy/transloadit')
 const Instagram = require('@uppy/instagram')
 
-const uppy = Uppy({
+const uppy = new Uppy({
   debug: true,
   autoProceed: false,
   restrictions: {