SlideShare a Scribd company logo
1 of 22
Download to read offline
Should you use HTML5 to
build your product?
The pros & cons of using current HTML5 features for
your Startup
Why we care
¡  We built a rather complex unified messaging client (email, chat,
video, SMS, FB chat, calendar integration, etc) called boxUno with
HTML5 that gives offline access to mail just like a native application.
¡  Without some features of HTML5, our application would have not
have possible
¡  BUT, HTML5 also set us back in a lot of ways:
¡  Limited compatibility on browsers
¡  Hard to debug
¡  Crashes browsers
*Thanks to html5rocks.com for various code samples
What we will cover
¡  WebWorkers: true multithreading / concurrency in Javascript
¡  IndexedDb: a database in the browser
¡  Application Cache: cache site for offline viewing
¡  WebRTC: new video standard in browser
¡  CSS3: great new CSS properties
¡  Other: Canvas, Seamless iFrame, Content Editable Divs, Files /
Blobs
Webworkers: The Basics
¡  Allows you to truly implement multithreading / concurrency in
Javascript
¡  Otherwise, Javascript is single threaded and functions like
setTimeout() give the impression of asynchronicity, but not
concurrency (Must still wait for currently execution function to
yield)
¡  WebWorkers have their own context and are loaded from their
own JS files
¡  They have access to some Javascript features but not others
¡  Useful for applications with a lot going on in the UI but also
requiring powerful data processing / caching client-side
WebWorkers: Message
Passing
¡  Because Worker doesn’t share parent page’s Context, need a way
to pass messages between the two
¡  Use the postMessage() function in String or JSON format
¡  Passed objects are literally copied between the two contexts
¡  Can use Transferable Objects: zero-copy so improved performance,
but object is copied from parent to worker and then deleted from
the parent context
WebWorkers: Accessible
Javascript Features
•  Workers can access:
•  The location object (read-only)
•  XMLHttpRequest
•  setTimeout()/clearTimeout() and setInterval()/clearInterval()
•  The Application Cache
•  Importing external scripts using the importScripts() method
•  Spawning other web workers
•  Workers do NOT have access to:
•  The DOM (it's not thread-safe)
•  The window object
•  The document object
•  The parent object
WebWorkers: How We Used
Them in boxUno
IMAP Server
Client UI
IO Worker
New Mail & Mail
Updates (labels, read,
etc)
Client actions: mark
read, change labels,
Move Folders, etc
Process New Mail &
Updates and add to
data structures
Send mail &
updates to
client
Package
updates for send
to IMAP Server
Updates from
client
•  Having multiple workers is difficult
•  Use a lot of memory b/c you can't share datastructures
•  Can't share code (a massive js file for every worker)
•  You have to do IPC to get anything done between workers
•  Only chrome fully implements communication mechanism
MessageChannels (now in Firefox Nightly but buggy)
•  In every other language, you only have to deal with threads - not
processes
•  i.e. Can have shared data structures with locking
•  Often workers fail silently
•  Slow to start
WebWorkers: Drawbacks
•  Debugging is hard:
•  Especially if you have more than one worker (often even launching
the debugger in Chrome, doesn't work)
•  Firefox has no debugger for them
•  No access to the Dom parser
•  For boxUno, need to analyze / parse HTML emails in the worker
•  Generally need some asynchronous JS functionality
•  We used Google Closure Deferreds
•  Debugging issues exacerbated by the fact Deferreds have default
errBacks, so if you miss recording an errBack, errors not reported
•  Local storage also not available
•  makes sense why: local storage associated with the page context
not the worker context)
WebWorkers: Drawbacks
Part II
Indexeddb: The Basics
¡  An database (Object Store) hosted inside the
browser
¡  Can give rise to a whole new class of web
applications that offer both offline and online
availability
¡  NOT a relational store (has no tables or columns)
¡  You save Javascript objects to the Object Store,
then create indexes and iterate over them with
cursors
¡  Transactional database
¡  Basically all commands are asynchronous
Indexeddb: How to Use
¡  Step 1: Open the database ¡  Step 2: Create Object Store
Indexeddb: How to Use
Part II
¡  Step 3: Add data ¡  Step 4: Query data
•  API is pretty ghetto
•  100 lines of code to do anything
•  All asynchronous
•  Still not implemented in Safari even though Safari is webkit based so
you can't do anything on iPhone (Might never get implemented b/
c google forked webkit)
•  API still in flux
•  During the writing boxUno, changed how you upgrade a database
[onversionchangedevent versus setVersion()]
•  Chrome 23 (recent) update added potential for multiple
transactions in flight, so broke all our code (onsuccess event no
longer guaranteed transaction was done)
•  Quite buggy still (we filed 5 security bugs that crashed Chrome)
Indexeddb: Drawbacks
•  Performance
•  Slow to start and speed can be slow on reads if have large objects
in a single row
•  Iterating through an index of email threads took forever
•  Performance issues might have been our fault, but hard to debug
•  Chrome team claims their implementation should be massively
scalable
Indexeddb: Drawbacks
Part II
Application Cache
(AppCache): The Basics
¡  Allows you to control the caching of your
application: both static and dynamic resources
¡  User can browse your full site when offline (even
when hitting refresh)
¡  Specify a manifest file, so resources are only re-
fetched when the manifest file changes
¡  Increases load speed, because resources are
local (makes load time A LOT faster)
¡  Decreases server load because resources are not
fetched from the server with each page load
AppCache: Drawbacks
•  Hard to develop with
•  So we just use it in production for boxUno
•  Caching of actual manifest file
•  When you increment the manifest file, browser should issue change
event and redownload files
•  But the browser itself could be caching the manifest
•  One load error kills the entire update process
•  We have many items in the manifest (140 or so).
•  When AppCache can’t retrieve one item, whole upgrade process
is stopped
WebRTC: The Basics
¡  New video standard that creates Peer to Peer connection for
video feed in browser
¡  No plugins required
¡  Minimal server load: server just negotiates with message passing
between the two computers to find a mutually reachable public
server.
¡  Higher quality video / audio than other standards
¡  Relatively easy to implement
¡  See demo from WebRTC people: http://apprtc.appspot.com
WebRTC: The Drawbacks
¡  Very new so only supported well in Firefox 23 onwards and
Chrome 27-ish onwards.
¡  No Internet Explorer without a plugin.
¡  Had some sound echo problems with low volume sounds
¡  For certain enterprise NAT configurations to connect properly,
need to host your own TURN (or relay) server
CSS3: The Basics
¡  CSS3 is awesome!
¡  Allows you to do gradients, shadows, border rounding, timed
transitions from one UI to state to another
¡  Largely supported now by major browsers
¡  Check
http://www.w3schools.com/cssref/css3_browsersupport.asp for
browser support table by property
Other HTML5 Features
¡  Canvas: can draw directly on the page
¡  Seamless iFrame:
¡  Makes it so that parent formatting *can* apply to the iframe
¡  We used it in boxUno b/c wanted parent frame styles NOT to apply
¡  Content Editable DIVs
¡  Makes it MUCH easier to create text editing on a webpage without
plugins / libraries
¡  Just specify contenteditable attribute on the DIV
¡  Files and Blobs
¡  HTML5 File objects make it easy to accept user uploads
¡  Blobs make it easy to reference files by a local URL. We used it to
allow users to download their attachments
Conclusions: Should you use
HTML5?
¡  HTML5 has some great features but also creates some
headaches
¡  If you are looking for universal compatibility, don’t use HTML5
features.
¡  We’d recommend not using multiple WebWorkers. (Stick all
background processes in one worker if possible).
¡  Be careful in relying on indexeddb API because it has changed
so much recently, but it’s the best (and only) way to give your
user access to your web app while offline.
Thanks!
¡  Thanks for reading!
¡  Feel free to contact me Ross Williamson (co-Founder of boxUno)
at ross@boxuno.com
¡  We are happy to help talk through any HTML5 related questions
or issues (to help save people some of the time we wasted!)

