SlideShare una empresa de Scribd logo
1 de 23
Lithe.js and Module Development
About me

Weibo:
http://weibo.com/designsor
Github:
https://github.com/xiaojue
Twitter:
https://twitter.com/xiao_jue
Blog:
http://www.tuer.me/user/profile/designsor
Email:
fuqiang3@staff.sina.com.cn
Module Development ?
•
•
•
•
•
•

What's it?
Why use it?
Advantages.
Drawbacks.
Existing standards.
Evolutionary history.
Module in javascript.
• Reuse and abstraction.
• Include.
• Management.
•
•
•
•

Dojo,Yui (loader class).
Commonjs.
Modules/AsynchronousDefinition.
Modules/Wrappings
Code part
https://gist.github.com/xiaojue/6972631 (some loader solutions)
http://wiki.commonjs.org/wiki/Modules/1.1.1
http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition
http://wiki.commonjs.org/wiki/Modules/Wrappings
Lithe.js ?
• What's it?
• Origin.
• Version.
Lithe
• A browser-side script loader,compatible
with the de facto
standards(NodeJS/CommonJS). It's very
simple and small,only 2.7kb gzipped.
• https://github.com/xiaojue/lithe
http://wiki.commonjs.org/wiki/Implementati
ons/lithe
Origin

https://gist.github.com/xiaojue/6972903 (bad amdjs)
https://github.com/spmjs/spm/wiki/_pages (why not seajs & spm)
Versions
User Guide
•
•
•
•
•

How to run it.
Standard.
Configuration.
Debugging.
Deploy.

• Technique nodus
Code Part
<script src="lithe.js"
data-config="config.js"
data-path="http://domain.com/"
data-debug="true"
data-main="app.js">
</script>
• So easy!!
Code Part
•
•
•
•

Define
Require
Use
Config
Node api

• https://github.com/xiaojue/lithe/blob/master/README.md
Code Part
•

(function(global,undef){

•

var isBrowser = !! (typeof window !== undef && global.navigator &&
global.document);

•

var debug = isBrowser ? (/debug/).test(location.search) : null;

•

var mod = {

•

alias:{},

•

basepath: debug ? 'path/src/' : 'path/dist'
– };
– If (global.define && isBrowser) {
• define('config',function(){
• return mod;
• });
– }else{
• module.exports = mod;
– }

•

})(this);
How to deploy?
https://github.com/xiaojue/grunt-lithe (use gruntjs)
https://github.com/xiaojue/lithe/blob/master/example.js
node native)
Lithe.tool
Lithe.hfs
FindJsAllrequires
ConcatFile
UglifyJs
Walk
… ….

