Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
kissy modularization part2
Search
yiminghe
February 21, 2014
Technology
1
1.7k
kissy modularization part2
part2 of kissy modularization tutorials
yiminghe
February 21, 2014
Tweet
Share
More Decks by yiminghe
See All by yiminghe
小程序终端技术架构
yiminghe
0
240
支付宝小程序的开放架构
yiminghe
0
190
gitc2016 react based architecture
yiminghe
1
170
antd at qcon2016
yiminghe
1
230
react-based architecture
yiminghe
2
160
React Ecosystem At Ant Financial
yiminghe
4
2.3k
ant design preview
yiminghe
1
310
react best practice
yiminghe
3
220
react at alipay
yiminghe
43
4.5k
Other Decks in Technology
See All in Technology
Lookerで実現するセキュアな外部データ提供
zozotech
PRO
0
200
MySQLとPostgreSQLのコレーション / Collation of MySQL and PostgreSQL
tmtms
1
1.2k
MariaDB Connector/C のcaching_sha2_passwordプラグインの仕様について
boro1234
0
1k
なぜ あなたはそんなに re:Invent に行くのか?
miu_crescent
PRO
0
210
「図面」から「法則」へ 〜メタ視点で読み解く現代のソフトウェアアーキテクチャ〜
scova0731
0
500
NIKKEI Tech Talk #41: セキュア・バイ・デザインからクラウド管理を考える
sekido
PRO
0
210
AgentCoreとStrandsで社内d払いナレッジボットを作った話
motojimayu
1
960
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
1
400
SQLだけでマイグレーションしたい!
makki_d
0
1.2k
アプリにAIを正しく組み込むための アーキテクチャ── 国産LLMの現実と実践
kohju
0
220
ハッカソンから社内プロダクトへ AIエージェント「ko☆shi」開発で学んだ4つの重要要素
sonoda_mj
6
1.7k
AWSに革命を起こすかもしれない新サービス・アップデートについてのお話
yama3133
0
510
Featured
See All Featured
WCS-LA-2024
lcolladotor
0
390
GraphQLとの向き合い方2022年版
quramy
50
14k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
29
Into the Great Unknown - MozCon
thekraken
40
2.2k
Mind Mapping
helmedeiros
PRO
0
39
Statistics for Hackers
jakevdp
799
230k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.1k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
510
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
1
210
The browser strikes back
jonoalderson
0
120
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
30
Transcript
KISSY Modularization part 2 - optimzation
[email protected]
之前浏览器下的问题 • 首屏闪烁 • 链接数过多
链接数
使用工具进行优化 • grunt-kmc • 合并文件 • 动态 combo
• 合并项目文件
合并文件 • 适合具备明确的入口文件 • Gruntfile.js
modules.js • 描述项目合并后文件外部依赖
index.js • 入口模块以及其依赖的本地模块
应用 • 引入 seed.js modules.js • 配置 combine true •
http://localhost:8111/?concat=1
• 动态 combo
动态 combo • 适合多入口或无入口应用或需要后期动态加载 • Gruntfile.js
Module.js • 包含项目所有的模块的内部依赖与外部依赖
应用 • 引入 seed.js modules.js • 配置 combine true •
http://localhost:8111/?combo=1
• 首屏闪烁
加载 css • 异步加载 css 造成闪烁
加载 css • 使用 importStyle 配置 modules.js 同步 combo 加载
css • 对首屏用到的所有模块调用 importStyle
大规模应用优化 • Gallery/mini 模块? • 打包进项目入口文件 • 动态 combo •
合并 gallery/mini 模块的 modules.js 到项目 modules.js