Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
目录结构规范 by遇春
Search
Zheng Biao
August 10, 2012
150
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
目录结构规范 by遇春
Zheng Biao
August 10, 2012
More Decks by Zheng Biao
See All by Zheng Biao
Hello Xcake
maxbbn
1
3.2k
Featured
See All Featured
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
300
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
220
Automating Front-end Workflow
addyosmani
1369
210k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Ethics towards AI in product and experience design
skipperchong
2
430
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
780
How to Ace a Technical Interview
jacobian
280
24k
GraphQLとの向き合い方2022年版
quramy
50
15k
A better future with KSS
kneath
240
18k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Transcript
目录结构
要 outing 了 你不躁动吗?
结构
现状 1. p/markets /2011/common_v2.js?t=20120323 2. apps/tradeface/trademanager/1.0/bas e_v2.2.js?t=20111215.js 3. apps/mytaobao/3.0/mt/base/bas e.js
?t=20120517.js 4. apps/mercury/2.0/20110610/mercury.js?t=201205311045
目录结构承担的责任 1. 让别人理解更容易 (新人,业务调整,临时支援) 2. 让自己维护更方便 (修改,扩展,打包,发布,调试,回滚)
统一结构,势在必行
为什么会出现 1. Ant 2. CDNcombo 3. Ucool 4. I debug
5. Module-compiler 模块化
目录的作用 给文件分类
内容 关联 纵向 横向 分类的维度 1. 按“应用” cart , mytaobao
, sell 2. 按“页面” page1 , page2 , page3 3. 按“版本” 1.0 , 2.0 , 3.0 4. 按“发布日期” 20120323 , 20120423 5. 按“职责” source , test , build , 6. 按“重要程度” core , mods , 7. 按“复用级别” common , utils , mods
目录联想 1.0 1. 这是个按版本划分的目录 2. 同级可能会有 2.0 , 3.0 3.
我应该找最新的版本目录去查看
目录联想 1.0 , Detail , test
结论一 单一维度
内容 关联 纵向 横向 分类的维度 1. 按“应用” cart , mytaobao
, sell 2. 按“页面” page1 , page2 , page3 3. 按“版本” 1.0 , 2.0 , 3.0 4. 按“发布日期” 20120323 , 20120423 5. 按“职责” source , test , build , 6. 按“重要程度” core , mods , 7. 按“复用级别” common , utils , mods
维度的优先级 先按哪个维度?
维度的优先级 内聚性
维度的优先级 ├─src │ ├─detail │ └─list ├─test │ ├─detail │
└─list └─build ├─detail └─list ├─detail │ ├─src │ ├─test │ └─build └─list ├─src ├─test └─build
维度的优先级 ├─src │ ├─1.0 │ └─2.0 ├─test │ ├─1.0 │
└─2.0 └─build ├─1.0 └─2.0 ├─1.0 │ ├─src │ ├─test │ └─build └─2.0 ├─src ├─test └─build
维度的优先级 ├─detail │ ├─1.0 │ └─2.0 ├─list │ ├─1.0 │
└─2.0 └─index ├─1.0 └─2.0 ├─1.0 │ ├─detail │ ├─list │ └─index └─2.0 ├─detail ├─list └─index
结论二 横向 > 纵向 > 关联
横向分类的问题 交集(共用)部分
横向分类的问题 detail list index common utils utils utils
横向分类的问题 detail list index
横向分类的问题 B-detail C-detail index
横向分类的问题 detail list index
横向分类约定 common utils page
一级目录
纵向分类的问题 同步生长
纵向分类 ├─detail │ ├─1.0 │ └─2.0 ├─list │ ├─1.0 │
└─2.0 └─index ├─1.0 └─2.0 ├─1.0 │ ├─detail │ ├─list │ └─index └─2.0 ├─detail ├─list └─index
横向分类与纵向分类的界限 ├─detail │ ├─1.0 │ │ ├─modA │ │ ├─modB
│ │ └─modC │ └─2.0 │ ├─modA │ ├─modB │ └─modC ├─detail │ ├─modA │ │ ├─1.0 │ │ └─2.0 │ ├─modB │ │ ├─1.0 │ │ └─2.0 │ └─modC │ ├─1.0 │ └─2.0
日期目录的缘由 1. 新文件发布,简化系统发布依赖 2. 利于回滚 3. 避免冗余的兼容性代码 4. 消除客户端缓存问题 20120304
纵向分类的约定 1.版本目录: • 存放模块文件的源文件 • 以 1.0, 2.0, 3.0 命名
2.日期目录: • 存放打包后的线上引用文件 • 以“ YYYYMMDD” 命名
目录约定
模块载入机制 1. CDNcombo 2. 本地打包 3. 动态加载
1. kissy1.2 2. Common 里的文件静态载入 3. Utils 里的组件参与本地打包,避免动态载入 4. 每次打包到指定日期目录
5. 每次发布新的日期目录 模块打包约定
模块打包图示
1. 行为:编码,打包,测试; 2. Css 和 Js 的共同抽象 3. 兼容 kiss
y1.1.6 版本下的模块开发目录约定
版本下的模块开发目录约定 1. Core :入口脚本 2. Mods :普通业务模块 3. T es
t :测试用例 4. Build :打包配置信息 5. 打包工具: front-build
结构
3Q