A presentation of a few JavaScript libraries that help you do in the browser what you traditionally do on the server.
Offloading server work tothe client sideDimiter Petrov@crackofdusk21 November 2013
View Slide
Background
Scoffing at JavaScript is easy
Scoffing at JavaScript is easy(Search for “wtfjs”)
Scoffing at JavaScriptin the browser was easy
Scoffing at JavaScriptin the browser was easy(Remember DHTML?)
Not anymore
In a browser near you• Typed arrays• Web workers• File API• Canvas• WebGL• Web Audio API(and many more)
pdf.js
pdf.jsPDF reader in JavaScript
pdf.jsPDF reader in JavaScriptThe default PDF reader in Firefox
Aurora.jsJavaScript audio decoding framework
Aurora.jsJavaScript audio decoding frameworkCodecs for MP3, AAC, FLAC, ALAC
Aurora.jsJavaScript audio decoding frameworkCodecs for MP3, AAC, FLAC, ALACIn your browser, without any plugins
3D games!(Also in your browser, without any plugins)
http://www.unrealengine.com/html5/
https://www.youtube.com/watch?v=BV32Cs_CMqo
“Yeah, okay. Show me something useful.”
Shifting responsibilities
PDF rendering
jsPDFA client-side PDF generator
jsPDFGood browser support(Firefox 3+, Chrome, Safari 3+, Opera, IE6+*)
jsPDF drawbackYou need to make sur you can run thesame code on the server as a fallback
http://www.flickr.com/photos/mrcam/206628965/
zip.jsA JavaScript library to zip and unzip files
zip.jsFully compatible with Chrome, Firefox,Safari 6, Internet Explorer 10Workaround for Safari 5 and IE9(Typed Array polyfill and disbled Web Workers)
File uploads
http://en.wikipedia.org/wiki/File:Occupy_Oakland_99_Percent_signs.jpg
Failed uploads of large files are no fun
What if you didn’t need to re-upload theentire file?
Resumable.jsSimultaneous, stable, resumable uploads
Resumable.jsResists to network failureResumes automatically when theconnection is up againAllows pausing uploads
Resumable.jsRequires:• the HTML 5 File API to split files intosmall pieces• server-side setup to put the file backtogether
Thank you!
pdf.jshttps://github.com/mozilla/pdf.jsAurora.jshttps://github.com/audiocogs/aurora.js/Unreal engine demohttp://www.unrealengine.com/html5/jsPDFhttp://parall.ax/products/jspdfzip.jshttp://gildas-lormeau.github.io/zip.js/resumable.jshttp://resumablejs.com/