More Related Content

What's hot

Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularMark Leusink
 
ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1Kumar S
 
Server and client rendering of single page apps
Server and client rendering of single page appsServer and client rendering of single page apps
Server and client rendering of single page appsThomas Heymann
 
Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4Yuriy Shapovalov
 
A 20 minute introduction to AngularJS for XPage developers
A 20 minute introduction to AngularJS for XPage developersA 20 minute introduction to AngularJS for XPage developers
A 20 minute introduction to AngularJS for XPage developersMark Leusink
 
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...Chris O'Brien
 
Chris OBrien - Weaving Enterprise Solutions into Office Products
Chris OBrien - Weaving Enterprise Solutions into Office ProductsChris OBrien - Weaving Enterprise Solutions into Office Products
Chris OBrien - Weaving Enterprise Solutions into Office ProductsChris O'Brien
 
The fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose ReactThe fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose ReactOliver N
 
Angular.js in XPages
Angular.js in XPagesAngular.js in XPages
Angular.js in XPagesMark Roden
 
ASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVCASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVCBilal Amjad
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersRob Windsor
 
COB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersCOB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersChris O'Brien
 
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 appsChris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 appsChris O'Brien
 
Contentful with Netgen Layouts workshop
Contentful with Netgen Layouts workshopContentful with Netgen Layouts workshop
Contentful with Netgen Layouts workshopIvo Lukac
 
