xydudu / honey Goto Github PK
View Code? Open in Web Editor NEWa javascript loader with some useful modules, loader baseed headjs(headjs.com)
Home Page: http://www.xydudu.com/honey
a javascript loader with some useful modules, loader baseed headjs(headjs.com)
Home Page: http://www.xydudu.com/honey
honey.go('a, b, c', fn1)
honey.go('b, d, c', fn2)
以上代码只会执行 fn1,fn2不能成功触发。
页面中需要引入
honey.source.js + config.js = honey.js
config.js 中定义各项目的模块路径,以及一个公共的模块路径
root = '';
pubroot = '';
公共的模块放在 pub 路径下,项目专用模块则放在相应的路径下。
honey.js + compressed combo script
像 comment,photoview 这样的控件,由模板,CSS,以及javascript构成,像 photoview 还需要针对各种不同情况扩展一些方法,比如: mod_photoview, mod_photoview2。
这么多的关联文件如果散落在各个文件夹,控件多后,必然会造成文件难找,每引入一个控件,都需要在页面中引入一大堆的依赖。
由此,我想将这些控件以 package 的形式发布,在honey.go中只需要标记出为 package,就自然的把相应该的控件包引入进来,就不需要手动的引入过多的依赖
比如 comment 有 widget:comment, tpl:comment 还有 comment.css comment.ie.css 这四个文件,可能可以打包到 directive 文件夹,页面中只需要
honey.go(directive:comment)
就自动的引入包内所有文件就好。比之现在的
honey.go(widget:comment, tpl:comment) //css 在 widget:comment 内引入
当然要方便得多。
所以 honey 应该识别一下,如果是 directive 就要引入包文件,此时包文件夹内应该有一个类似 package.json 的文件来组织这些依赖。
比如
honey.go('a, b, c', function() {
})
b 中
honey.def('d', function() {
})
当b模块所依赖的d模块没有在honey.go中引入时,会导致honey.go上注册的函数调用两次
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.