Rename Tus10 to Tus.

This commit is contained in:
Renée Kooi 2017-10-15 23:29:40 +02:00
parent 172575fb79
commit f76d582901
No known key found for this signature in database
GPG key ID: 30516CF2A8E63718
20 changed files with 64 additions and 44 deletions

View file

@ -25,13 +25,13 @@ const Uppy = require('uppy/lib/core')
const Dashboard = require('uppy/lib/plugins/Dashboard')
const Webcam = require('uppy/lib/plugins/Webcam')
const GoogleDrive = require('uppy/lib/plugins/GoogleDrive')
const Tus10 = require('uppy/lib/plugins/Tus10')
const Tus = require('uppy/lib/plugins/Tus')
const uppy = Uppy({ autoProceed: false })
.use(Dashboard, { trigger: '#select-files' })
.use(Webcam, { target: Dashboard })
.use(GoogleDrive, { target: Dashboard, host: 'https://server.uppy.io' })
.use(Tus10, { endpoint: '://master.tus.io/files/' })
.use(Tus, { endpoint: '://master.tus.io/files/' })
.run()
.on('core:success', files => console.log(`Successfully uploaded these files: ${files}`))
```
@ -82,7 +82,7 @@ If you like, you can also use a pre-built bundle, for example from [unpkg CDN](h
<script>
var uppy = Uppy.Core()
uppy.use(Uppy.DragDrop, {target: '.UppyDragDrop'})
uppy.use(Uppy.Tus10, {endpoint: '//master.tus.io/files/'})
uppy.use(Uppy.Tus, {endpoint: '//master.tus.io/files/'})
uppy.run()
</script>
```

View file