ASP.NET MVC Performance
ASP.NET MVC PerformanceASP.NET MVC Performance
ASP.NET MVC Performancerudib
 
WebApp / SPA @ AllFacebook Developer Conference
WebApp / SPA @ AllFacebook Developer ConferenceWebApp / SPA @ AllFacebook Developer Conference
WebApp / SPA @ AllFacebook Developer ConferenceAllFacebook.de
 

What's hot (20)

Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
 
ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1
 
Tutorial asp.net
Tutorial  asp.netTutorial  asp.net
Tutorial asp.net
 
Server and client rendering of single page apps
Server and client rendering of single page appsServer and client rendering of single page apps
Server and client rendering of single page apps
 
Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4
 
A 20 minute introduction to AngularJS for XPage developers
A 20 minute introduction to AngularJS for XPage developersA 20 minute introduction to AngularJS for XPage developers
A 20 minute introduction to AngularJS for XPage developers
 
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
 
ASP.NET Web form
ASP.NET Web formASP.NET Web form
ASP.NET Web form
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
Chris OBrien - Weaving Enterprise Solutions into Office Products
Chris OBrien - Weaving Enterprise Solutions into Office ProductsChris OBrien - Weaving Enterprise Solutions into Office Products
Chris OBrien - Weaving Enterprise Solutions into Office Products
 
The fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose ReactThe fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose React
 
Angular.js in XPages
Angular.js in XPagesAngular.js in XPages
Angular.js in XPages
 
Rutgers - Active Server Pages
Rutgers - Active Server PagesRutgers - Active Server Pages
Rutgers - Active Server Pages
 
ASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVCASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVC
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint Developers
 
COB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersCOB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developers
 
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 appsChris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
 
Contentful with Netgen Layouts workshop
Contentful with Netgen Layouts workshopContentful with Netgen Layouts workshop
Contentful with Netgen Layouts workshop
 
ASP.NET MVC Performance
ASP.NET MVC PerformanceASP.NET MVC Performance
ASP.NET MVC Performance
 
WebApp / SPA @ AllFacebook Developer Conference
WebApp / SPA @ AllFacebook Developer ConferenceWebApp / SPA @ AllFacebook Developer Conference
WebApp / SPA @ AllFacebook Developer Conference
 

Similar to Should you use HTML5 to build your product? The pros & cons of using current HTML5 features for your startup

Week 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuWeek 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuAppUniverz Org
 
Drupal is not your Website
Drupal is not your Website Drupal is not your Website
Drupal is not your Website Phase2
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQLKonstantin Gredeskoul
 
Top 10 HTML5 Features for Oracle Cloud Developers
Top 10 HTML5 Features for Oracle Cloud DevelopersTop 10 HTML5 Features for Oracle Cloud Developers
Top 10 HTML5 Features for Oracle Cloud DevelopersBrian Huff
 
Build Web Applications
Build Web ApplicationsBuild Web Applications
Build Web ApplicationsTom Crombez
 
Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Commit University
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkitPaul Jensen
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Jeremy Likness
 
Progressive Web Apps and React
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and ReactMike Melusky
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Bluegrass Digital
 
JS digest. Decemebr 2017
JS digest. Decemebr 2017JS digest. Decemebr 2017
JS digest. Decemebr 2017ElifTech
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialThomas Daly
 
Mobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPressMobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPressDanilo Ercoli
 
GeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGGDBologna
 

Similar to Should you use HTML5 to build your product? The pros & cons of using current HTML5 features for your startup (20)

Week 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuWeek 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. Wu
 
Drupal is not your Website
Drupal is not your Website Drupal is not your Website
Drupal is not your Website
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL
 
Top 10 HTML5 Features for Oracle Cloud Developers
Top 10 HTML5 Features for Oracle Cloud DevelopersTop 10 HTML5 Features for Oracle Cloud Developers
Top 10 HTML5 Features for Oracle Cloud Developers
 
