SlideShare uma empresa Scribd logo
1 de 76
Baixar para ler offline
YUI App Framework
  You’ve Been Wanting This



                     Eric Ferraiuolo
                              @ericf
MVC
Backbone
Model
Y.Model
• Manages data/state
• Observable attributes
• Coalesced change event
• Contains business logic
• Has data-syncing layer
Y.ModelList
          1   foo

          2   foo

          3   foo

set()     4   foo

          5   foo

          6   foo

          7   foo
Y.ModelList




                   }
        1    foo

        2    foo

        3    foo

set()   4    foo      foo:change
        5    foo

        6    foo

        7    foo
View
Y.View
• Containment
• Render-able (you provide rendering logic)
• BYO-Template
• Declarative event subscriptions
• Lightweight
Router
Y.Controller Y.Router
• Basic navigation management
• Uses HTML5 pushState & popstate
   • Degrades to hash-based history
• Bookmark-able URLs
• Browser back/forward buttons work!
• Wire-up application states to routes
Y.Router Example
var router = new Y.Router();

router.route('/library/:lib/', function (req) {
    var lib = req.params.lib;
    if (lib === 'yui') {
        Y.log('YUI Library is awesome!');
    }
});

router.save('/library/yui/');
// => 'YUI Library is awesome!'
Y.Router Example
var router = new Y.Router();

router.route('/library/:lib/', function (req) {
    var lib = req.params.lib;
    if (lib === 'yui') {
        Y.log('YUI Library is awesome!');
    }
});

router.save('/library/yui/');
// => 'YUI Library is awesome!'
Y.Router Example
var router = new Y.Router();

router.route('/library/:lib/', function (req) {
    var lib = req.params.lib;
    if (lib === 'yui') {
        Y.log('YUI Library is awesome!');
    }
});

router.save('/library/yui/');
// => 'YUI Library is awesome!'
Y.Router Example
var router = new Y.Router();

router.route('/library/:lib/', function (req) {
    var lib = req.params.lib;
    if (lib === 'yui') {
        Y.log('YUI Library is awesome!');
    }
});

router.save('/library/yui/');
// => 'YUI Library is awesome!'
Y.Router Example
var router = new Y.Router();

router.route('/library/:lib/', function (req) {
    var lib = req.params.lib;
    if (lib === 'yui') {
        Y.log('YUI Library is awesome!');
    }
});

router.save('/library/yui/');
// => 'YUI Library is awesome!'
Y.Router Example
var router = new Y.Router();

router.route('/library/:lib/', function (req) {
    var lib = req.params.lib;
    if (lib === 'yui') {
        Y.log('YUI Library is awesome!');
    }
});

router.save('/library/yui/');
// => 'YUI Library is awesome!'
Y.Router Mechanics

            Y.Router

              history:change

   save/replace()

                               popstate
           Y.History
    pushState()
                               hashchange
Built on Solid Core
•Y.Base          •Y.ArrayList
•Y.Attribute     •Y.Node
•Y.EventTarget   •Y.History
•Y.io
•Y.JSON
•Y.Array
4.6KB
BIG
Community Adoption
What’s Coming
App Framework — 3.5.0
Y.App
Foundation and Structure
Sample Users App
var usersApp = new Y.App({
    views: {
        users: {
             type    : Y.UsersView,
             preserve: true
        },

          user: {
              type : Y.UserView,
              parent: 'users'
          }
      }
});
Sample Users App
var usersApp = new Y.App({
    views: {
        users: {
             type    : Y.UsersView,
             preserve: true
        },

          user: {
              type : Y.UserView,
              parent: 'users'
          }
      }
});
Sample Users App
var usersApp = new Y.App({
    views: {
        users: {
             type    : Y.UsersView,
             preserve: true
        },

          user: {
              type : Y.UserView,
              parent: 'users'
          }
      }
});
Sample Users App
var usersApp = new Y.App({
    views: {
        users: {
             type    : Y.UsersView,
             preserve: true
        },

          user: {
              type : Y.UserView,
              parent: 'users'
          }
      }
});
Sample Users App
var usersApp = new Y.App({
    views: {
        users: {
             type    : Y.UsersView,
             preserve: true
        },

          user: {
              type : Y.UserView,
              parent: 'users'
          }
      }
});
Sample Users App
var users = new Y.UsersList();

