Getting started with YUI3 and AlloyUI

124
getting started with YUI3 and AlloyUI Mainz, 2013.

description

Jax Conf @ Mainz, Germany @ April, 2013

Transcript of Getting started with YUI3 and AlloyUI

Page 1: Getting started with YUI3 and AlloyUI

getting startedwith YUI3 and

AlloyUI

Mainz, 2013.

Page 2: Getting started with YUI3 and AlloyUI
Page 3: Getting started with YUI3 and AlloyUI
Page 4: Getting started with YUI3 and AlloyUI

how someback-end

devs seethemselves

Page 5: Getting started with YUI3 and AlloyUI

how someback-end

devs seefront-end

devs

Page 6: Getting started with YUI3 and AlloyUI

“CSS is very easy”

Page 7: Getting started with YUI3 and AlloyUI
Page 8: Getting started with YUI3 and AlloyUI
Page 9: Getting started with YUI3 and AlloyUI
Page 10: Getting started with YUI3 and AlloyUI

“javascriptis ugly andfull of bugs”

Page 11: Getting started with YUI3 and AlloyUI
Page 12: Getting started with YUI3 and AlloyUI

EcmaScript 6 is coming

Page 13: Getting started with YUI3 and AlloyUI

front-endis changing

Page 16: Getting started with YUI3 and AlloyUI

there are three types of people

Page 17: Getting started with YUI3 and AlloyUI

1. those who compile javascript

Page 19: Getting started with YUI3 and AlloyUI

2. those who doesn’t compile

Page 21: Getting started with YUI3 and AlloyUI

3. java == javascript

Page 22: Getting started with YUI3 and AlloyUI
Page 23: Getting started with YUI3 and AlloyUI
Page 25: Getting started with YUI3 and AlloyUI
Page 26: Getting started with YUI3 and AlloyUI

today we’regoing totalk aboutserver-agnosticJS frameworks

Page 27: Getting started with YUI3 and AlloyUI

Events,Selection,DOM Manipulation,Animation,Ajax requests

jquery.com

Page 41: Getting started with YUI3 and AlloyUI
Page 47: Getting started with YUI3 and AlloyUI

YUI3modules

Page 48: Getting started with YUI3 and AlloyUI

YUI =

effects

DOM

ajax

events...

MVC

Page 49: Getting started with YUI3 and AlloyUI

YUI =

effects

DOM

ajax

events...

MVC

Page 50: Getting started with YUI3 and AlloyUI

YUI =

effects

DOM

ajax

events...

MVC

Page 51: Getting started with YUI3 and AlloyUI

YUI =

effects

DOM

ajax

events...

MVC

Page 52: Getting started with YUI3 and AlloyUI

YUI =

effects

DOM

ajax

events...

MVC

Page 53: Getting started with YUI3 and AlloyUI

YUI =

effects

DOM

ajax

events...

MVC

Page 54: Getting started with YUI3 and AlloyUI

YUI =

effects

DOM

ajax

events...

MVC

Page 59: Getting started with YUI3 and AlloyUI

YUI3basics

Page 60: Getting started with YUI3 and AlloyUI

$('.foo');

DOM traversalY.all('.foo');

YUI3

jQuery

Page 61: Getting started with YUI3 and AlloyUI

$('#foo').html('bar');

DOMmanipulationY.one('#foo').setHTML('bar');

YUI3

jQuery

Page 62: Getting started with YUI3 and AlloyUI

