YUI &jQuery:To Build Large Scale JavaScript App                 Morgan Cheng                 @morgancheng
It is Not Religious Warhttp://www.quora.com/How-could-YUI3-improve-its-image-compared-to-jQuery-MooTools-etchttp://www.ncz...
Single Metric is not Enough
Rosetta is not enough    http://www.jsrosettastone.com/
jQuery   YUI
Demo• http://jsfiddle.net/morgancheng/afX5b/• http://jsfiddle.net/morgancheng/HmsxA/• http://jsfiddle.net/morgancheng/9qgA...
jQuery doesn’t Scale
Scale!
What is required to be      Scalable?
Application LifecycleModule Management DOM, AJAX Utility
Application LifecycleModule Management DOM, AJAX Utility
Module Management
“The secret to building large apps is never build  large apps. Break you applications into small  pieces. Then, assemble t...
• Independent• Reusable• Agnostic to others
Event System   I know something                          I want to do something  happens. But I don’t                     ...
AMD: Asynchronous Module        Definition  define(     ‘module-name’,      [‘dependency1’, ‘dependency2’],  function(d1, ...
YUI Module Management YUI.add(‘module-name’, function(Y) {    // Change Y to change the world Y.foo = …; }, ‘version’, {  ...
Concatenate Modules
Application Lifecycle
• Bookmark-able• Navigable• SEO Friendly
So Many Choiceshttps://github.com/addyosmani/todomvc
MVC is not the only game in town
App Framework
Choose Gear According to YOUR Needs
Thank YouAny Questions?
Upcoming SlideShare
Loading in …5
×

YUI vs jQuery: to Build Large Scale JavaScript App

10,294 views

Published on

Published in: Technology

YUI vs jQuery: to Build Large Scale JavaScript App

  1. 1. YUI &jQuery:To Build Large Scale JavaScript App Morgan Cheng @morgancheng
  2. 2. It is Not Religious Warhttp://www.quora.com/How-could-YUI3-improve-its-image-compared-to-jQuery-MooTools-etchttp://www.nczonline.net/blog/2010/11/03/response-to-john-resigs-comments-about-yui/
  3. 3. Single Metric is not Enough
  4. 4. Rosetta is not enough http://www.jsrosettastone.com/
  5. 5. jQuery YUI
  6. 6. Demo• http://jsfiddle.net/morgancheng/afX5b/• http://jsfiddle.net/morgancheng/HmsxA/• http://jsfiddle.net/morgancheng/9qgAP/• http://jsfiddle.net/morgancheng/BeV2q/
  7. 7. jQuery doesn’t Scale
  8. 8. Scale!
  9. 9. What is required to be Scalable?
  10. 10. Application LifecycleModule Management DOM, AJAX Utility
  11. 11. Application LifecycleModule Management DOM, AJAX Utility
  12. 12. Module Management
  13. 13. “The secret to building large apps is never build large apps. Break you applications into small pieces. Then, assemble those testable, bite- sized pieces into your big application” — Justin Meyer, author JavaScriptMVC
  14. 14. • Independent• Reusable• Agnostic to others
  15. 15. Event System I know something I want to do something happens. But I don’t when this happens. But Icare how others handle don’t care who trigger it. it
  16. 16. AMD: Asynchronous Module Definition define( ‘module-name’, [‘dependency1’, ‘dependency2’], function(d1, d2) { // export something } );
  17. 17. YUI Module Management YUI.add(‘module-name’, function(Y) { // Change Y to change the world Y.foo = …; }, ‘version’, { requires : [ ‘dependency1’, ‘dependency2’ ]} );
  18. 18. Concatenate Modules
  19. 19. Application Lifecycle
  20. 20. • Bookmark-able• Navigable• SEO Friendly
  21. 21. So Many Choiceshttps://github.com/addyosmani/todomvc
  22. 22. MVC is not the only game in town
  23. 23. App Framework
  24. 24. Choose Gear According to YOUR Needs
  25. 25. Thank YouAny Questions?

×