usersApp.route('/user/', function () {
    this.showView('users', {modelList: users});
});

usersApp.route('/user/:id/', function (req) {
    var user = users.getById(req.params.id);

      this.showView('user', {model: user}, function (view) {
          // Called after transition.
      });
});
Sample Users App
var users = new Y.UsersList();

usersApp.route('/user/', function () {
    this.showView('users', {modelList: users});
});

usersApp.route('/user/:id/', function (req) {
    var user = users.getById(req.params.id);

      this.showView('user', {model: user}, function (view) {
          // Called after transition.
      });
});
Sample Users App
var users = new Y.UsersList();

usersApp.route('/user/', function () {
    this.showView('users', {modelList: users});
});

usersApp.route('/user/:id/', function (req) {
    var user = users.getById(req.params.id);

      this.showView('user', {model: user}, function (view) {
          // Called after transition.
      });
});
Sample Users App
var users = new Y.UsersList();

usersApp.route('/user/', function () {
    this.showView('users', {modelList: users});
});

usersApp.route('/user/:id/', function (req) {
    var user = users.getById(req.params.id);

      this.showView('user', {model: user}, function (view) {
          // Called after transition.
      });
});
Sample Users App
var users = new Y.UsersList();

usersApp.route('/user/', function () {
    this.showView('users', {modelList: users});
});

usersApp.route('/user/:id/', function (req) {
    var user = users.getById(req.params.id);

      this.showView('user', {model: user}, function (view) {
          // Called after transition.
      });
});
Sample Users App
var users = new Y.UsersList();

usersApp.route('/user/', function () {
    this.showView('users', {modelList: users});
});

usersApp.route('/user/:id/', function (req) {
    var user = users.getById(req.params.id);

      this.showView('user', {model: user}, function (view) {
          // Called after transition.
      });
});
Sample Users App
var users = new Y.UsersList();

usersApp.route('/user/', function () {
    this.showView('users', {modelList: users});
});

usersApp.route('/user/:id/', function (req) {
    var user = users.getById(req.params.id);

      this.showView('user', {model: user}, function (view) {
          // Called after transition.
      });
});
Enhanced Navigation
Enhanced Navigation
pushState + Ajax =

     pjax
pushState + Ajax = pjax
• Handles link clicks
• Update full URL
• Dynamically load & render content
• Ajax !=== XHR
• Browser’s Back/Forward buttons work!
• Seamless
Y.Pjax

 Y.Router

             Y.PjaxBase


 Y.Pjax

 Y.History
Y.Pjax Mechanics

                          setContent()

link click   navigate()      DOM

              Y.Pjax
                              XHR
                           Server
