introduction to yui

76
The Yahoo User Interface Library (YUI) Christian Heilmann | http://wait-till-i.com | http://scriptingenabled.org Web Directions North, Denver, Colorado, February 2009

Upload: christian-heilmann

Post on 18-Dec-2014

6.621 views

Category:

Technology


1 download

DESCRIPTION

My small presentation at Web Directions North 2009 introducing YUI as part of the "JavaScript Libraries Super Session"

TRANSCRIPT

Page 1: Introduction to YUI

The Yahoo User Interface Library

(YUI)

Christian Heilmann | http://wait-till-i.com | http://scriptingenabled.org

Web Directions North, Denver, Colorado, February 2009

Page 2: Introduction to YUI

Let’s take a walk...

...on the client side

Page 3: Introduction to YUI

The client side is where strange things happen.

Page 4: Introduction to YUI

Browsers render in fascinating and totally wrong

ways.

Page 5: Introduction to YUI

Random code from dubious sources interferes with your

godlike, clean and high quality code.

Page 6: Introduction to YUI

...and you fix more than you develop.

Page 7: Introduction to YUI

The web is a total mess!

Page 8: Introduction to YUI

The reason is that things seemingly work.

Page 9: Introduction to YUI

However, you are not the web and neither is your

computer.

Page 10: Introduction to YUI

To make things work for Yahoo we needed to find a

way to abstract these issues away from us.

Page 11: Introduction to YUI

And this is why we built the YUI.

Page 12: Introduction to YUI

It brings order to the chaos.

Page 13: Introduction to YUI

What chaos?

Page 14: Introduction to YUI

JavaScript is a part of a larger world.

This is not the copyrighted

photo you are looking for

Page 15: Introduction to YUI

Browser

Interaction with other technologies (CSS, Markup)

Interaction with other scripts

Interaction with the backend

Page 16: Introduction to YUI

Interaction with the operating system.

Interaction with the user (with unknown ability)

Interaction with bad code (a.k.a. ads)

Page 17: Introduction to YUI

YUI deals with all of this.

Page 18: Introduction to YUI

Because it has to – we built it for industrial (Yahoo)

strength.

Page 19: Introduction to YUI

The first thing we needed to get are some sensible

constraints.

Page 21: Introduction to YUI
Page 22: Introduction to YUI

This gave us a defined playground, and we were able

to start tackling the other issues.

Page 23: Introduction to YUI

The first thing to tackle before you can even hope to build

interfaces are browser differences in CSS.

Page 24: Introduction to YUI

There is no such thing as an “unstyled page”.

Page 25: Introduction to YUI

There is no such thing as an “unstyled page”.

Page 26: Introduction to YUI
Page 27: Introduction to YUI
Page 28: Introduction to YUI
Page 29: Introduction to YUI
Page 30: Introduction to YUI

Good luck working around that one.

Page 31: Introduction to YUI

Unless you use reset.css

http://developer.yahoo.com/yui/reset/

Page 32: Introduction to YUI
Page 33: Introduction to YUI
Page 34: Introduction to YUI
Page 35: Introduction to YUI
Page 36: Introduction to YUI

Starting with a blank canvas

=

good.

Page 37: Introduction to YUI

What about typography?

Page 39: Introduction to YUI
Page 41: Introduction to YUI
Page 42: Introduction to YUI

Grids gives you an amazingly large amount of options and

layout permutations.

Page 43: Introduction to YUI

YUI comes with a lot of tools to gain knowledge about what is happening under the hood

of your application.

Page 44: Introduction to YUI

YUI logger gives you a cross-browser console to show

values.

Page 45: Introduction to YUI
Page 46: Introduction to YUI

Death to alert()!

Page 47: Introduction to YUI

You can even include the logger on the fly with a

bookmarklet.

Page 49: Introduction to YUI

If you need even more control, there is the YUI

profiler.

http://developer.yahoo.com/yui/profiler/

Page 50: Introduction to YUI
Page 51: Introduction to YUI

And the YUI test framework for test driven development.

http://developer.yahoo.com/yui/yuitest/

Page 52: Introduction to YUI

On a code level, YUI comes out-of-the-box with

namespacing.

Page 53: Introduction to YUI

Which – if used correctly – keeps large amounts of code readable and maintainable.

Page 54: Introduction to YUI

YAHOO.lang also comes with a lot of validation methods to ensure things are what they

are.

Page 55: Introduction to YUI

All in all YUI is a good choice for large, distributed teams.

Page 56: Introduction to YUI

Built on agreed standards

Separated into modules each dealing with one task (Core, DOM, Event,Animation, IO...)

Constant reporting of what is going on

Own debugging environment

Page 57: Introduction to YUI

YUI is a framework to build working web applications.

Page 58: Introduction to YUI

It allows you to create applications using tested and working widgets that extend

what HTML gives us.

Page 59: Introduction to YUI

AutoComplete

Button

Calendar

Charts

Container

DataTable

Layout

Menu

Rich Text

TabView

Interface W

idg

ets

Page 60: Introduction to YUI
Page 61: Introduction to YUI

Everything is fully documented.

Page 63: Introduction to YUI

And there are almost 300 examples to look at.

Page 65: Introduction to YUI

The controls are driven by custom events to allow for extending and monitoring

them.

Page 66: Introduction to YUI
Page 67: Introduction to YUI

All YUI components come as a debug version which log

everything that is going on to the logger.

Page 68: Introduction to YUI

All in all YUI allows you to build web interfaces without having to know all the pain that goes on in the browser

world.

Page 69: Introduction to YUI

What does the future hold?

Page 71: Introduction to YUI
Page 72: Introduction to YUI

Include on demand

Multiple sandboxed instances in a page

Modularity on CSS level (per element reset)

Every event is a custom event

Page 73: Introduction to YUI

Screen reader compatible widgets.

Widgets extendable with plugins

Framework (SDK) for own compatible widgets.

Page 74: Introduction to YUI

The elevator lift pitchYUI is the system that Yahoo uses to build its web sites. It is constantly tested to work for the largest amount of users, free, open source and covers everything from design patterns to out-of-the-box widgets. It is modular and you can use only what you need. You can either host it yourself or get it from a network of distributed servers.

Page 76: Introduction to YUI

Christian Heilmann

http://wait-till-i.com

http://scriptingenabled.org

http://twitter.com/codepo8

T H A N K S !