React Native, Cordova and Browser Streams using tus-js-client 1.6
A bit less than two months ago, we released version 1.6.0 of tus-js-client, our open source tus implementation for JavaScript environments. Usually, we don’t write a blog post about a specific release, but this one is very special to us for two reasons:
- Version 1.6.0 contains three very exiting new features, and
- All of the three features were contributed by members of our community.
To raise awareness about those new additions, as well as to thank the contributors for their help, I decided to write a short blog post about them. So, without further ado, let’s jump straight in:
- Paul Rosenzweig added support for uploading streaming data inside your browser to a tus server. In the beginning, tus-js-client was only capable of uploading complete files with a pre-known size. However, in some cases you want to upload your data simultaneously while it is arriving from some other services. For example, it’s nice to pipe a live-recorded video to your server in real-time. Some time ago, we added support for streaming uploads to tus-js-client inside Node.js, but Paul extended this support to cover browser environments using the new JavaScript Streams API. For more details, you might want to look at the documentation or its pull request.
- Next up is Artur Paikin who contributed a simpler integration with React Native. It was already possible to use tus-js-client with React Native, but it required some boilerplate code. Basically, you had to resolve React Native’s file URIs before you were able to upload the corresponding files. For his work on Uppy (an open source, modular and modern file uploader from the folks at Transloadit) he integrated this boilerplate into tus-js-client, so you can now pass the file URIs directly to tus-js-client without worrying about the details. You can find more details in the documentation or in its pull request.
- Last but not least, Hannu Niemelä picked up some earlier work from Martijn Swart and blew off some dust. Thanks to their help, you can now use tus-js-client inside your Apache Cordova application. That’s the fourth platform tus-js-client supports, next to browsers, Node.js and React Native! If you’re not aware, Cordova allows you to create mobile, cross-platform apps using HTML, CSS and JavaScript. Even though it’s similar to a browser environment, Cordova’s runtime has a few differences that tus-js-client can now easily handle. More details can be found in the documentation or in its pull request.
Finally, I want to thank everyone again who helped to make this release happen! If you also want to contribute, you can find our open source code at GitHub. If you don’t know where to start or have other questions, feel free to contact us!