The Untold Stories of HTML5 Adventure: APIs
Soumya @Deblopper Deb
MozCamp Asia 2011
The adventure begins...
...camping, you are & there're dinosaurs around!



But you've come prepared - haven't you!?!

The adventure begins...
...camping, you are & there're dinosaurs around!
Swiss Army Knife

Swiss Army Knife

The adventure begins...
...camping, you are & there're dinosaurs around!
Swiss Army Knife

Swiss Army Knife

5 Cucumbers

Mission Impossible V

The adventure begins...
...camping, you are & there're dinosaurs around!
Swiss Army Knife

Swiss Army Knife

5 Cucumbers

Mission Impossible V

The BAAP of Army Knives

Galactic Warlord Knife!

Back home...
...hungry, you are — raiding kitchen!
5 Cucumbers

Cucumber

Back home...
...hungry, you are — raiding kitchen!
5 Cucumbers

Cucumber

Kitchen Knife

Kitchen Knife

Back home...
...hungry, you are — raiding kitchen!
5 Cucumbers

Cucumber

Kitchen Knife

Kitchen Knife

Sliced Cucumber

SALAD !!!

World Wide Web...
...has changed!
    It used to be:
  • Close
  • Privileged
  • Alien
  • Island

  • ...much like wild adventure tourist spots.
World Wide Web...
...has changed!
    It used to be:
  • Close
  • Privileged
  • Alien
  • Island

  • ...much like wild adventure tourist spots.
    Now it is an:
  • Open
  • Accessible
  • Friendly
  • Society

  • ...your new home with a neighborhood.
So, what's the point...
...what's all these fuss about?
So, what's the point...
...what's all these fuss about?
  • Developers are the 1st-class citizens of the web
  • The new-and-upcoming web-technology is being implemented having developers' woes & w00ts in mind

But...

Most developers have still constricted themselves in the primitive way of doing things

So, what's the point...
...what's all these fuss about?
  • Use appropriate tools for the job
  • Prefer the native-tools - they go very well with the system
  • Don't shoot for external multipurpose tools, before even knowing all the capabilities of the native system
  • Fast-product delivery requirement may break the deal with the previous points, BUT BE WISE WHEN DECIDING.
Hell with the tools...
...by golly, what are they?

HTML5 APIs

  • Canvas [Demo]
  • Geolocation
  • Drag and Drop
  • Offline/Web Storage
  • Browser History Management [Demo]
  • Document contentEditable [Demo]
Hell with the tools...
...by golly, what are they?

HTML5 APIs

  • Canvas [Demo]
  • Geolocation
  • Drag and Drop
  • Offline/Web Storage
  • Browser History Management [Demo]
  • Document contentEditable [Demo]
  • IndexedDB
  • Microdata
  • File Reader & Writer
  • File System (Directory Access) [Demo]
  • Cross-document Messaging
  • MIME Type and Protocol Handler
Hell with the tools...
...by golly, what are they?
Whoa! So you mean...
...these all are the HTML5 APIs?

In a way, YEAH - but not really, NO:

  • There are more...
  • Not all of them are in HTML5 spec
  • Some even have specs of their own
    (either as recommendation or is in working draft)
  • Some of them are just features & not really APIs
  • Somewhere inbetween the line blurs

So for the sake of simplicity, I'll call 'em all HTML5 APIs — sue me!

Ok, what about the browser implementations...
...can I use them, I mean NOW?

The answer is again, Yes & No:

  • Not all of them are implemented in all of the browsers
  • Some of these APIs work seamlessly (e.g. Geolocation)
  • But, some have experimental/buggy implementations
  • Some of them are controversial and yet to get at large (e.g. WebSQL)

It all lies in the hands of the developers...

Which developers...
...Web-Developers or Browser-Developers?

Both of them (like Chicken vs. Egg paradox)

  • The browser-devs implement new Features and APIs in crude way
  • The web-devs use these Features and APIs
  • These technologies start to become more prevalent
  • Bugs get caught, and reported back to browser-devs
  • Browser-devs fixes the bugs and enhances the API
  • The web-devs use these Features and APIs MOAR!!!

...and the web progresses forward, everyone wins!

Where do I use them?
...Clients don't want them, & I havn't tried 'em much.
  • Start with your personal web-site
    (don't have? Get one, tonight!)
  • The sites which you made for fun, or for school/college-projects etc.
  • Use commercially, but don't charge extra — your clients will be fine with these
  • Get your lab-hat/thinking-cap — make demos, more demos — show 'em off
  • Wanna get real? Start contributing to the Mozilla WebDev team — we need you

...and the web progresses forward, everyone wins!

But Mozilla WebDev is scary stuff...
...I'm not that good yet with Django and all!

Very well then, start with something more vanilla:

  • Mozilla Community Sites (MCS) is getting a modern web-technology reboot
  • We need contributors, i.e. budding web-developers
  • Get your community site, spread Mozilla across the globe
  • Have fun hacking the existing codebase, implementing the new technologies
  • Make themes, templates, plugins for CMSs — or, make a customized one
  • Help yourself, help others — at the end of the day, you'll feel great!

...still a toddler-webdev? No worries:
Growing-up in latest technologies is easier than getting rid of old bad-habits.

Great, sounds fun...
...so is that it?

Well, NO.

  • For native web-technology, it's just the end of the beginning
  • For my talk, however, it's the beginning of the end, though...

...but hey, who's in hurry?

C'mon, you bore me...
...ok, what else is there to care about?

In Short: A LOT...

  • WebGL
  • SVG/MathML
  • WebSockets
  • WebWorkers
  • Offline capabilities
  • XMLHttpRequest 2 (a.k.a. AJAX 2)
  • ... and more!

Statutory request: don't sue me (again!)

You better watch out, dude...
...you're messing the bounderies up!

Yeah I know...

And 'till the boundaries are defined properly - I'll have my fun!

In the meantime, YOU have to choose whether to watch the show getting eternally delayed, or get hands dirty & start cleaning up the mess - together...

Putting the pieces together
...what did we get so far?
  • External libraries and frameworks are cool stuffs
  • But, using native features are way better practice
  • New Specs & APIs are designed keeping the developers' fun into consideration
  • Native features are implemented in-browser in sync with their capabilities
  • Still, external stuffs might be required for rapid-development or lack of native features
  • Always consider the trade-offs wisely.

Embrace the awesomeness — use new web-technologies!

So, that's about it...

...hope this wasn't a total waste of time!


Catch me on twitter @Deblopper
or ping Debloper at MozNet in #firefox, #remo, #mcs, #it

I enjoy questions, critiques & arguments very much (seriously, shoot me!)


Thank You!
Thanks Mozilla!!
Terima kasih Malaysia!!!