60
#yuiconf #modown @caridy

YUIConf2013: Introducing The "Modown" Project

Embed Size (px)

DESCRIPTION

The Mojito team have been working very hard on a new project under the YUI umbrella with codename "Modown", and we want to tell you more about it. Building on the success of the YUI Application Framework (YAF), plus the things we learned while creating Mojito, we decided to go back to our roots by creating a set of modular and versatile building blocks rather than trying to prescribe how to write single-page applications. In this presentation, we are going to cover the motivations, the current state of the project, how you can start using it, and how to help!

Citation preview

Page 1: YUIConf2013: Introducing The "Modown" Project

#yuiconf#modown@caridy

Page 3: YUIConf2013: Introducing The "Modown" Project

the web platform

Page 4: YUIConf2013: Introducing The "Modown" Project

“modown”

Page 5: YUIConf2013: Introducing The "Modown" Project
Page 6: YUIConf2013: Introducing The "Modown" Project

motivations

Page 7: YUIConf2013: Introducing The "Modown" Project

web applications becomingsingle-page applications

Page 8: YUIConf2013: Introducing The "Modown" Project

YAF success

Page 9: YUIConf2013: Introducing The "Modown" Project

mojito constraints

Page 10: YUIConf2013: Introducing The "Modown" Project

modown components

mojito-next(yui, search)

hermes(flickr)

assembler(touchdown)

Page 11: YUIConf2013: Introducing The "Modown" Project

Mojito

EmberJS

AngularJSRendr

BackboneMeteor

DerbyJS

YAF

React

Page 12: YUIConf2013: Introducing The "Modown" Project

single-page applications

Page 13: YUIConf2013: Introducing The "Modown" Project
Page 14: YUIConf2013: Introducing The "Modown" Project

users can switch betweendifferent states in no time

Page 15: YUIConf2013: Introducing The "Modown" Project

... and doing so without breakingany of the core features of the web

(history, url, openness, seo)

Page 16: YUIConf2013: Introducing The "Modown" Project

back to our roots

Page 17: YUIConf2013: Introducing The "Modown" Project

building blocks ratherthan prescriptions

Page 18: YUIConf2013: Introducing The "Modown" Project

libraries over frameworks

Page 19: YUIConf2013: Introducing The "Modown" Project

development on the open

Page 20: YUIConf2013: Introducing The "Modown" Project

goals

Page 21: YUIConf2013: Introducing The "Modown" Project

building blocks forSPA written in nodejs

Page 22: YUIConf2013: Introducing The "Modown" Project

extending express

Page 23: YUIConf2013: Introducing The "Modown" Project

rendering initial state on the server,then let the browser takes over

Page 24: YUIConf2013: Introducing The "Modown" Project

today

Page 25: YUIConf2013: Introducing The "Modown" Project

13 modules in NPM

Page 26: YUIConf2013: Introducing The "Modown" Project

https://npmjs.org/search?q=modown

Locator

locator-dust

locator-handlebars

locator-lang

locator-microlocator-

yui

expressexpress-

map

express-state

express-combo

express-yuiexpress-

annotation

express-view

modown components

express-slash

Page 27: YUIConf2013: Introducing The "Modown" Project

2 major customers in production(flickr and media)

Page 28: YUIConf2013: Introducing The "Modown" Project

all major changes in YAFare already in place

https://github.com/yui/yui3/blob/master/src/app/HISTORY.md

Page 29: YUIConf2013: Introducing The "Modown" Project

no docs, only component leveldocs and examples in github

Page 30: YUIConf2013: Introducing The "Modown" Project

examples

Page 31: YUIConf2013: Introducing The "Modown" Project

express-yuifor yui core modules

Page 32: YUIConf2013: Introducing The "Modown" Project

var express = require('express'), app = express(); 

