SlideShare uma empresa Scribd logo
1 de 22
Baixar para ler 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!)

Mais conteúdo relacionado

Mais procurados

Mais procurados (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
 

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

Drupal is not your Website
Drupal is not your Website Drupal is not your Website
Drupal is not your Website
Phase2
 
GeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPress
GGDBologna
 

Semelhante a 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
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

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!)