58
HTML5 API: Hero, Villain your usage in real applications Wilson Mendes @willmendesneto

HTML5 API's: Hero, Villain and your usage in real applications

Embed Size (px)

DESCRIPTION

The new HTML5 API's opened up new possibilities as webapps, mobile apps, and other embedded apps. But how to handle support (or lack thereof) API's in different browsers? In this presentation I will talk about lessons learned, best practices for using HTML5 with Progressive Enhancement and falbacks Gracefull degradation using HTML5 API's to improve the UX of your app and how to deal with the lack of support among different browsers, minificando impacts. All this based on a real example.

Citation preview

Page 1: HTML5 API's: Hero, Villain and your usage in real applications

HTML5 API: Hero, Villain your usage

in real applications

Wilson Mendes@willmendesneto

Page 2: HTML5 API's: Hero, Villain and your usage in real applications

Wilson Mendes@willmendesneto

#communities#stopWithHashtags

WHEN

IAM#opensource

#developer

Page 3: HTML5 API's: Hero, Villain and your usage in real applications

Beyond

VA

LIDA

TIONFORMS

OF

Page 4: HTML5 API's: Hero, Villain and your usage in real applications

Because everyone someday...

Suffered with asyncronousrequests...

Page 5: HTML5 API's: Hero, Villain and your usage in real applications

Promises / Proactor

Page 6: HTML5 API's: Hero, Villain and your usage in real applications

JavaScriptAsync

Page 7: HTML5 API's: Hero, Villain and your usage in real applications

NaN

Because everything canhappen.

Including nothing

Page 8: HTML5 API's: Hero, Villain and your usage in real applications
Page 9: HTML5 API's: Hero, Villain and your usage in real applications

Array(16).join(‘wat’ - 1) + ‘ Batman!’;

If you know everything...What the result?

https://www.destroyallsoftware.com/talks/wat

Page 10: HTML5 API's: Hero, Villain and your usage in real applications

Because everyone someday...

Was impressed with aHTML5 API...

Page 11: HTML5 API's: Hero, Villain and your usage in real applications

Web Storage

OfflineMedia

Web Speech

Web WorkersConnection

Fullscreen

Vibration

File

Page 12: HTML5 API's: Hero, Villain and your usage in real applications

But when was use it... ... was faced with PROBLEMS ...

Page 13: HTML5 API's: Hero, Villain and your usage in real applications
Page 14: HTML5 API's: Hero, Villain and your usage in real applications

http://loopinfinito.com.br/2012/09/05/entendendo-as-diferentes-distribuicoes-dos-browsers/

Stable channel

Beta channelDev channelCanary build

ReleaseBeta

AuroraNightly

EstávelNext

Browsers distribution

Page 15: HTML5 API's: Hero, Villain and your usage in real applications

And Internet Explorer?

Page 16: HTML5 API's: Hero, Villain and your usage in real applications

Well...

Page 17: HTML5 API's: Hero, Villain and your usage in real applications

Current scenario

Pre-processors

CLI

Frameworks

Libs

EnterpriseDesktop Apps

Page 18: HTML5 API's: Hero, Villain and your usage in real applications

Javascript can do it?

Page 19: HTML5 API's: Hero, Villain and your usage in real applications

...but it’s not so easy...

Page 20: HTML5 API's: Hero, Villain and your usage in real applications

New API’sNew problemsCool API, but it works only in …

Page 21: HTML5 API's: Hero, Villain and your usage in real applications

http://remysharp.com/2010/10/08/what-is-a-polyfill/

Polifylls? SHIM?

Page 23: HTML5 API's: Hero, Villain and your usage in real applications

...but it’s not so easy…[2]

Page 24: HTML5 API's: Hero, Villain and your usage in real applications

Testing support

Page 25: HTML5 API's: Hero, Villain and your usage in real applications

Feature Detection

Page 26: HTML5 API's: Hero, Villain and your usage in real applications

@supports

Page 27: HTML5 API's: Hero, Villain and your usage in real applications

CSS Support Javascript

Page 28: HTML5 API's: Hero, Villain and your usage in real applications

BUT WE HAVE HELP

Page 29: HTML5 API's: Hero, Villain and your usage in real applications
Page 30: HTML5 API's: Hero, Villain and your usage in real applications

HTML5 please

Page 31: HTML5 API's: Hero, Villain and your usage in real applications
Page 32: HTML5 API's: Hero, Villain and your usage in real applications

Frontend-search

Page 33: HTML5 API's: Hero, Villain and your usage in real applications

So, let’s talk about HTML5 API’s?

Page 34: HTML5 API's: Hero, Villain and your usage in real applications

Vibration

http://embed.plnkr.co/UKYISp/

Page 35: HTML5 API's: Hero, Villain and your usage in real applications

Web Notification

Page 36: HTML5 API's: Hero, Villain and your usage in real applications

Offline

Page 37: HTML5 API's: Hero, Villain and your usage in real applications

!==

Offline First!

Offline API

Page 38: HTML5 API's: Hero, Villain and your usage in real applications

Fullscreen

Page 39: HTML5 API's: Hero, Villain and your usage in real applications

Web Storage

http://embed.plnkr.co/iznugnFL8fM3ALhKtBtQ/preview

Page 40: HTML5 API's: Hero, Villain and your usage in real applications

UsabilityAcessibilityHTML5 API’s

Page 41: HTML5 API's: Hero, Villain and your usage in real applications

UsabilityAcessibilityHTML5 API’s

Page 42: HTML5 API's: Hero, Villain and your usage in real applications

Web Speech

Page 43: HTML5 API's: Hero, Villain and your usage in real applications

Web Speech

http://embed.plnkr.co/D6BVEE/preview

Page 44: HTML5 API's: Hero, Villain and your usage in real applications
Page 45: HTML5 API's: Hero, Villain and your usage in real applications

Sensor

http://embed.plnkr.co/zKqSLBuI11HoYQLGk1zZ/preview

Page 46: HTML5 API's: Hero, Villain and your usage in real applications

How to integrate these 2 API’s?

WITHOUT INTEGRATION! (for now)

Bad news...

Page 48: HTML5 API's: Hero, Villain and your usage in real applications

Architecture

Page 49: HTML5 API's: Hero, Villain and your usage in real applications

Same app id distinct browsers?

Page 50: HTML5 API's: Hero, Villain and your usage in real applications

FullscreenMedia

Web StorageVibration

Web Notifications

API’s useds

Speech recognition Battery

Page 51: HTML5 API's: Hero, Villain and your usage in real applications

KEEP CALM

IT’S

SHOOOW

TIME

Page 52: HTML5 API's: Hero, Villain and your usage in real applications

Social Share

https://github.com/willmendesneto/social-share

Page 53: HTML5 API's: Hero, Villain and your usage in real applications

LESSONS

LEARNED

Page 54: HTML5 API's: Hero, Villain and your usage in real applications

NEW RESPONSABILITIESNEW POSSIBILITIES

Page 55: HTML5 API's: Hero, Villain and your usage in real applications

BONUS

TIME

Page 56: HTML5 API's: Hero, Villain and your usage in real applications

Text Encoding

http://embed.plnkr.co/4INpdt/preview

Page 57: HTML5 API's: Hero, Villain and your usage in real applications

Web Alarms

Page 58: HTML5 API's: Hero, Villain and your usage in real applications

THANKS

Wilson Mendes@willmendesneto

HTML5 API: Hero, villain and your usage in real applications