$('#close-btn').on('click', function() { // do something});

eventsY.one('#close-btn').on('click', function() { // do something});

YUI3

jQuery

Page 63: Getting started with YUI3 and AlloyUI

$('#fade').animate({ opacity: 0,}, 5000);

effectsY.one('#fade').transition({ duration: 1, opacity : 0});

YUI3

jQuery

Page 64: Getting started with YUI3 and AlloyUI

$.ajax({ url: "api.json", success: function(data) { // do something }});

ajaxY.io('api.json', { on: { success: function(data) { // do something } }});

YUI3

jQuery

Page 66: Getting started with YUI3 and AlloyUI

YUI3loading

Page 67: Getting started with YUI3 and AlloyUI
Page 68: Getting started with YUI3 and AlloyUI

“Optimize the front-end performance first, because 80/90% of the user response time is spent there.”

- Steve Souders,Engineer at Google

Page 69: Getting started with YUI3 and AlloyUI

without YUI...

Page 70: Getting started with YUI3 and AlloyUI

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.js"></script>

<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.2/jquery-ui.js"></script>

<script src="//cdnjs.cloudflare.com/ajax/libs/mustache.js/0.7.2/mustache.js"></script>

<script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.5/require.js"></script>

<script src="//cdnjs.cloudflare.com/ajax/libs/ember.js/1.0.0-rc.2/ember-1.0.pre.js"></script>......

Page 71: Getting started with YUI3 and AlloyUI

performance--maintainability--

Page 72: Getting started with YUI3 and AlloyUI

blocks render

Page 73: Getting started with YUI3 and AlloyUI

with YUI...

Page 74: Getting started with YUI3 and AlloyUI

one <script>

Page 76: Getting started with YUI3 and AlloyUI

everything elseasynchronous combo-loaded

from CDN

Page 77: Getting started with YUI3 and AlloyUI

sandboxYUI().use('module-name', function (Y) { // code goes here});

Page 78: Getting started with YUI3 and AlloyUI

why asynchronous?

Page 79: Getting started with YUI3 and AlloyUI

non-blockinghttp requests

Page 80: Getting started with YUI3 and AlloyUI

whycombo-loaded?

Page 82: Getting started with YUI3 and AlloyUI

whyload from a CDN?

Page 83: Getting started with YUI3 and AlloyUI

geographicallycloser

Page 84: Getting started with YUI3 and AlloyUI

YUIgallery

Page 86: Getting started with YUI3 and AlloyUI

your code onYahoo’s CDN

Page 88: Getting started with YUI3 and AlloyUI

available to anyone

Page 89: Getting started with YUI3 and AlloyUI

just use()YUI().use('gallery-audio', function (Y) { // code goes here});

Page 91: Getting started with YUI3 and AlloyUI

AlloyUI

Page 94: Getting started with YUI3 and AlloyUI

created on 2009

Page 96: Getting started with YUI3 and AlloyUI

built on top of YUI3

Page 97: Getting started with YUI3 and AlloyUI

AlloyUI =

calendar

tabs

buttons

carousel...

audio

Page 98: Getting started with YUI3 and AlloyUI

AlloyUI =

calendar

tabs

buttons

carousel...

audio

Page 99: Getting started with YUI3 and AlloyUI

AlloyUI =

calendar

tabs

buttons

carousel...

audio

Page 100: Getting started with YUI3 and AlloyUI

AlloyUI =

calendar

tabs

buttons

carousel...

audio

Page 101: Getting started with YUI3 and AlloyUI

AlloyUI =

calendar

tabs

buttons

carousel...

audio

Page 102: Getting started with YUI3 and AlloyUI

AlloyUI =

calendar

tabs

buttons

carousel...

audio

Page 103: Getting started with YUI3 and AlloyUI

AlloyUI =

calendar

tabs

buttons

carousel...

audio

Page 104: Getting started with YUI3 and AlloyUI

what we wanted:char counter

Page 105: Getting started with YUI3 and AlloyUI

#twitter-box

#myTextarea

#myCounter

Page 106: Getting started with YUI3 and AlloyUI

#twitter-box

#myTextarea

#myCounter

Page 107: Getting started with YUI3 and AlloyUI

#twitter-box

#myTextarea

#myCounter

Page 108: Getting started with YUI3 and AlloyUI

#twitter-box

#myTextarea

#myCounter

Page 110: Getting started with YUI3 and AlloyUI

what we wanted:schedule

Page 111: Getting started with YUI3 and AlloyUI
Page 113: Getting started with YUI3 and AlloyUI

what we wanted:a better way toexpress ideas

Page 114: Getting started with YUI3 and AlloyUI

* drag and drop UI* flexible API* support all browsers* no flash (HTML5)

Page 117: Getting started with YUI3 and AlloyUI

but I’ma javaguy!

Page 118: Getting started with YUI3 and AlloyUI

<taglibs> \o/

Page 119: Getting started with YUI3 and AlloyUI

taglibs<aui:button name="saveButton" type="submit" value="save"/>

Button

Page 120: Getting started with YUI3 and AlloyUI

taglibs<aui:input name="myField" > <aui:validator name="required" /> <aui:validator name="digits" /> <aui:validator name="range" > [8,50] </aui:validator></aui:input>

Form Validation

Page 121: Getting started with YUI3 and AlloyUI

the success of an application doesn’t depends on the technology itself...

...but how it is applied.

Page 122: Getting started with YUI3 and AlloyUI
Page 123: Getting started with YUI3 and AlloyUI
Page 124: Getting started with YUI3 and AlloyUI

dank :)