Recap Y.App
• Is a View
• Is a Router
• Uses PjaxBase
• Has an activeView
• Manages View lifecycles & transitions
• Instantiate or sub-class
Templating
{{#with handlebars}}
Handlebars Templates
<script id="entry-template" type="text/x-handlebars-template">

    <div class="entry">
        <h1><{{title}}</h1>

        {{#if author}}
        <p class="author">{{author}}</p>
        {{/if}}

        <div class="body">{{body}}</div>
    </div>

</script>
Handlebars Templates
<script id="entry-template" type="text/x-handlebars-template">

    <div class="entry">
        <h1><{{title}}</h1>

        {{#if author}}
        <p class="author">{{author}}</p>
        {{/if}}

        <div class="body">{{body}}</div>
    </div>

</script>
Handlebars Templates
<script id="entry-template" type="text/x-handlebars-template">

    <div class="entry">
        <h1><{{title}}</h1>

        {{#if author}}
        <p class="author">{{author}}</p>
        {{/if}}

        <div class="body">{{body}}</div>
    </div>

</script>
Handlebars Templates
<script id="entry-template" type="text/x-handlebars-template">

    <div class="entry">
        <h1><{{title}}</h1>

        {{#if author}}
        <p class="author">{{author}}</p>
        {{/if}}

        <div class="body">{{body}}</div>
    </div>

</script>
Handlebars Templates
<script id="entry-template" type="text/x-handlebars-template">

    <div class="entry">
        <h1><{{title}}</h1>

        {{#if author}}
        <p class="author">{{author}}</p>
        {{/if}}

        <div class="body">{{body}}</div>
    </div>

</script>
Handlebars Templates
<script id="entry-template" type="text/x-handlebars-template">

    <div class="entry">
        <h1><{{title}}</h1>

        {{#if author}}
        <p class="author">{{author}}</p>
        {{/if}}

        <div class="body">{{body}}</div>
    </div>

</script>
Handlebars Templates
<script id="entry-template" type="text/x-handlebars-template">

    <div class="entry">
        <h1><{{title}}</h1>

        {{#if author}}
        <p class="author">{{author}}</p>
        {{/if}}

        <div class="body">{{body}}</div>
    </div>

</script>
Y.Handlebars
YUI().use('handlebars', 'node-base', function (Y) {

      var template = Y.one('#entry-template').getContent(),
          render   = Y.Handlebars.compile(template),
          entry    = {
              title : 'The Adventures of Tom Selleck',
              body : 'Tom crossed the river in his Ferrari…',
              author: 'Ryan Grove'
          };

      Y.one('#entry').setContent(render(entry));

});
Y.Handlebars
YUI().use('handlebars', 'node-base', function (Y) {

      var template = Y.one('#entry-template').getContent(),
          render   = Y.Handlebars.compile(template),
          entry    = {
              title : 'The Adventures of Tom Selleck',
              body : 'Tom crossed the river in his Ferrari…',
              author: 'Ryan Grove'
          };

      Y.one('#entry').setContent(render(entry));

});
Y.Handlebars
YUI().use('handlebars', 'node-base', function (Y) {

      var template = Y.one('#entry-template').getContent(),
          render   = Y.Handlebars.compile(template),
          entry    = {
              title : 'The Adventures of Tom Selleck',
              body : 'Tom crossed the river in his Ferrari…',
              author: 'Ryan Grove'
          };

      Y.one('#entry').setContent(render(entry));

});
Y.Handlebars
YUI().use('handlebars', 'node-base', function (Y) {

      var template = Y.one('#entry-template').getContent(),
          render   = Y.Handlebars.compile(template),
          entry    = {
              title : 'The Adventures of Tom Selleck',
              body : 'Tom crossed the river in his Ferrari…',
              author: 'Ryan Grove'
          };

      Y.one('#entry').setContent(render(entry));

});
Y.Handlebars
YUI().use('handlebars', 'node-base', function (Y) {

      var template = Y.one('#entry-template').getContent(),
          render   = Y.Handlebars.compile(template),
          entry    = {
              title : 'The Adventures of Tom Selleck',
              body : 'Tom crossed the river in his Ferrari…',
              author: 'Ryan Grove'
          };

      Y.one('#entry').setContent(render(entry));

});
Y.Handlebars
YUI().use('handlebars', 'node-base', function (Y) {

      var template = Y.one('#entry-template').getContent(),
          render   = Y.Handlebars.compile(template),
          entry    = {
              title : 'The Adventures of Tom Selleck',
              body : 'Tom crossed the river in his Ferrari…',
              author: 'Ryan Grove'
          };

      Y.one('#entry').setContent(render(entry));

});
Server-Side
Guides
Photos Near Me
 http://photosnear.me
Photos Near Me
• Built with App Framework
• Uses Y.App and Y.Handlebars
• ~ 650 Lines of JavaScript
• Responsive Design
• http://photosnear.me
• https://github.com/ericf/photosnear.me
PhotosNearMe (Y.App)
PhotosNearMe (Y.App)
Place (Y.Model)


                  Photos (Y.ModelList)
PhotosNearMe (Y.App)


GridView (Y.View)
PhotosNearMe (Y.App)
PhotosNearMe (Y.App)
Place (Y.Model)

                  Photo (Y.Model)
PhotosNearMe (Y.App)


LightboxView (Y.View)
Future…
App Framework — 3.6.0+
Dealing with Data
• Improved data access
• Model sync layers
• Data binding
Breadth & Depth
• View extensions & plugins
• View-based widgets
• More mobile
• More server
Questions?
  Ask away!



              Eric Ferraiuolo
                       @ericf

Mais conteúdo relacionado

Último

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Destaque

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 

Destaque (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

App framework — You’ve Been Wanting This

  • 1. YUI App Framework You’ve Been Wanting This Eric Ferraiuolo @ericf
  • 2. MVC
  • 5. Y.Model • Manages data/state • Observable attributes • Coalesced change event • Contains business logic • Has data-syncing layer
  • 6. Y.ModelList 1 foo 2 foo 3 foo set() 4 foo 5 foo 6 foo 7 foo
  • 7. Y.ModelList } 1 foo 2 foo 3 foo set() 4 foo foo:change 5 foo 6 foo 7 foo
  • 9. Y.View • Containment • Render-able (you provide rendering logic) • BYO-Template • Declarative event subscriptions • Lightweight
  • 11. Y.Controller Y.Router • Basic navigation management • Uses HTML5 pushState & popstate • Degrades to hash-based history • Bookmark-able URLs • Browser back/forward buttons work! • Wire-up application states to routes
  • 12. Y.Router Example var router = new Y.Router(); router.route('/library/:lib/', function (req) { var lib = req.params.lib; if (lib === 'yui') { Y.log('YUI Library is awesome!'); } }); router.save('/library/yui/'); // => 'YUI Library is awesome!'
  • 13. Y.Router Example var router = new Y.Router(); router.route('/library/:lib/', function (req) { var lib = req.params.lib; if (lib === 'yui') { Y.log('YUI Library is awesome!'); } }); router.save('/library/yui/'); // => 'YUI Library is awesome!'
  • 14. Y.Router Example var router = new Y.Router(); router.route('/library/:lib/', function (req) { var lib = req.params.lib; if (lib === 'yui') { Y.log('YUI Library is awesome!'); } }); router.save('/library/yui/'); // => 'YUI Library is awesome!'
  • 15. Y.Router Example var router = new Y.Router(); router.route('/library/:lib/', function (req) { var lib = req.params.lib; if (lib === 'yui') { Y.log('YUI Library is awesome!'); } }); router.save('/library/yui/'); // => 'YUI Library is awesome!'
  • 16. Y.Router Example var router = new Y.Router(); router.route('/library/:lib/', function (req) { var lib = req.params.lib; if (lib === 'yui') { Y.log('YUI Library is awesome!'); } }); router.save('/library/yui/'); // => 'YUI Library is awesome!'
  • 17. Y.Router Example var router = new Y.Router(); router.route('/library/:lib/', function (req) { var lib = req.params.lib; if (lib === 'yui') { Y.log('YUI Library is awesome!'); } }); router.save('/library/yui/'); // => 'YUI Library is awesome!'
  • 18. Y.Router Mechanics Y.Router history:change save/replace() popstate Y.History pushState() hashchange
  • 19. Built on Solid Core •Y.Base •Y.ArrayList •Y.Attribute •Y.Node •Y.EventTarget •Y.History •Y.io •Y.JSON •Y.Array
  • 20. 4.6KB
  • 23. Y.App
  • 25. Sample Users App var usersApp = new Y.App({ views: { users: { type : Y.UsersView, preserve: true }, user: { type : Y.UserView, parent: 'users' } } });
  • 26. Sample Users App var usersApp = new Y.App({ views: { users: { type : Y.UsersView, preserve: true }, user: { type : Y.UserView, parent: 'users' } } });
  • 27. Sample Users App var usersApp = new Y.App({ views: { users: { type : Y.UsersView, preserve: true }, user: { type : Y.UserView, parent: 'users' } } });
  • 28. Sample Users App var usersApp = new Y.App({ views: { users: { type : Y.UsersView, preserve: true }, user: { type : Y.UserView, parent: 'users' } } });
  • 29. Sample Users App var usersApp = new Y.App({ views: { users: { type : Y.UsersView, preserve: true }, user: { type : Y.UserView, parent: 'users' } } });
  • 30. Sample Users App var users = new Y.UsersList(); usersApp.route('/user/', function () { this.showView('users', {modelList: users}); }); usersApp.route('/user/:id/', function (req) { var user = users.getById(req.params.id); this.showView('user', {model: user}, function (view) { // Called after transition. }); });
  • 31. Sample Users App var users = new Y.UsersList(); usersApp.route('/user/', function () { this.showView('users', {modelList: users}); }); usersApp.route('/user/:id/', function (req) { var user = users.getById(req.params.id); this.showView('user', {model: user}, function (view) { // Called after transition. }); });
  • 32. Sample Users App var users = new Y.UsersList(); usersApp.route('/user/', function () { this.showView('users', {modelList: users}); }); usersApp.route('/user/:id/', function (req) { var user = users.getById(req.params.id); this.showView('user', {model: user}, function (view) { // Called after transition. }); });
  • 33. Sample Users App var users = new Y.UsersList(); usersApp.route('/user/', function () { this.showView('users', {modelList: users}); }); usersApp.route('/user/:id/', function (req) { var user = users.getById(req.params.id); this.showView('user', {model: user}, function (view) { // Called after transition. }); });
  • 34. Sample Users App var users = new Y.UsersList(); usersApp.route('/user/', function () { this.showView('users', {modelList: users}); }); usersApp.route('/user/:id/', function (req) { var user = users.getById(req.params.id); this.showView('user', {model: user}, function (view) { // Called after transition. }); });
  • 35. Sample Users App var users = new Y.UsersList(); usersApp.route('/user/', function () { this.showView('users', {modelList: users}); }); usersApp.route('/user/:id/', function (req) { var user = users.getById(req.params.id); this.showView('user', {model: user}, function (view) { // Called after transition. }); });
  • 36. Sample Users App var users = new Y.UsersList(); usersApp.route('/user/', function () { this.showView('users', {modelList: users}); }); usersApp.route('/user/:id/', function (req) { var user = users.getById(req.params.id); this.showView('user', {model: user}, function (view) { // Called after transition. }); });
  • 39.
  • 41. pushState + Ajax = pjax • Handles link clicks • Update full URL • Dynamically load & render content • Ajax !=== XHR • Browser’s Back/Forward buttons work! • Seamless
  • 42. Y.Pjax Y.Router Y.PjaxBase Y.Pjax Y.History
  • 43. Y.Pjax Mechanics setContent() link click navigate() DOM Y.Pjax XHR Server
  • 44. Recap Y.App • Is a View • Is a Router • Uses PjaxBase • Has an activeView • Manages View lifecycles & transitions • Instantiate or sub-class
  • 47. Handlebars Templates <script id="entry-template" type="text/x-handlebars-template"> <div class="entry"> <h1><{{title}}</h1> {{#if author}} <p class="author">{{author}}</p> {{/if}} <div class="body">{{body}}</div> </div> </script>
  • 48. Handlebars Templates <script id="entry-template" type="text/x-handlebars-template"> <div class="entry"> <h1><{{title}}</h1> {{#if author}} <p class="author">{{author}}</p> {{/if}} <div class="body">{{body}}</div> </div> </script>
  • 49. Handlebars Templates <script id="entry-template" type="text/x-handlebars-template"> <div class="entry"> <h1><{{title}}</h1> {{#if author}} <p class="author">{{author}}</p> {{/if}} <div class="body">{{body}}</div> </div> </script>
  • 50. Handlebars Templates <script id="entry-template" type="text/x-handlebars-template"> <div class="entry"> <h1><{{title}}</h1> {{#if author}} <p class="author">{{author}}</p> {{/if}} <div class="body">{{body}}</div> </div> </script>
  • 51. Handlebars Templates <script id="entry-template" type="text/x-handlebars-template"> <div class="entry"> <h1><{{title}}</h1> {{#if author}} <p class="author">{{author}}</p> {{/if}} <div class="body">{{body}}</div> </div> </script>
  • 52. Handlebars Templates <script id="entry-template" type="text/x-handlebars-template"> <div class="entry"> <h1><{{title}}</h1> {{#if author}} <p class="author">{{author}}</p> {{/if}} <div class="body">{{body}}</div> </div> </script>
  • 53. Handlebars Templates <script id="entry-template" type="text/x-handlebars-template"> <div class="entry"> <h1><{{title}}</h1> {{#if author}} <p class="author">{{author}}</p> {{/if}} <div class="body">{{body}}</div> </div> </script>
  • 54. Y.Handlebars YUI().use('handlebars', 'node-base', function (Y) { var template = Y.one('#entry-template').getContent(), render = Y.Handlebars.compile(template), entry = { title : 'The Adventures of Tom Selleck', body : 'Tom crossed the river in his Ferrari…', author: 'Ryan Grove' }; Y.one('#entry').setContent(render(entry)); });
  • 55. Y.Handlebars YUI().use('handlebars', 'node-base', function (Y) { var template = Y.one('#entry-template').getContent(), render = Y.Handlebars.compile(template), entry = { title : 'The Adventures of Tom Selleck', body : 'Tom crossed the river in his Ferrari…', author: 'Ryan Grove' }; Y.one('#entry').setContent(render(entry)); });
  • 56. Y.Handlebars YUI().use('handlebars', 'node-base', function (Y) { var template = Y.one('#entry-template').getContent(), render = Y.Handlebars.compile(template), entry = { title : 'The Adventures of Tom Selleck', body : 'Tom crossed the river in his Ferrari…', author: 'Ryan Grove' }; Y.one('#entry').setContent(render(entry)); });
  • 57. Y.Handlebars YUI().use('handlebars', 'node-base', function (Y) { var template = Y.one('#entry-template').getContent(), render = Y.Handlebars.compile(template), entry = { title : 'The Adventures of Tom Selleck', body : 'Tom crossed the river in his Ferrari…', author: 'Ryan Grove' }; Y.one('#entry').setContent(render(entry)); });
  • 58. Y.Handlebars YUI().use('handlebars', 'node-base', function (Y) { var template = Y.one('#entry-template').getContent(), render = Y.Handlebars.compile(template), entry = { title : 'The Adventures of Tom Selleck', body : 'Tom crossed the river in his Ferrari…', author: 'Ryan Grove' }; Y.one('#entry').setContent(render(entry)); });
  • 59. Y.Handlebars YUI().use('handlebars', 'node-base', function (Y) { var template = Y.one('#entry-template').getContent(), render = Y.Handlebars.compile(template), entry = { title : 'The Adventures of Tom Selleck', body : 'Tom crossed the river in his Ferrari…', author: 'Ryan Grove' }; Y.one('#entry').setContent(render(entry)); });
  • 61.
  • 63. Photos Near Me http://photosnear.me
  • 64. Photos Near Me • Built with App Framework • Uses Y.App and Y.Handlebars • ~ 650 Lines of JavaScript • Responsive Design • http://photosnear.me • https://github.com/ericf/photosnear.me
  • 65.
  • 67. PhotosNearMe (Y.App) Place (Y.Model) Photos (Y.ModelList)
  • 69.
  • 74. Dealing with Data • Improved data access • Model sync layers • Data binding
  • 75. Breadth & Depth • View extensions & plugins • View-based widgets • More mobile • More server
  • 76. Questions? Ask away! Eric Ferraiuolo @ericf