Build Web Applications
Build Web ApplicationsBuild Web Applications
Build Web Applications
 
Prueba ppt
Prueba pptPrueba ppt
Prueba ppt
 
Html5v1
Html5v1Html5v1
Html5v1
 
Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkit
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!
 
Html5
Html5Html5
Html5
 
Progressive Web Apps and React
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and React
 
Lightning Web Component - LWC
Lightning Web Component - LWCLightning Web Component - LWC
Lightning Web Component - LWC
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
 
Fluxible
FluxibleFluxible
Fluxible
 
React.js at Cortex
React.js at CortexReact.js at Cortex
React.js at Cortex
 
JS digest. Decemebr 2017
JS digest. Decemebr 2017JS digest. Decemebr 2017
JS digest. Decemebr 2017
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - Material
 
Mobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPressMobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPress
 
GeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPress
 

Recently uploaded

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

Should you use HTML5 to build your product? The pros & cons of using current HTML5 features for your startup

  • 1. Should you use HTML5 to build your product? The pros & cons of using current HTML5 features for your Startup
  • 2. Why we care ¡  We built a rather complex unified messaging client (email, chat, video, SMS, FB chat, calendar integration, etc) called boxUno with HTML5 that gives offline access to mail just like a native application. ¡  Without some features of HTML5, our application would have not have possible ¡  BUT, HTML5 also set us back in a lot of ways: ¡  Limited compatibility on browsers ¡  Hard to debug ¡  Crashes browsers *Thanks to html5rocks.com for various code samples
  • 3. What we will cover ¡  WebWorkers: true multithreading / concurrency in Javascript ¡  IndexedDb: a database in the browser ¡  Application Cache: cache site for offline viewing ¡  WebRTC: new video standard in browser ¡  CSS3: great new CSS properties ¡  Other: Canvas, Seamless iFrame, Content Editable Divs, Files / Blobs
  • 4. Webworkers: The Basics ¡  Allows you to truly implement multithreading / concurrency in Javascript ¡  Otherwise, Javascript is single threaded and functions like setTimeout() give the impression of asynchronicity, but not concurrency (Must still wait for currently execution function to yield) ¡  WebWorkers have their own context and are loaded from their own JS files ¡  They have access to some Javascript features but not others ¡  Useful for applications with a lot going on in the UI but also requiring powerful data processing / caching client-side
  • 5. WebWorkers: Message Passing ¡  Because Worker doesn’t share parent page’s Context, need a way to pass messages between the two ¡  Use the postMessage() function in String or JSON format ¡  Passed objects are literally copied between the two contexts ¡  Can use Transferable Objects: zero-copy so improved performance, but object is copied from parent to worker and then deleted from the parent context
  • 6. WebWorkers: Accessible Javascript Features •  Workers can access: •  The location object (read-only) •  XMLHttpRequest •  setTimeout()/clearTimeout() and setInterval()/clearInterval() •  The Application Cache •  Importing external scripts using the importScripts() method •  Spawning other web workers •  Workers do NOT have access to: •  The DOM (it's not thread-safe) •  The window object •  The document object •  The parent object
  • 7. WebWorkers: How We Used Them in boxUno IMAP Server Client UI IO Worker New Mail & Mail Updates (labels, read, etc) Client actions: mark read, change labels, Move Folders, etc Process New Mail & Updates and add to data structures Send mail & updates to client Package updates for send to IMAP Server Updates from client
  • 8. •  Having multiple workers is difficult •  Use a lot of memory b/c you can't share datastructures •  Can't share code (a massive js file for every worker) •  You have to do IPC to get anything done between workers •  Only chrome fully implements communication mechanism MessageChannels (now in Firefox Nightly but buggy) •  In every other language, you only have to deal with threads - not processes •  i.e. Can have shared data structures with locking •  Often workers fail silently •  Slow to start WebWorkers: Drawbacks
  • 9. •  Debugging is hard: •  Especially if you have more than one worker (often even launching the debugger in Chrome, doesn't work) •  Firefox has no debugger for them •  No access to the Dom parser •  For boxUno, need to analyze / parse HTML emails in the worker •  Generally need some asynchronous JS functionality •  We used Google Closure Deferreds •  Debugging issues exacerbated by the fact Deferreds have default errBacks, so if you miss recording an errBack, errors not reported •  Local storage also not available •  makes sense why: local storage associated with the page context not the worker context) WebWorkers: Drawbacks Part II
  • 10. Indexeddb: The Basics ¡  An database (Object Store) hosted inside the browser ¡  Can give rise to a whole new class of web applications that offer both offline and online availability ¡  NOT a relational store (has no tables or columns) ¡  You save Javascript objects to the Object Store, then create indexes and iterate over them with cursors ¡  Transactional database ¡  Basically all commands are asynchronous
  • 11. Indexeddb: How to Use ¡  Step 1: Open the database ¡  Step 2: Create Object Store
  • 12. Indexeddb: How to Use Part II ¡  Step 3: Add data ¡  Step 4: Query data
  • 13. •  API is pretty ghetto •  100 lines of code to do anything •  All asynchronous •  Still not implemented in Safari even though Safari is webkit based so you can't do anything on iPhone (Might never get implemented b/ c google forked webkit) •  API still in flux •  During the writing boxUno, changed how you upgrade a database [onversionchangedevent versus setVersion()] •  Chrome 23 (recent) update added potential for multiple transactions in flight, so broke all our code (onsuccess event no longer guaranteed transaction was done) •  Quite buggy still (we filed 5 security bugs that crashed Chrome) Indexeddb: Drawbacks
  • 14. •  Performance •  Slow to start and speed can be slow on reads if have large objects in a single row •  Iterating through an index of email threads took forever •  Performance issues might have been our fault, but hard to debug •  Chrome team claims their implementation should be massively scalable Indexeddb: Drawbacks Part II
  • 15. Application Cache (AppCache): The Basics ¡  Allows you to control the caching of your application: both static and dynamic resources ¡  User can browse your full site when offline (even when hitting refresh) ¡  Specify a manifest file, so resources are only re- fetched when the manifest file changes ¡  Increases load speed, because resources are local (makes load time A LOT faster) ¡  Decreases server load because resources are not fetched from the server with each page load
  • 16. AppCache: Drawbacks •  Hard to develop with •  So we just use it in production for boxUno •  Caching of actual manifest file •  When you increment the manifest file, browser should issue change event and redownload files •  But the browser itself could be caching the manifest •  One load error kills the entire update process •  We have many items in the manifest (140 or so). •  When AppCache can’t retrieve one item, whole upgrade process is stopped
  • 17. WebRTC: The Basics ¡  New video standard that creates Peer to Peer connection for video feed in browser ¡  No plugins required ¡  Minimal server load: server just negotiates with message passing between the two computers to find a mutually reachable public server. ¡  Higher quality video / audio than other standards ¡  Relatively easy to implement ¡  See demo from WebRTC people: http://apprtc.appspot.com
  • 18. WebRTC: The Drawbacks ¡  Very new so only supported well in Firefox 23 onwards and Chrome 27-ish onwards. ¡  No Internet Explorer without a plugin. ¡  Had some sound echo problems with low volume sounds ¡  For certain enterprise NAT configurations to connect properly, need to host your own TURN (or relay) server
  • 19. CSS3: The Basics ¡  CSS3 is awesome! ¡  Allows you to do gradients, shadows, border rounding, timed transitions from one UI to state to another ¡  Largely supported now by major browsers ¡  Check http://www.w3schools.com/cssref/css3_browsersupport.asp for browser support table by property
  • 20. Other HTML5 Features ¡  Canvas: can draw directly on the page ¡  Seamless iFrame: ¡  Makes it so that parent formatting *can* apply to the iframe ¡  We used it in boxUno b/c wanted parent frame styles NOT to apply ¡  Content Editable DIVs ¡  Makes it MUCH easier to create text editing on a webpage without plugins / libraries ¡  Just specify contenteditable attribute on the DIV ¡  Files and Blobs ¡  HTML5 File objects make it easy to accept user uploads ¡  Blobs make it easy to reference files by a local URL. We used it to allow users to download their attachments
  • 21. Conclusions: Should you use HTML5? ¡  HTML5 has some great features but also creates some headaches ¡  If you are looking for universal compatibility, don’t use HTML5 features. ¡  We’d recommend not using multiple WebWorkers. (Stick all background processes in one worker if possible). ¡  Be careful in relying on indexeddb API because it has changed so much recently, but it’s the best (and only) way to give your user access to your web app while offline.
  • 22. Thanks! ¡  Thanks for reading! ¡  Feel free to contact me Ross Williamson (co-Founder of boxUno) at ross@boxuno.com ¡  We are happy to help talk through any HTML5 related questions or issues (to help save people some of the time we wasted!)