SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
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!)

Contenu connexe

Tendances

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
 

Tendances (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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 productivityPrincipled Technologies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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.pdfsudhanshuwaghmare1
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
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?Antenna Manufacturer Coco
 
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 WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Dernier (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
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?
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

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