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
Atom
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Alibaba.com
May 31, 2013
Technology
190
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Atom
Atom is growing up
Alibaba.com
May 31, 2013
More Decks by Alibaba.com
See All by Alibaba.com
jQuery Selector 源码剖析
alibaba
0
180
Backbone.js 初探
alibaba
2
280
Other Decks in Technology
See All in Technology
いちAWSエンジニアのAI活用を振り返る #devio2026 / devio osaka 2026 kawahara
masahirokawahara
2
390
生成AIを使って「人が」考える技術 ― AI時代の人機共想と実践ノウハウ|UNITT AC2026
ishiirikie
0
560
生成AIで高い生産性を求められて、 悩み、乗り越えた話
mot_techtalk
2
130
Claude起点の仕様駆動開発
tanakaseiya
0
400
[2026-09-30]ロックンロールは鳴り止まないっ - 信頼性かまってちゃん - 「データ駆動を投げ捨ててまで。」追いかける信頼性改善に向けた取り組みの話
tosite
0
210
脆弱性診断って、何をしているの? 〜弱点を見つけて、会社の改善につなげるまで〜
keeg
0
180
IR Today: Theory, Practice, and Agents
dtunkelang
0
350
Snapshot Testing in Practice: Predictable and Reliable SwiftUI Views
fespinoza
0
140
実体験から学ぶ分析エージェントの開発と運⽤
recruitengineers
PRO
1
320
LocalStack を使ったサーバーレスアプリケーション開発 / Serverless Development with LocalStack
kakakakakku
0
250
【データ横丁主催】AI Agentがコンテキストを使って仕事をした後、何が残るのか― 組織の経験を次の判断に引き継ぐ「Agent Memory」
shisyu_gaku
2
330
自律型 AI をセキュアに実装!Gemini と MIG で作る動的コード実行環境
recruitengineers
PRO
1
220
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
55
13k
Designing Powerful Visuals for Engaging Learning
tmiket
1
600
The Language of Interfaces
destraynor
162
27k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
740
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
540
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
620
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
76k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
530
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
Become a Pro
speakerdeck
PRO
31
6.3k
Transcript
Atom is Growing Up!
Atom 阶段回顾 连沁 2013-05-31
强调下模块编写/引用的规范
• 模块编写 使用 CMD 模块规范,每个js文件就是一个模块 模块使用 匿名方式 编写 • 模块之间引用
引用 自身的私有模块 ,使用 相对路径 引用 其他的公用模块 ,使用 以htdocs为根目录的绝对路径 禁止引用其他模块的私有模块!!! • html/vm 引用模块 禁止在非js文件中定义模块!!! 引用模块只能使用 seajs.use 接口, 禁止使用script标签同步引入!! 引用模块使用 全路径 ,推荐使用 #stamp 宏包裹,保证时间戳准确
开发中一些常见问题
为什么js里不能使用seajs.use? • 首先,规范 • 在seajs的模式里面,所有的js文件都是 CMD 模块。 • 而在 CMD
模块中,对模块的引用只能通过 require() 及 require.async() 的方式, seajs.use的用法是 不符合规范 的
为什么js里不能使用seajs.use? • 其次,性能 • 正常的使用 `seajs.use` 去加载文件,流程如 下 • ...
| | - 在 html/vm 里写 seajs.use 去请求模 块(js文件) ====异步===> 模块 ====> 运 行 callback | | - 其他html渲染,script运行等 | ... 除了 atom.js 以外所有的js文件都是 异 步加载 的
看看demo与结果
i18n相关 • 设置页面i18n • <script type='text/javascript'> // 页面中越早 调用越好 //
建议在引入 atom.js 之后马上设 置 seajs.setLocale(locale); </script>
i18n相关 • 模块里使用i18n • 使用 {locale} 来代替 i18n 中标识语言的部分 •
使用变量代替在 require 中的位置 (该用法是 为了解决独角兽时间戳失效的问题,独角兽端 的修复在7月份解决) • // 时间戳问题修复前,要这么使用 // #require "i18n/en-us.js" // #require "i18n/zh-cn.js" // #require "i18n/zh-tw.js" var i18nStr = './i18n/{locale}.js'; var i18n = require(i18nStr) || {}; // 时间戳问题解决后(2013-07完成),这 么使用 var i18n = require('./i18n/{locale}.js') || {};
Combo相关 • 页面上可以在任何地方使用seajs.use,最终 请求会在domReady的时候统一 Combo后 发 出 • 可以使用 seajs.flush()
提前发出请求(一般 用于首屏优化) • url过长的时候会自动拆分成多个 • 做完combo后的页面至少有2个串行的js请 求
Q & A