SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
JS Library and Tangram
      Introduction
          liyubei@baidu.com
                  2011-08-25
Outline

● Why we need JavaScript Library
● Comparison of JavaScript libraries
● Tangram history
● Tangram architecture
● Tangram development
   ○ demo
● Advance usage
   ○ demo
Why we need JavaScript Library

What's the issue it want to resolve?
Why we need JavaScript Library

What's the issue it want to resolve?

 1. language enhancement
      ○ klass/function
      ○ array
      ○ string
      ○ object
      ○ ...
Why we need JavaScript Library

What's the issue it want to resolve?

 1. language enhancement
 2. fix browser compatibility
      ○ DOM
      ○ Event
      ○ CSS
      ○ Network
      ○ Storage
      ○ ...
Comparison of JavaScript libraries

Why there are some many libraries (20+)?
http://en.wikipedia.
org/wiki/Comparison_of_JavaScript_frameworks
Comparison of JavaScript libraries

jQuery
jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling,
animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that
you write JavaScript.

YUI
The YUI Library is a set of utilities and controls, written with JavaScript and CSS, for building richly
interactive web applications using techniques such as DOM scripting, DHTML and AJAX.

Prototype
Prototype is a JavaScript Framework that aims to ease development of dynamic web applications.

Ext
Ext JS is a JavaScript library for building interactive web applications using techniques such as Ajax,
DHTML and DOM scripting.

Dojo
Dojo saves you time, delivers powerful performance, and scales with your development process. It’s the
toolkit experienced developers turn to for building superior desktop and mobile web experiences.
Comparison of JavaScript libraries

Why there are some many libraries?
http://en.wikipedia.
org/wiki/Comparison_of_JavaScript_frameworks

What is the difference between them, what the similarities?
Comparison of JavaScript libraries (cont)

Why we need our javascript library?
Comparison of JavaScript libraries (cont)

Why we need our javascript library?

The official statement
 1. 不方便修改,扩展核心
 2. 体积庞大
 3. 执行效率
 4. 不够协作开发
Comparison of JavaScript libraries (cont)

Why we need our javascript library?

The official statement
 1. 不方便修改,扩展核心
 2. 体积庞大
 3. 执行效率
 4. 不够协作开发

My point
 1. 可维护性(代码和团队)
 2. 稳定的API(不能因为升级导致一大批产品不可用)
 3. 精炼,没有过多冗余的代码
Comparison of JavaScript libraries (cont)

So, how about Google?

Micbael Bolin said in "Closure The Definitive Guide"

    1. JavaScript + HTML/CSS/DOM
    2. Collaborative development
    3. Managing complexity
    4. Modularization and conventions
    5. Testing and stability
Tangram history