(use
Technique nodus
• 1.Multi-module in one file.
• 2.Circular dependencies.
• https://github.com/xiaojue/lithe/blob/master/src/module.js

• 3.Online debuging.
•

Source map? Debug config?
Future
• 1.plugns.
• 2.combine url support.
• … ...
Practice
• Sina blog for mobile version (iphone and ipad).
• Voluminous Weibo (Beta).
• Some others.
Mobile Blog

http://liangdong.sinaapp.com/share/my/mobileblog/mobileblog.html#/4
Voluminous weibo
UML
UML
http://www.slideshare.net/xiaojueqq12345/lithe
Lithe

Más contenido relacionado

Similar a Lithe

Ready? Bootstrap! Go! (CFUG Belgium 24 04-2012)
Ready? Bootstrap! Go! (CFUG Belgium 24 04-2012)Ready? Bootstrap! Go! (CFUG Belgium 24 04-2012)
Ready? Bootstrap! Go! (CFUG Belgium 24 04-2012)Guust Nieuwenhuis
 
海纳百川,有容乃大
海纳百川,有容乃大海纳百川,有容乃大
海纳百川,有容乃大hujinpu
 
Intoduction to React
Intoduction to ReactIntoduction to React
Intoduction to ReactRubizza
 
Blogs 101 and Websites for Free
Blogs 101 and Websites for Free Blogs 101 and Websites for Free
Blogs 101 and Websites for Free cat509
 
Laug Mootools And Common Js
Laug   Mootools And Common JsLaug   Mootools And Common Js
Laug Mootools And Common JsSkills Matter
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - IntroductionSagar Acharya
 
Up and Running Quickly with Vue.js
Up and Running Quickly with Vue.jsUp and Running Quickly with Vue.js
Up and Running Quickly with Vue.jsBurton Smith
 
Enterprise 2.0 using Social Frameworks like Agorava (SMWHH 2014)
Enterprise 2.0 using Social Frameworks like Agorava (SMWHH 2014)Enterprise 2.0 using Social Frameworks like Agorava (SMWHH 2014)
Enterprise 2.0 using Social Frameworks like Agorava (SMWHH 2014)Werner Keil
 
Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5Derek Jacoby
 
淺談 Startup 公司的軟體開發流程 v2
淺談 Startup 公司的軟體開發流程 v2淺談 Startup 公司的軟體開發流程 v2
淺談 Startup 公司的軟體開發流程 v2Wen-Tien Chang
 
Agile startup company management and operation
Agile startup company management and operationAgile startup company management and operation
Agile startup company management and operationJiang Zhu
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to conceptsAbhishek Sur
 
Backbone/Marionette recap [2015]
Backbone/Marionette recap [2015]Backbone/Marionette recap [2015]
Backbone/Marionette recap [2015]Andrii Lundiak
 
Enterprise 2.0 using Social Frameworks like Agorava (SMWCPH 2014)
Enterprise 2.0 using Social Frameworks like Agorava (SMWCPH 2014)Enterprise 2.0 using Social Frameworks like Agorava (SMWCPH 2014)
Enterprise 2.0 using Social Frameworks like Agorava (SMWCPH 2014)Werner Keil
 
Introduction to Twitter's Bootstrap 2
Introduction to Twitter's Bootstrap 2Introduction to Twitter's Bootstrap 2
Introduction to Twitter's Bootstrap 2Julien Renaux
 
Adopt A JSR - MoroccoJUG
Adopt A JSR - MoroccoJUGAdopt A JSR - MoroccoJUG
Adopt A JSR - MoroccoJUGMorocco JUG
 
full stqack guktgktktykytkyyyjrneyrynye5n
full stqack guktgktktykytkyyyjrneyrynye5nfull stqack guktgktktykytkyyyjrneyrynye5n
full stqack guktgktktykytkyyyjrneyrynye5nGoogleDSCDibrugarhUn
 

Similar a Lithe (20)

Ready? Bootstrap! Go! (CFUG Belgium 24 04-2012)
Ready? Bootstrap! Go! (CFUG Belgium 24 04-2012)Ready? Bootstrap! Go! (CFUG Belgium 24 04-2012)
Ready? Bootstrap! Go! (CFUG Belgium 24 04-2012)
 
海纳百川,有容乃大
海纳百川,有容乃大海纳百川,有容乃大
海纳百川,有容乃大
 
Intoduction to React
Intoduction to ReactIntoduction to React
Intoduction to React
 
Blogs 101 and Websites for Free
Blogs 101 and Websites for Free Blogs 101 and Websites for Free
Blogs 101 and Websites for Free
 
Laug Mootools And Common Js
Laug   Mootools And Common JsLaug   Mootools And Common Js
Laug Mootools And Common Js
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
Up and Running Quickly with Vue.js
Up and Running Quickly with Vue.jsUp and Running Quickly with Vue.js
Up and Running Quickly with Vue.js
 
Enterprise 2.0 using Social Frameworks like Agorava (SMWHH 2014)
Enterprise 2.0 using Social Frameworks like Agorava (SMWHH 2014)Enterprise 2.0 using Social Frameworks like Agorava (SMWHH 2014)
Enterprise 2.0 using Social Frameworks like Agorava (SMWHH 2014)
 
Protractor survival guide
Protractor survival guideProtractor survival guide
Protractor survival guide
 
Untangling spring week5
Untangling spring week5Untangling spring week5
Untangling spring week5
 
淺談 Startup 公司的軟體開發流程 v2
淺談 Startup 公司的軟體開發流程 v2淺談 Startup 公司的軟體開發流程 v2
淺談 Startup 公司的軟體開發流程 v2
 
Agile startup company management and operation
Agile startup company management and operationAgile startup company management and operation
Agile startup company management and operation
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to concepts
 
Backbone/Marionette recap [2015]
Backbone/Marionette recap [2015]Backbone/Marionette recap [2015]
Backbone/Marionette recap [2015]
 
Backbone 4.0
Backbone 4.0Backbone 4.0
Backbone 4.0
 
Enterprise 2.0 using Social Frameworks like Agorava (SMWCPH 2014)
Enterprise 2.0 using Social Frameworks like Agorava (SMWCPH 2014)Enterprise 2.0 using Social Frameworks like Agorava (SMWCPH 2014)
Enterprise 2.0 using Social Frameworks like Agorava (SMWCPH 2014)
 
Introduction to Twitter's Bootstrap 2
Introduction to Twitter's Bootstrap 2Introduction to Twitter's Bootstrap 2
Introduction to Twitter's Bootstrap 2
 
Adopt A JSR - MoroccoJUG
Adopt A JSR - MoroccoJUGAdopt A JSR - MoroccoJUG
Adopt A JSR - MoroccoJUG
 
full stqack guktgktktykytkyyyjrneyrynye5n
full stqack guktgktktykytkyyyjrneyrynye5nfull stqack guktgktktykytkyyyjrneyrynye5n
full stqack guktgktktykytkyyyjrneyrynye5n
 
Java User Group Cologne
Java User Group CologneJava User Group Cologne
Java User Group Cologne
 

Más de xiaojueqq12345

Fds-给前端用的服务器
Fds-给前端用的服务器Fds-给前端用的服务器
Fds-给前端用的服务器xiaojueqq12345
 
Web program-peformance-optimization
Web program-peformance-optimizationWeb program-peformance-optimization
Web program-peformance-optimizationxiaojueqq12345
 
淘宝帮派活动项目总结
淘宝帮派活动项目总结淘宝帮派活动项目总结
淘宝帮派活动项目总结xiaojueqq12345
 

Más de xiaojueqq12345 (7)

前端模块化开发
前端模块化开发前端模块化开发
前端模块化开发
 
Fds-给前端用的服务器
Fds-给前端用的服务器Fds-给前端用的服务器
Fds-给前端用的服务器
 
Voluminous_Weibo
Voluminous_WeiboVoluminous_Weibo
Voluminous_Weibo
 
nodejs开发web站点
nodejs开发web站点nodejs开发web站点
nodejs开发web站点
 
Web program-peformance-optimization
Web program-peformance-optimizationWeb program-peformance-optimization
Web program-peformance-optimization
 
Mxhr
MxhrMxhr
Mxhr
 
淘宝帮派活动项目总结
淘宝帮派活动项目总结淘宝帮派活动项目总结
淘宝帮派活动项目总结
 

Último

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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
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
 
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
 
[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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
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
 
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
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Último (20)

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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
[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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - 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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Lithe

Notas del editor

  1. {}