app.get('/', function (req, res, next) { // `res.locals` holds all data // available on the template});

app.listen(3000);

Page 33: YUIConf2013: Introducing The "Modown" Project

var express = require('express'), expyui = require('express-yui'), app = express(); expyui.extend(app);

app.get('/', function (req, res, next) { // `res.locals` holds all data // available on the template});

app.listen(3000);

Page 34: YUIConf2013: Introducing The "Modown" Project

var express = require('express'), expyui = require('express-yui'), app = express(); expyui.extend(app);

app.use(expyui.expose());

app.get('/', function (req, res, next) { // `res.locals.state.toString()` will be // available on the template as a javascript blob});

app.listen(3000);

Page 35: YUIConf2013: Introducing The "Modown" Project

var express = require('express'), expyui = require('express-yui'), app = express(); expyui.extend(app);

app.yui.setCoreFromAppOrigin();

app.use(expyui.expose());

app.get('/', function (req, res, next) { // `res.locals.state.toString()` will be // available on the template as a javascript blob});

app.listen(3000);

Page 36: YUIConf2013: Introducing The "Modown" Project

var express = require('express'), expyui = require('express-yui'), app = express(); expyui.extend(app);

app.yui.setCoreFromAppOrigin();

app.use(expyui.expose());

app.yui.applyConfig({ fetchCSS: false });

app.get('/', function (req, res, next) { // `res.locals.state.toString()` will be // available on the template as a javascript blob});

app.listen(3000);

Page 37: YUIConf2013: Introducing The "Modown" Project

<!DOCTYPE html><html lang="en"><head> <meta charset="utf-8" /> <title>usage of `express-yui`</title>

<script>{{{state}}}</script> // if using handlebars, or <script><%== state %></script> // if using micro, or <script>{state|s}</script> // if using dust

</head><body> <p>non-blocking way to inject yui seed files</p></body></html>

Page 38: YUIConf2013: Introducing The "Modown" Project

<!DOCTYPE html><html lang="en"><head> <meta charset="utf-8" /> <title>usage of `express-yui`</title> <script>{{{state}}}</script> <script> app.yui.ready(function (err) { // `YUI().use()` and `app.yui.use()` are available }); </script>

</head><body> <p>non-blocking way to inject yui seed files</p></body></html>

Page 39: YUIConf2013: Introducing The "Modown" Project

express-yuifor custom yui modules

Page 40: YUIConf2013: Introducing The "Modown" Project

var express = require('express'), expyui = require('express-yui'), app = express(); 

expyui.extend(app);app.use(expyui.expose());

app.get('/item/:id', function (req, res, next) {

});

app.listen(3000);

Page 41: YUIConf2013: Introducing The "Modown" Project

var express = require('express'), expyui = require('express-yui'), app = express(); 

expyui.extend(app);app.use(expyui.expose());

app.get('/item/:id', function (req, res, next) {

});

app.yui.ready(function (err) { app.listen(3000);});

Page 42: YUIConf2013: Introducing The "Modown" Project

var express = require('express'), expyui = require('express-yui'), app = express(); 

expyui.extend(app);app.use(expyui.expose());

app.get('/item/:id', function (req, res, next) { app.yui.use('model-foo', function (Y) { var model = new Y.ModelFoo();

});});

app.yui.ready(function (err) { app.listen(3000);});

Page 43: YUIConf2013: Introducing The "Modown" Project

var express = require('express'), expyui = require('express-yui'), app = express(); 

expyui.extend(app);app.use(expyui.expose());

app.get('/item/:id', function (req, res, next) { app.yui.use('model-foo', function (Y) { var model = new Y.ModelFoo(); model.load(req.params.id, function (err) { res.render('view-name', model.toJSON()); }); });});

app.yui.ready(function (err) { app.listen(3000);});

Page 44: YUIConf2013: Introducing The "Modown" Project

var express = require('express'), expyui = require('express-yui'), app = express(); 

expyui.extend(app);app.use(expyui.expose());

app.get('/item/:id', function (req, res, next) { app.yui.use('model-foo', function (Y) { var model = new Y.ModelFoo(); model.load(req.params.id, function (err) { res.expose(model,'fooData'); //window.app.fooData res.render('view-name', model.toJSON()); }); });});

app.yui.ready(function (err) { app.listen(3000);});

Page 45: YUIConf2013: Introducing The "Modown" Project

<!DOCTYPE html><html lang="en"><head> <meta charset="utf-8" /> <title>usage of `express-yui` and `locator-yui`</title> <script>{{{state}}}</script> <script> app.yui.ready(function (err) { app.yui.use('model-foo', function (Y) {

}); }); </script>

</head><body> <p>non-blocking way to inject yui seed files</p></body></html>

Page 46: YUIConf2013: Introducing The "Modown" Project

<!DOCTYPE html><html lang="en"><head> <meta charset="utf-8" /> <title>usage of `express-yui` and `locator-yui`</title> <script>{{{state}}}</script> <script> app.yui.ready(function (err) { app.yui.use('model-foo', function (Y) { var model = new Y.ModelFoo(app.fooData); }); }); </script>

</head><body> <p>non-blocking way to inject yui seed files</p></body></html>

Page 47: YUIConf2013: Introducing The "Modown" Project

filesystem abstractionwith locator

Page 48: YUIConf2013: Introducing The "Modown" Project

locator gives semantic meaningto files on the filesystem

Page 49: YUIConf2013: Introducing The "Modown" Project

filesystem analysis to understandthe capabilities of the app

Page 50: YUIConf2013: Introducing The "Modown" Project

on the making...

Page 51: YUIConf2013: Introducing The "Modown" Project

Intl

Page 52: YUIConf2013: Introducing The "Modown" Project

composition

Page 53: YUIConf2013: Introducing The "Modown" Project

ES6 modules

Page 54: YUIConf2013: Introducing The "Modown" Project

UI data bindings

Page 55: YUIConf2013: Introducing The "Modown" Project

modownization of YUI

Page 56: YUIConf2013: Introducing The "Modown" Project

some final notes

Page 57: YUIConf2013: Introducing The "Modown" Project

modown is not a framework

Page 58: YUIConf2013: Introducing The "Modown" Project

modown is not a product

Page 59: YUIConf2013: Introducing The "Modown" Project

modown is just a principle

Page 60: YUIConf2013: Introducing The "Modown" Project

Thanks@caridy