Joshfire Framework 0.9 Technical Overview

17
The Joshfire Framework Technical overview of the 0.9 release @sylvinus ParisJS #8, June 29th 2011

description

 

Transcript of Joshfire Framework 0.9 Technical Overview

Page 1: Joshfire Framework 0.9 Technical Overview

The Joshfire FrameworkTechnical overview of the 0.9 release

@sylvinusParisJS #8, June 29th 2011

Page 2: Joshfire Framework 0.9 Technical Overview

What problem Joshfire solvesA new device every day...

Technological fragmentation

Some boxes/SDKs are very hard to develop for

Agencies selling N apps for N devices

Increasing fragmentation => Developer pain

AppApp App

App

AppApp

App

AppApp

App

App

App

App

AppAppFragmentation !

Page 3: Joshfire Framework 0.9 Technical Overview

The solution

open-source

framework

A powerful framework based only on standard web technologies

A library of device-specific adapters

Page 4: Joshfire Framework 0.9 Technical Overview

One app, many devices

For developers:

Simple, fast

Documented, standard

Easy to maintain

Evolutive

For users:

A continuous experience through all their devices

App

Page 5: Joshfire Framework 0.9 Technical Overview

Let’s do a cross-device video app

Page 6: Joshfire Framework 0.9 Technical Overview

Specs

There’s a list of videos

I choose a video

Video plays

(Repeat on new device)

Page 7: Joshfire Framework 0.9 Technical Overview

HTML5 ?

<html><body> <video id="myplayer" controls autoplay /> <ul> <li><a href="video1.mp4">Video 1</a></li> <li><a href="video2.mp4">Video 2</a></li> </ul> <script> $('li a').click(function(ev) { $('#myplayer')[0].src = ev.target.href; }); </script></body></html>

Not actually

cross-devic

e<video> nightmare

jQuery on poor browsers :/

Keyboard/Remote support?

How to load Video 3?

Server-side?

Page 8: Joshfire Framework 0.9 Technical Overview

Describe what you want!

var Data = [{

“id”:”1”,“url”:”video1.mp4”

},{

“id”:”2”,“url”:”video2.mp4”

},];

var UI = [{

“id”:”myPlayer”,“type”:”video”

},{

“id”:”myVideos”,“type”:”list”,“dataPath”:”/”,“onSelect”:function(elt) {

app.ui.myPlayer.play(elt.url);}

}];

Every Joshfire app has a Data Tree and a UI Tree

Page 9: Joshfire Framework 0.9 Technical Overview

Describe what you want!

var Data = [{

“id”:”videos”,“children”:[

{“id”:”1”,“url”:”video1.mp4”

},{

“id”:”2”,“url”:”video2.mp4”

}]}

}];

var UI = [{

“id”:”myPlayer”,“type”:”video”

},{

“id”:”myVideos”,“type”:”list”,“dataPath”:”/videos/”,“onSelect”:function(elt) {

app.ui.myPlayer.play(elt.url);}

}];

Every Joshfire app has a Data Tree and a UI Tree

Page 10: Joshfire Framework 0.9 Technical Overview

Describe what you want!

var Data = [{

“id”:”videos”,“children”:function(callback) {

myVideoApi(callback);}

}];

var UI = [{

“id”:”myPlayer”,“type”:”video”

},{

“id”:”myVideos”,“type”:”list”,“dataPath”:”/videos/”,“onSelect”:function(elt) {

app.ui.myPlayer.play(elt.url);}

}];

Every Joshfire app has a Data Tree and a UI Tree

Page 11: Joshfire Framework 0.9 Technical Overview

What does this allow?

Forget PHP, Ruby and [insert deprecated language]. Full JavaScript stack.

Translate to HTML(5), either on client or server

Adapt UI depending on device (iOS lists, Native video players, ...)

Accept any input method (mouse, keyboard, touch, HTTP, ...)

Switch to any data source

Expose as RSS/XML feed

...

Page 12: Joshfire Framework 0.9 Technical Overview

General design

Page 13: Joshfire Framework 0.9 Technical Overview

Framework opinions

Impose what really matters

Data & UI Trees

Adapters

Let developer stay in his comfort zone for the rest

Template engine / CSS frameworks / CoffeeScript / ...

Backbone.js / Models / Data sources / ...

Expressjs / ...

Page 14: Joshfire Framework 0.9 Technical Overview

Tech overview

Code 100% JavaScript (FTW!)

Beautiful documentation, Simple examples, GitHub

Ridiculously modular (RequireJS, Events)

Don’t reinvent the wheel (Underscore.js, MediaElement.js, ...)

Utils library (Splashscreen, Stresstest, Worker pool, Geoloc, ...)

Optional build tools in Python (synchronous, Fabric)

Page 15: Joshfire Framework 0.9 Technical Overview

Adapter solutions

Mobile: Zepto, iScroll/Scrollability, PhoneGap, Titanium?

TVs: jQuery (modern), Server-side rendering (CEHTML & friends)

Desktop: Chromeless, AIR, ...

Arduino/Objects: HTTP packets to Node then socket.io

Embedded: ARM + Chromium framebuffer?

Boxee: XML export

...

Page 16: Joshfire Framework 0.9 Technical Overview

Joshfire 0.9 (Developer preview)Released today! Check http://joshfire.com

First JS library ever to ship with web+mobile+TV+node+arduino

Under heavy development (new adapters, more doc, ...)

Developer feedback welcome before 1.0 API freeze

0.9.x & 1.x releases will focus on media/content apps

We’re still hiring ;-)

We’ll be happy to help you refactor your apps with the framework

Questions?

Page 17: Joshfire Framework 0.9 Technical Overview