1. jslib (prototype) (http://cang.baidu.com)
2. jsframework (http://frd.baidu.com)
3. Fl (http://tieba.baidu.com/test/rili)
4. Al (http://fe.baidu.com/doc)
5. Fe.JS (tieba, map)
6. Tangram (most of the product)
Tangram architecture
Tangram base

 1. ajax/                     1. fn/
 2. dom                       2. lang/
 3. element/                  3. object/
 4. cookie/                   4. platform/
 5. event/                    5. string/
 6. page/                     6. url/
 7. swf/                      7. async/
 8. array/                    8. json/
 9. browser/                  9. number/
10. date/                    10. sio/

Q:Why use 'x241' instead of '$1'?
Tangram base (cont)

T.e('#header').
  children().
  on('click', function(){
     alert('clicked');
  });
Tangram component

var CustomControl =
  baidu.ui.createUI(function(options){
     this.text = options.text || 'default text';
  }).extend({
     getContent : function() {
        return this.text;
     }
  })

var CustomControl = Class.create({
   initialize : function() {
   }
});
Tangram component (cont)

I need a simple dialog.
You need a simple dialog with mask.

how to meet this two requirement?
Tangram component (cont)

I need a simple dialog.
You need a simple dialog with mask.

how to meet this two requirement?

            behavior and addons.
Tangram component (cont)

behavior and addons.

I
///import baidu.ui.Dialog;

You
///import baidu.ui.Dialog;
///import baidu.ui.Dialog.Dialog$coverable;
Tangram component (cont)

baidu.ui.Base is an object, not an constructor.
Tangram development

1. checkout the code from github.com
2. hacking and testing
3. fix code style
4. launch code-review
5. commit to github.com
6. launch pull request
7. DEMO
Advance usage

1. code-search
2. Ftangram
    ○ best practice

Weitere ähnliche Inhalte

Was ist angesagt?

Typescript - MentorMate Academy
Typescript - MentorMate AcademyTypescript - MentorMate Academy
Typescript - MentorMate AcademyDimitar Danailov
 
Introduction to webGL
Introduction to webGLIntroduction to webGL
Introduction to webGL志鴻 詹
 
Introduction to REST API with Node.js
Introduction to REST API with Node.jsIntroduction to REST API with Node.js
Introduction to REST API with Node.jsYoann Gotthilf
 
Daniel Steigerwald - Este.js - konec velkého Schizma
Daniel Steigerwald - Este.js - konec velkého SchizmaDaniel Steigerwald - Este.js - konec velkého Schizma
Daniel Steigerwald - Este.js - konec velkého SchizmaDevelcz
 
Brig:Node.js + QML 華麗大冒險
Brig:Node.js + QML 華麗大冒險Brig:Node.js + QML 華麗大冒險
Brig:Node.js + QML 華麗大冒險Fred Chien
 
Dot Net Training in Chennai
Dot Net Training in ChennaiDot Net Training in Chennai
Dot Net Training in Chennaijeevanfita
 
Let s Enjoy Node.js
Let s Enjoy Node.jsLet s Enjoy Node.js
Let s Enjoy Node.jsFred Chien
 
Getting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.jsGetting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.jsGrant Goodale
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkAlive Kuo
 
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)Hyun-woo Park
 
GTUG JS will save us all
GTUG JS will save us allGTUG JS will save us all
GTUG JS will save us allMário Valente
 
Mean Stack for Beginners
Mean Stack for BeginnersMean Stack for Beginners
Mean Stack for BeginnersJEMLI Fathi
 
Mocha, chai and sinon
Mocha, chai and sinonMocha, chai and sinon
Mocha, chai and sinonAndrew Dixon
 
Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7Devang Garach
 
HOW TO EXTEND WEBPACK WITH YOUR OWN PLUGINS
HOW TO EXTEND WEBPACK WITH YOUR OWN PLUGINSHOW TO EXTEND WEBPACK WITH YOUR OWN PLUGINS
HOW TO EXTEND WEBPACK WITH YOUR OWN PLUGINSDevClub_lv
 

Was ist angesagt? (20)

Future of NodeJS
Future of NodeJSFuture of NodeJS
Future of NodeJS
 
Groovy & Grails
Groovy & GrailsGroovy & Grails
Groovy & Grails
 
Typescript - MentorMate Academy
Typescript - MentorMate AcademyTypescript - MentorMate Academy
Typescript - MentorMate Academy
 
Introduction to webGL
Introduction to webGLIntroduction to webGL
Introduction to webGL
 
Introduction to REST API with Node.js
Introduction to REST API with Node.jsIntroduction to REST API with Node.js
Introduction to REST API with Node.js
 
Daniel Steigerwald - Este.js - konec velkého Schizma
Daniel Steigerwald - Este.js - konec velkého SchizmaDaniel Steigerwald - Este.js - konec velkého Schizma
Daniel Steigerwald - Este.js - konec velkého Schizma
 
Brig:Node.js + QML 華麗大冒險
Brig:Node.js + QML 華麗大冒險Brig:Node.js + QML 華麗大冒險
Brig:Node.js + QML 華麗大冒險
 
(C)NodeJS
(C)NodeJS(C)NodeJS
(C)NodeJS
 
Dot Net Training in Chennai
Dot Net Training in ChennaiDot Net Training in Chennai
Dot Net Training in Chennai
 
Let s Enjoy Node.js
Let s Enjoy Node.jsLet s Enjoy Node.js
Let s Enjoy Node.js
 
Getting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.jsGetting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.js
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web framework
 
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)
WHAT / WHY / HOW WE’RE ENGINEERING AT SMARTSTUDY (English)
 
GTUG JS will save us all
GTUG JS will save us allGTUG JS will save us all
GTUG JS will save us all
 
Mean Stack for Beginners
Mean Stack for BeginnersMean Stack for Beginners
Mean Stack for Beginners
 
Nodejs presentation
Nodejs presentationNodejs presentation
Nodejs presentation
 
Mocha, chai and sinon
Mocha, chai and sinonMocha, chai and sinon
Mocha, chai and sinon
 
Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7
 
HOW TO EXTEND WEBPACK WITH YOUR OWN PLUGINS
HOW TO EXTEND WEBPACK WITH YOUR OWN PLUGINSHOW TO EXTEND WEBPACK WITH YOUR OWN PLUGINS
HOW TO EXTEND WEBPACK WITH YOUR OWN PLUGINS
 
The Rust Programming Language
The Rust Programming LanguageThe Rust Programming Language
The Rust Programming Language
 

Ähnlich wie JS Library and Tangram: A Deep Dive

Ajax with DWR
Ajax with DWRAjax with DWR
Ajax with DWRgouthamrv
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang YoonJesang Yoon
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application developmentzonathen
 
Technology Stack Discussion
Technology Stack DiscussionTechnology Stack Discussion
Technology Stack DiscussionZaiyang Li
 
High Performance Ajax Applications 1197671494632682 2
High Performance Ajax Applications 1197671494632682 2High Performance Ajax Applications 1197671494632682 2
High Performance Ajax Applications 1197671494632682 2Niti Chotkaew
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax ApplicationsJulien Lecomte
 
Google Dev Day2007
Google Dev Day2007Google Dev Day2007
Google Dev Day2007lucclaes
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaAgile Testing Alliance
 
jQuery Tips Tricks Trivia
jQuery Tips Tricks TriviajQuery Tips Tricks Trivia
jQuery Tips Tricks TriviaCognizant
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologiesgeorge.james
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13Fred Sauer
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
Rails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSRails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSTimo Herttua
 
Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Marco Breveglieri
 
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17GreeceJS
 
Front-end optimisation & jQuery Internals
Front-end optimisation & jQuery InternalsFront-end optimisation & jQuery Internals
Front-end optimisation & jQuery InternalsArtur Cistov
 
Java Script - A New Look
Java Script - A New LookJava Script - A New Look
Java Script - A New Lookrumsan
 
JavaScript Library Overview (Ajax Exp West 2007)
JavaScript Library Overview (Ajax Exp West 2007)JavaScript Library Overview (Ajax Exp West 2007)
JavaScript Library Overview (Ajax Exp West 2007)jeresig
 

Ähnlich wie JS Library and Tangram: A Deep Dive (20)

Ajax with DWR
Ajax with DWRAjax with DWR
Ajax with DWR
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoon
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 
dJango
dJangodJango
dJango
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 
Technology Stack Discussion
Technology Stack DiscussionTechnology Stack Discussion
Technology Stack Discussion
 
High Performance Ajax Applications 1197671494632682 2
High Performance Ajax Applications 1197671494632682 2High Performance Ajax Applications 1197671494632682 2
High Performance Ajax Applications 1197671494632682 2
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
Google Dev Day2007
Google Dev Day2007Google Dev Day2007
Google Dev Day2007
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh Gundecha
 
jQuery Tips Tricks Trivia
jQuery Tips Tricks TriviajQuery Tips Tricks Trivia
jQuery Tips Tricks Trivia
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Rails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSRails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSS
 
Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016
 
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
 
Front-end optimisation & jQuery Internals
Front-end optimisation & jQuery InternalsFront-end optimisation & jQuery Internals
Front-end optimisation & jQuery Internals
 
Java Script - A New Look
Java Script - A New LookJava Script - A New Look
Java Script - A New Look
 
JavaScript Library Overview (Ajax Exp West 2007)
JavaScript Library Overview (Ajax Exp West 2007)JavaScript Library Overview (Ajax Exp West 2007)
JavaScript Library Overview (Ajax Exp West 2007)
 

Kürzlich hochgeladen

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 

Kürzlich hochgeladen (20)

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 

JS Library and Tangram: A Deep Dive

  • 1. JS Library and Tangram Introduction liyubei@baidu.com 2011-08-25
  • 2. Outline ● Why we need JavaScript Library ● Comparison of JavaScript libraries ● Tangram history ● Tangram architecture ● Tangram development ○ demo ● Advance usage ○ demo
  • 3. Why we need JavaScript Library What's the issue it want to resolve?
  • 4. Why we need JavaScript Library What's the issue it want to resolve? 1. language enhancement ○ klass/function ○ array ○ string ○ object ○ ...
  • 5. Why we need JavaScript Library What's the issue it want to resolve? 1. language enhancement 2. fix browser compatibility ○ DOM ○ Event ○ CSS ○ Network ○ Storage ○ ...
  • 6. Comparison of JavaScript libraries Why there are some many libraries (20+)? http://en.wikipedia. org/wiki/Comparison_of_JavaScript_frameworks
  • 7. Comparison of JavaScript libraries jQuery jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. YUI The YUI Library is a set of utilities and controls, written with JavaScript and CSS, for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX. Prototype Prototype is a JavaScript Framework that aims to ease development of dynamic web applications. Ext Ext JS is a JavaScript library for building interactive web applications using techniques such as Ajax, DHTML and DOM scripting. Dojo Dojo saves you time, delivers powerful performance, and scales with your development process. It’s the toolkit experienced developers turn to for building superior desktop and mobile web experiences.
  • 8. Comparison of JavaScript libraries Why there are some many libraries? http://en.wikipedia. org/wiki/Comparison_of_JavaScript_frameworks What is the difference between them, what the similarities?
  • 9. Comparison of JavaScript libraries (cont) Why we need our javascript library?
  • 10. Comparison of JavaScript libraries (cont) Why we need our javascript library? The official statement 1. 不方便修改,扩展核心 2. 体积庞大 3. 执行效率 4. 不够协作开发
  • 11. Comparison of JavaScript libraries (cont) Why we need our javascript library? The official statement 1. 不方便修改,扩展核心 2. 体积庞大 3. 执行效率 4. 不够协作开发 My point 1. 可维护性(代码和团队) 2. 稳定的API(不能因为升级导致一大批产品不可用) 3. 精炼,没有过多冗余的代码
  • 12. Comparison of JavaScript libraries (cont) So, how about Google? Micbael Bolin said in "Closure The Definitive Guide" 1. JavaScript + HTML/CSS/DOM 2. Collaborative development 3. Managing complexity 4. Modularization and conventions 5. Testing and stability
  • 13. Tangram history 1. jslib (prototype) (http://cang.baidu.com) 2. jsframework (http://frd.baidu.com) 3. Fl (http://tieba.baidu.com/test/rili) 4. Al (http://fe.baidu.com/doc) 5. Fe.JS (tieba, map) 6. Tangram (most of the product)
  • 15. Tangram base 1. ajax/ 1. fn/ 2. dom 2. lang/ 3. element/ 3. object/ 4. cookie/ 4. platform/ 5. event/ 5. string/ 6. page/ 6. url/ 7. swf/ 7. async/ 8. array/ 8. json/ 9. browser/ 9. number/ 10. date/ 10. sio/ Q:Why use 'x241' instead of '$1'?
  • 16. Tangram base (cont) T.e('#header'). children(). on('click', function(){ alert('clicked'); });
  • 17. Tangram component var CustomControl = baidu.ui.createUI(function(options){ this.text = options.text || 'default text'; }).extend({ getContent : function() { return this.text; } }) var CustomControl = Class.create({ initialize : function() { } });
  • 18. Tangram component (cont) I need a simple dialog. You need a simple dialog with mask. how to meet this two requirement?
  • 19. Tangram component (cont) I need a simple dialog. You need a simple dialog with mask. how to meet this two requirement? behavior and addons.
  • 20. Tangram component (cont) behavior and addons. I ///import baidu.ui.Dialog; You ///import baidu.ui.Dialog; ///import baidu.ui.Dialog.Dialog$coverable;
  • 21. Tangram component (cont) baidu.ui.Base is an object, not an constructor.
  • 22. Tangram development 1. checkout the code from github.com 2. hacking and testing 3. fix code style 4. launch code-review 5. commit to github.com 6. launch pull request 7. DEMO
  • 23. Advance usage 1. code-search 2. Ftangram ○ best practice