@ -4,7 +4,7 @@ const Dashboard = require('../../src/plugins/Dashboard')
const Dropbox = require('../../src/plugins/Dropbox')
const Instagram = require('../../src/plugins/Instagram')
// const Webcam = require('../../src/plugins/Webcam')
const Tus10 = require('../../src/plugins/Tus10')
const Tus = require('../../src/plugins/Tus')
// const XHRUpload = require('../../src/plugins/XHRUpload')
// const FileInput = require('../../src/plugins/FileInput')
const MetaData = require('../../src/plugins/MetaData')
@ -61,7 +61,7 @@ const uppy = Uppy({
// .use(GoogleDrive, {target: Dashboard, host: 'http://localhost:3020'})
.use(Dropbox, {target: Dashboard, host: 'http://localhost:3020'})
.use(Instagram, {target: Dashboard, host: 'http://localhost:3020'})
.use(Tus10, {endpoint: TUS_ENDPOINT, resume: true})
.use(Tus, {endpoint: TUS_ENDPOINT, resume: true})
.use(MetaData, {
fields: [
{ id: 'license', name: 'License', value: 'Creative Commons', placeholder: 'specify license' },

View file

@ -4,7 +4,7 @@
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://unpkg.com/uppy/dist/uppy.min.css" rel="stylesheet">
<link href="https://unpkg.com/uppy/dist/uppy.min.css" rel="stylesheet">
</head>
<body>
<button id="uppyModalOpener">Open Modal</button>
@ -12,7 +12,7 @@
<script>
const Dashboard = Uppy.Dashboard
const Webcam = Uppy.Webcam
const Tus10 = Uppy.Tus10
const Tus = Uppy.Tus
const Informer = Uppy.Informer
const uppy = Uppy.Core({debug: true, autoProceed: false})
@ -21,7 +21,7 @@
target: 'body'
})
.use(Webcam, {target: Dashboard})
.use(Tus10, {endpoint: 'https://master.tus.io/files/', resume: true})
.use(Tus, {endpoint: 'https://master.tus.io/files/', resume: true})
.use(Informer, {target: Dashboard})
uppy.run()
@ -33,4 +33,4 @@
document.querySelector('#uppyModalOpener').click()
</script>
</body>
</html>
</html>

View file

@ -1,7 +1,7 @@
/* eslint-disable */
const React = require('react')
const Uppy = require('uppy/lib/core')
const Tus10 = require('uppy/lib/plugins/Tus10')
const Tus = require('uppy/lib/plugins/Tus')
const GoogleDrive = require('uppy/lib/plugins/GoogleDrive')
const { Dashboard, DashboardModal, DragDrop, ProgressBar } = require('uppy/lib/react')
@ -19,12 +19,12 @@ module.exports = class App extends React.Component {
componentWillMount () {
this.uppy = new Uppy({ autoProceed: false })
.use(Tus10, { endpoint: 'https://master.tus.io/files/' })
.use(Tus, { endpoint: 'https://master.tus.io/files/' })
.use(GoogleDrive, { host: 'https://server.uppy.io' })
.run()
this.uppy2 = new Uppy({ autoProceed: false })
.use(Tus10, { endpoint: 'https://master.tus.io/files/' })
.use(Tus, { endpoint: 'https://master.tus.io/files/' })
.run()
}

View file

@ -24,7 +24,7 @@ const Informer = require('./plugins/Informer.js')
const MetaData = require('./plugins/MetaData.js')
// Uploaders
const Tus10 = require('./plugins/Tus10')
const Tus = require('./plugins/Tus')
const XHRUpload = require('./plugins/XHRUpload')
const Transloadit = require('./plugins/Transloadit')
const AwsS3 = require('./plugins/AwsS3')
@ -46,7 +46,7 @@ module.exports = {
Dropbox,
Instagram,
FileInput,
Tus10,
Tus,
XHRUpload,
Transloadit,
AwsS3,
@ -72,3 +72,18 @@ Object.defineProperty(module.exports, 'RestoreFiles', {
return GoldenRetriever
}
})
Object.defineProperty(module.exports, 'Tus10', {
enumerable: true,
configurable: true,
get: () => {
console.warn('Uppy.Tus10 is deprecated and will be removed in v0.22. Use Uppy.Tus instead.')
Object.defineProperty(module.exports, 'Tus10', {
enumerable: true,
configurable: true,
writable: true,
value: Tus
})
return Tus
}
})

View file

@ -49,7 +49,7 @@ function createEventTracker (emitter) {
* Tus resumable file uploader
*
*/
module.exports = class Tus10 extends Plugin {
module.exports = class Tus extends Plugin {
constructor (core, opts) {
super(core, opts)
this.type = 'uploader'

5
src/plugins/Tus10.js Normal file
View file

@ -0,0 +1,5 @@
const Tus = require('../Tus')
console.warn('Using `uppy/lib/plugins/Tus10` is deprecated and will be removed in v0.22. Please use `uppy/lib/plugins/Tus` instead.')
module.exports = Tus

View file

@ -12,7 +12,7 @@ Uppy file uploader consists of a lean [Core](https://github.com/transloadit/uppy
## Core
1. Core module orchestrates Uppy plugins, stores `state` with `files`, and exposes useful methods like `addFile`, `setState`, `upload` to the user and plugins. Plugins are added to Uppy with `.use(Plugin, opts)` API, like so: `.use(DragDrop, {target: 'body'})`.
1. Core module orchestrates Uppy plugins, stores `state` with `files`, and exposes useful methods like `addFile`, `setState`, `upload` to the user and plugins. Plugins are added to Uppy with `.use(Plugin, opts)` API, like so: `.use(DragDrop, {target: 'body'})`.
2. Internally Core then instantiates plugins via `new Plugin(this, opts)`, passing options to them, then places them in `plugins` object, nested by type: `uploader`, `progressindicator`, `acquirer`, etc. Core then iterates over `plugins` and calls `install` on each of them. In its `install` method a plugin can set event listeners to react to things happening in Uppy (upload progress, file was removed), or do anything else needed on init.
@ -141,7 +141,7 @@ a plugin can extend global state with its own state (like `{ modal: { isHidden:
### uploader
- **Tus10** — tus resumable file uploads, see http://tus.io
- **Tus** — tus resumable file uploads, see http://tus.io
- **Multipart** — regular form/multipart/xhr uploads
### modifier

View file

@ -13,13 +13,13 @@ Uppy consists of a core module and [various plugins](/docs/plugins/) for selecti
```js
const Uppy = require('uppy/lib/core')
const Dashboard = require('uppy/lib/plugins/Dashboard')
const Tus10 = require('uppy/lib/plugins/Tus10')
const Tus = require('uppy/lib/plugins/Tus')
 
const uppy = Uppy({ autoProceed: false })
.use(Dashboard, {
trigger: '#select-files'
})
.use(Tus10, {endpoint: '//master.tus.io/files/'})
.use(Tus, {endpoint: '//master.tus.io/files/'})
.run()
 
uppy.on('core:success', (files) => {
@ -62,7 +62,7 @@ If you like, you can also use a pre-built bundle, for example from [unpkg CDN](h
<script>
var uppy = Uppy.Core({ autoProceed: false })
uppy.use(Uppy.DragDrop, {target: '.UppyDragDrop'})
uppy.use(Uppy.Tus10, {endpoint: '//master.tus.io/files/'})
uppy.use(Uppy.Tus, {endpoint: '//master.tus.io/files/'})
uppy.run()
</script>
```

View file

@ -13,7 +13,7 @@ Plugins are what makes Uppy useful: they help select, manipulate and upload file
- FileInput — even more plain and simple, just a button
- [Provider Plugins](#Provider-Plugins) (remote sources that work through [Uppy Server](/docs/uppy-server/)): Instagram, GoogleDrive, Dropbox
- **Uploaders:**
- Tus10 — uploads using the tus resumable upload protocol
- Tus — uploads using the tus resumable upload protocol
- XHRUpload — classic multipart form uploads or binary uploads using XMLHTTPRequest
- [AwsS3](/docs/aws-s3) — uploader for AWS S3
- **Progress:**

View file

@ -16,7 +16,7 @@ All other props are passed as options to the plugin.
```js
const Uppy = require('uppy/lib/core')
const Tus10 = require('uppy/lib/plugins/Tus10')
const Tus = require('uppy/lib/plugins/Tus')
const DragDrop = require('uppy/lib/react/DragDrop')
const uppy = Uppy({
@ -25,7 +25,7 @@ const uppy = Uppy({
autoProceed: true
})
uppy.use(Tus10, { endpoint: '/upload' })
uppy.use(Tus, { endpoint: '/upload' })
uppy.on('core:success', (fileIDs) => {
const url = uppy.getFile(fileIDs[0]).uploadURL

View file

@ -7,12 +7,12 @@ permalink: docs/transloadit/
The Transloadit plugin can be used to upload files to [Transloadit](https://transloadit.com/) for all kinds of processing, such as transcoding video, resizing images, zipping/unzipping, [and more](https://transloadit.com/services/).
The Transloadit plugin uses the Tus plugin for the uploading itself.
The Transloadit plugin uses the [Tus plugin](/docs/tus) for the uploading itself.
To upload files to Transloadit directly, both the Tus and Transloadit plugins must be used:
```js
// The `resume: false` option _must_ be provided to the Tus plugin.
uppy.use(Tus10, {
uppy.use(Tus, {
resume: false
})
uppy.use(Transloadit, {
@ -20,7 +20,7 @@ uppy.use(Transloadit, {
})
```
NB: It is not required to use the `Tus10` plugin if [importFromUploadURLs](#importFromUploadURLs) is enabled.
NB: It is not required to use the `Tus` plugin if [importFromUploadURLs](#importFromUploadURLs) is enabled.
## Options

View file

@ -1,14 +1,14 @@
---
type: docs
order: 30
title: "Tus10"
title: "Tus"
permalink: docs/tus/
---
The Tus10 plugin brings [tus.io](http://tus.io) resumable file uploading to Uppy by wrapping the [tus-js-client][].
The Tus plugin brings [tus.io](http://tus.io) resumable file uploading to Uppy by wrapping the [tus-js-client][].
```js
uppy.use(Tus10, {
uppy.use(Tus, {
resume: true,
autoRetry: true,
retryDelays: [0, 1000, 3000, 5000]
@ -17,7 +17,7 @@ uppy.use(Tus10, {
## Options
The Tus10 plugin supports all of [tus-js-client][]'s options.
The Tus plugin supports all of [tus-js-client][]'s options.
Additionally:
### `autoRetry: true`

View file

@ -5,7 +5,7 @@
<script src="/uppy/uppy.min.js"></script>
<script>
var uppy = Uppy.Core({debug: true});
uppy.use(Uppy.Tus10, {endpoint: '//master.tus.io/files/'});
uppy.use(Uppy.Tus, {endpoint: '//master.tus.io/files/'});
uppy.use(Uppy.DragDrop, {target: '#uppy-dnd'});
uppy.use(Uppy.ProgressBar);
uppy.run();

View file

@ -4,7 +4,7 @@ const GoogleDrive = require('uppy/lib/plugins/GoogleDrive')
const Dropbox = require('uppy/lib/plugins/Dropbox')
const Instagram = require('uppy/lib/plugins/Instagram')
const Webcam = require('uppy/lib/plugins/Webcam')
const Tus10 = require('uppy/lib/plugins/Tus10')
const Tus = require('uppy/lib/plugins/Tus')
const MetaData = require('uppy/lib/plugins/MetaData')
const UPPY_SERVER = require('../env')
@ -56,7 +56,7 @@ function uppyInit () {
uppy.use(Webcam, {target: Dashboard})
}
uppy.use(Tus10, {endpoint: TUS_ENDPOINT, resume: true})
uppy.use(Tus, {endpoint: TUS_ENDPOINT, resume: true})
uppy.use(MetaData, {
fields: [
{ id: 'license', name: 'License', value: 'Creative Commons', placeholder: 'specify license' },

View file

@ -25,7 +25,7 @@ const GoogleDrive = require('uppy/lib/plugins/GoogleDrive')
const Dropbox = require('uppy/lib/plugins/Dropbox')
const Instagram = require('uppy/lib/plugins/Instagram')
const Webcam = require('uppy/lib/plugins/Webcam')
const Tus = require('uppy/lib/plugins/Tus10')
const Tus = require('uppy/lib/plugins/Tus')
const MetaData = require('uppy/lib/plugins/MetaData')
const uppy = Uppy({

View file

@ -1,19 +1,19 @@
const Uppy = require('uppy/lib/core/Core')
const DragDrop = require('uppy/lib/plugins/DragDrop')
const ProgressBar = require('uppy/lib/plugins/ProgressBar')
const Tus10 = require('uppy/lib/plugins/Tus10')
const Tus = require('uppy/lib/plugins/Tus')
const uppyOne = new Uppy({debug: true})
uppyOne
.use(DragDrop, {target: '.UppyDragDrop-One'})
.use(Tus10, {endpoint: '//master.tus.io/files/'})
.use(Tus, {endpoint: '//master.tus.io/files/'})
.use(ProgressBar, {target: '.UppyDragDrop-One-Progress'})
.run()
const uppyTwo = new Uppy({debug: true, autoProceed: false})
uppyTwo
.use(DragDrop, {target: '#UppyDragDrop-Two'})
.use(Tus10, {endpoint: '//master.tus.io/files/'})
.use(Tus, {endpoint: '//master.tus.io/files/'})
.use(ProgressBar, {target: '.UppyDragDrop-Two-Progress'})
.run()

View file

@ -1,10 +1,10 @@
const Uppy = require('uppy/lib/core/Core')
const Tus10 = require('uppy/lib/plugins/GoogleDrive')
const Tus = require('uppy/lib/plugins/GoogleDrive')
const uppy = new Uppy({debug: true, autoProceed: false})
uppy
.use(Tus10, {endpoint: '//master.tus.io/files/'})
.use(Tus, {endpoint: '//master.tus.io/files/'})
.run()
console.log('--> Uppy Bundled version with Tus10 & Russian language pack has loaded')
console.log('--> Uppy Bundled version with Tus & Russian language pack has loaded')

View file

@ -17,8 +17,8 @@
}
});
uppy.use(Uppy.ProgressBar, {target: 'body', fixed: true})
uppy.use(Uppy.Tus10, {endpoint: '//master.tus.io/files/'});
uppy.use(Uppy.Tus, {endpoint: '//master.tus.io/files/'});
uppy.run();
console.log('--> Uppy pre-built version with Tus10, DragDrop & Russian language pack has loaded');
console.log('--> Uppy pre-built version with Tus, DragDrop & Russian language pack has loaded');
</script>

View file

@ -1,11 +1,11 @@
const Uppy = require('uppy/lib/core/Core')
const FileInput = require('uppy/lib/plugins/FileInput')
const StatusBar = require('uppy/lib/plugins/StatusBar')
const Tus10 = require('uppy/lib/plugins/Tus10')
const Tus = require('uppy/lib/plugins/Tus')
const uppyOne = new Uppy({debug: true})
uppyOne
.use(FileInput, {target: '.UppyInput'})
.use(Tus10, {endpoint: '//master.tus.io/files/'})
.use(Tus, {endpoint: '//master.tus.io/files/'})
.use(StatusBar, {target: '.UppyInput-Progress'})
.run()