Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Y.App: Coordinating URL Navigation, Routing, an...
Search
Eric Ferraiuolo
May 31, 2012
Programming
2.1k
10
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Y.App: Coordinating URL Navigation, Routing, and Managing Views
Eric Ferraiuolo
May 31, 2012
More Decks by Eric Ferraiuolo
See All by Eric Ferraiuolo
React.js & i18n
ericf
2
490
Node on the Road
ericf
1
130
Pure
ericf
7
990
YUI and The Future
ericf
2
770
YUI 3.10.0 — Go Fast
ericf
3
610
YUI, Open Source, and Community
ericf
0
480
Advocatus Diaboli – Throne of JS
ericf
8
16k
Other Decks in Programming
See All in Programming
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.7k
Performance Engineering for Everyone
elenatanasoiu
0
220
AI 輔助遺留系統現代化的經驗分享
jame2408
1
990
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
130
dRuby over BLE
makicamel
2
390
LaravelLive Japan の裏方のすべて — 第188回 PHP勉強会@東京 (2026-06-24)
suguruooki
2
120
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.4k
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
4
1.5k
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
120
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.5k
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
7k
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
340
58k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
44k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
240
WCS-LA-2024
lcolladotor
0
650
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
540
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Into the Great Unknown - MozCon
thekraken
41
2.6k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Transcript
Eric Ferraiuolo, YUI @ericf Y.App URLs, Navigation, Routing, & Views
URLs Core to an App, Part of the UI
http://example.com/foo/ http://example.com/#/foo/ http://example.com/#!/foo/
http://example.com/foo/ http://example.com/#/foo/ http://example.com/#!/foo/
Who’s Data?
Everyone’s?
Everyone’s? Use Full-path URLs
Server’s Ability?
Dumb Server?
Dumb Server? Use Hash-based URLs
Initial State The First Thing a User Sees
Rendering /foo/
http://example.com/foo/
http://example.com/foo/ Fast Puppy! /foo/ HTML
http://example.com/foo/ Fast Puppy! /puppy.jpg IMG /foo/ HTML
Rendering /#/foo/
http://example.com/#/foo/
http://example.com/#/foo/ / HTML
http://example.com/#/foo/ / /app.js JavaScript HTML
http://example.com/#/foo/ / /app.js HTML /foo/ JSON JavaScript Slow Puppy :(
http://example.com/#/foo/ / /app.js HTML /foo/ JSON JavaScript Slow Puppy :(
/puppy.jpg IMG
Render Initial State on the Server, It’s Faster!
5x Faster Twitter is Moving Away From /#!/
Enhance …Progressively
pjax pushState + Ajax
None
Removes Unnecessary Full Page Loads
Automatically Handles <a> Clicks
Does Not Break Browser's Conventions
Client-side Routing Ful lling Requests on the Client
Data in Memory -> No HTTP Request
Seamlessly Support /foo/ & /#/foo/
Responding to URL Changes
<a> Clicks Page Reloads Back/Forward Programatic URL
<a> Clicks Page Reloads Back/Forward Programatic URL Route Handlers
<a> Clicks Page Reloads Back/Forward Programatic URL Route Handlers UI
Y.App
Y.App Y.PjaxBase Y.Router Y.View
Y.App Navigation Routing App View
Y.App Navigation Routing App View View Management Transitions Server Coordination
Hello World Y.App
Hello World Y.App <!DOCTYPE html> <html> <head> <title>Hello World!</title> </head>
<body> <script src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script> <script src="app.js"></script> </body> </html>
Hello World Y.App Y.HelloView = Y.Base.create('helloView', Y.View, [], { render:
function () { var name = this.get('name'); this.get('container').set('text', 'Hello ' + (name || 'World') + '!'); return this; } }); var app = new Y.App({ views: { hello: {type: 'HelloView'} } }); app.route('/', function (req) { this.showView('hello'); }); app.route('/:name', function (req) { this.showView('hello', {name: req.params.name}); }); app.render().navigate('/eric');
Hello World Y.App Y.HelloView = Y.Base.create('helloView', Y.View, [], { render:
function () { var name = this.get('name'); this.get('container').set('text', 'Hello ' + (name || 'World') + '!'); return this; } }); var app = new Y.App({ views: { hello: {type: 'HelloView'} } }); app.route('/', function (req) { this.showView('hello'); }); app.route('/:name', function (req) { this.showView('hello', {name: req.params.name}); }); app.render().navigate('/eric');
Hello World Y.App Y.HelloView = Y.Base.create('helloView', Y.View, [], { render:
function () { var name = this.get('name'); this.get('container').set('text', 'Hello ' + (name || 'World') + '!'); return this; } }); var app = new Y.App({ views: { hello: {type: 'HelloView'} } }); app.route('/', function (req) { this.showView('hello'); }); app.route('/:name', function (req) { this.showView('hello', {name: req.params.name}); }); app.render().navigate('/eric');
Hello World Y.App Y.HelloView = Y.Base.create('helloView', Y.View, [], { render:
function () { var name = this.get('name'); this.get('container').set('text', 'Hello ' + (name || 'World') + '!'); return this; } }); var app = new Y.App({ views: { hello: {type: 'HelloView'} } }); app.route('/', function (req) { this.showView('hello'); }); app.route('/:name', function (req) { this.showView('hello', {name: req.params.name}); }); app.render().navigate('/eric');
Hello World Y.App Y.HelloView = Y.Base.create('helloView', Y.View, [], { render:
function () { var name = this.get('name'); this.get('container').set('text', 'Hello ' + (name || 'World') + '!'); return this; } }); var app = new Y.App({ views: { hello: {type: 'HelloView'} } }); app.route('/', function (req) { this.showView('hello'); }); app.route('/:name', function (req) { this.showView('hello', {name: req.params.name}); }); app.render().navigate('/eric');
Hello World Y.App <!DOCTYPE html> <html> <head> <title>Hello World!</title> </head>
<body class="yui3-app"> <script src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script> <script src="app.js"></script> <div class="yui3-app-views"> <div>Hello eric!</div> </div> </body> </html>
Square ing
Square ing
Photos Near Me
Photos Near Me
Questions? Eric Ferraiuolo, YUI @ericf