Enyo for JS Nerds - Austin JS Meetup, April 2012

Preview:

DESCRIPTION

Ben Combee's slides on the Enyo & Ony

Citation preview

Enyo + Onyxfor JS NerdsBen Combee (@unwiredben)

Austin JavaScript Meetup, April 2012

Wednesday, April 18, 2012

Wednesday, April 18, 2012

We need 500 apps for the TouchPad, stat!

(that was Enyo 1.0)

Wednesday, April 18, 2012

We want apps from devs that aren’t

HTML+CSS experts.They need to run

everywhere.

Wednesday, April 18, 2012

How?

Wednesday, April 18, 2012

Components.As seen in Visual Basic.

They’re not sexy.They work.

Wednesday, April 18, 2012

iOS & AndroidChrome & SafariFirefox & IE8+Open webOSWindows 8

Wednesday, April 18, 2012

Open Source.Apache 2.0.

Wednesday, April 18, 2012

All source is on github.com/enyojs

Wednesday, April 18, 2012

Enyo 2.0: The Parts

Wednesday, April 18, 2012

boot - load all the source

Wednesday, April 18, 2012

package.js:

enyo.depends( “app.js”, “../css/app.css”, “$lib/onyx”);

Wednesday, April 18, 2012

kernel - OOP, there it is

Wednesday, April 18, 2012

enyo.kind() is a constructor factory

Wednesday, April 18, 2012

enyo.kind({ name: “tv.NewGirl”, kind: “TelevisionShow”, show: function() { this.inherited(arguments); system.play(“ng001.mp4”); }});var ng = new NewGirl();

Wednesday, April 18, 2012

enyo.Object provides property publishing

Wednesday, April 18, 2012

enyo.kind({ name: “UPC”, kind: enyo.Object, published: { productID: “0000000000” }, create: function() { this. productIDChanged(); }, productIDChanged: function(oldValue) { this.barcode = generate(this.productID); }});

Wednesday, April 18, 2012

var x = new UPC({ productID: “123456789X”});

x.setProductID(“5678900002”);pID = x.getProductID();

Wednesday, April 18, 2012

enyo.Component enables encapsulation

and events

Wednesday, April 18, 2012

enyo.kind({ name: “SithLord”, kind: “Jedi”, events: { onSpeak: “” }, scream: function(message) { doSpeak({ message: message, tone: “whiney” }); })});

Wednesday, April 18, 2012

enyo.kind({ name: “SithLords”, components: [ { kind: SithLord, name: “DarthVader”, onSpeak: “listenToToys” }, { kind: SithLord, name: “Palpatine” }, { kind: SithLord, name: “DarthSidious” } ], listenToToys: function(inSender, inEvent) { alert(inEvent.mesage); }});

Wednesday, April 18, 2012

var toys = new SithLords;

toys.$.DarthVader.setWeapon(lightsaber);toys.$.DarthVader.throw(toys.$.Palpatine);toys.$.DarthVader.scream(“NOOOOOOO!”);

Wednesday, April 18, 2012

enyo.UIComponent provides hooks for

layout control

Wednesday, April 18, 2012

enyo.Signals is routing for app-level events

Wednesday, April 18, 2012

lang.js - utilitieslog.js - logging

job.js - setTimeout wrapperanimation.js - math + reqFrame

macroize.js - templates

Wednesday, April 18, 2012

dom - dealing with HTML

Wednesday, April 18, 2012

enyo.Control:a rendering engine for

HTML

Wednesday, April 18, 2012

enyo.kind({ name: “BumperSticker”, kind: enyo.Control, tag: “div”, content: “Keep Austin Weird!”, style: “color: blue; font-size: 96pt”});

var bs = new BumperSticker();bs.renderInto(document.body);

Wednesday, April 18, 2012

dispatcher.js:hooks all the standard DOM events into the

Enyo scheme

Wednesday, April 18, 2012

enyo.kind({ name: “BumperSticker”, content: “Keep Austin Weird!”, style: “color: blue; font-size: 96pt”, tap: function() { alert(“someone bumped me!”); }});

var bs = new BumperSticker();bs.renderInto(document.body);

Wednesday, April 18, 2012

ajax - data-access through XHR & JSONP

Wednesday, April 18, 2012

function apiOK(inAsync, inValue) { alert( “success: “ + inValue ); }function apiFAIL(inAsync, inError) { alert( “FAIL: “ + inError ); }

var a = new enyo.Ajax({ url: “http://example.org/api”}).response(apiOK).error(apiFAIL).go();

Wednesday, April 18, 2012

ui - building blocks for making themed widgets

Wednesday, April 18, 2012

Button.jsCheckbox.js

Image.jsInput.js

Repeater.jsRichText.js

Select.js

BaseLayout.jsDragAvatar.js

Group.jsGroupItem.jsSelection.js

ToolDecorator.js

Wednesday, April 18, 2012

touch - enyo.Scroller & touchscreen support

Wednesday, April 18, 2012

enyo.Scroller handles how to show 10 lbs of content in a 2lb box

Wednesday, April 18, 2012

...and now, let’s introduceONYX

Wednesday, April 18, 2012

enyo is the core(think jQuery)

Wednesday, April 18, 2012

Onyx is our jQuery UI

Wednesday, April 18, 2012

CSS themes +JS behavior +

composite controls

Wednesday, April 18, 2012

Onyx Sampler - live views of all Onyx

controls & sample code

Wednesday, April 18, 2012

Support and Samples

Wednesday, April 18, 2012

API Viewer - pulls inline documentation from

live source treeenyojs.com/api

Wednesday, April 18, 2012

CryptoTweets -game using enyo &

onyx & web servicescombee.net/cryptotweets

Wednesday, April 18, 2012

Community Gallery - enyo.js/gallery

Wednesday, April 18, 2012

Community Forums - forums.enyojs.com

Wednesday, April 18, 2012

Blog - blog.enyojs.com

Wednesday, April 18, 2012

Twitter: @enyojs

Wednesday, April 18, 2012