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
AruchSummit2014 - 去哪儿SPA分享
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
破锣锅
December 22, 2014
Technology
310
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AruchSummit2014 - 去哪儿SPA分享
破锣锅
December 22, 2014
More Decks by 破锣锅
See All by 破锣锅
NodeJS 应用以及线上服务的运维和监控
paulguo
2
440
AruchSummit2014 - 手机QQ的移动化实践之路
paulguo
0
370
AruchSummit2014 -
paulguo
0
260
AruchSummit2014 - The Impact Of A Compact Web
paulguo
0
210
Gulp vs Grunt
paulguo
0
6.3k
HTML5简介及移动端Web开发调试工具
paulguo
7
710
Mobile Web 开发实战
paulguo
3
290
H5 Mobile 开发调试实践
paulguo
7
1.1k
HTML5 Intro For QA
paulguo
1
250
Other Decks in Technology
See All in Technology
DevelopersIO 2026 知識の地図を描く ─ オントロジーとは何か?
ishikawa_satoru
1
1.5k
AI 時代の Azure エンジニアリング ~ 私たちは何を磨き、何を任せるのか ~
chack411
1
600
Getting Started with Google Antigravity
glaforge
0
220
UniFi(ユニファイ)AIカメラの現場活用
ludicmind
1
420
転んだ話が背中を預ける理由になる / A_story_about_falling_down_gives_you_a_reason_to_watch_each_other_s_backs.pdf
pauli
3
360
OSC2026on_the-world-is-waiting-for-your-voice.pdf
naruoga
0
370
無理せず続ける、子育てエンジニアの学び
codmoninc
PRO
0
710
LocalStack を使ったサーバーレスアプリケーション開発 / Serverless Development with LocalStack
kakakakakku
1
410
アウトプット初心者、半年間のふりかえり
4o1sobblue
0
140
自分で立ててみるLLMサービス
y_sera15
0
160
自主式軟體工廠
philipz
0
260
Benchmarking Disaggregated Serving on vLLM + Dynamo with a Real Coding-Agent Workload
nttcom
0
110
Featured
See All Featured
The agentic SEO stack - context over prompts
schlessera
0
970
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
800
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
560
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
A designer walks into a library…
pauljervisheath
211
25k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
450
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
620
Transcript
去哪⼉儿SPA分享 蔡欢 Qunar
NativeApp NativeApp的局限 ✓ 分平台开发维护,成本⾼高 ✓ 部署成本⾼高
3 WebApp解决⽅方案选型 ✓ 传统page2page ✓ pjax(pushState Ajax) ✓ SPA(SinglePageApplication)
SPA的优势: ✓ 实施部署、跨平台 ✓ 前端模板渲染,前后端完全分离,数据量 最⼩小 ✓ 视图切换和url路由 ✓ 最贴近于Native应⽤用的交互体验
SPA Native App Desktop App REST APIs Middleware Lib(s) Data
Store(s) HTML 数据 数据 数据
6 设计思路 ✓ 模块化开发 ✓ 视图切换、URL路由 ✓ 模板前端渲染 ✓ 响应式
✓ 浏览器及App内做功能扩充和体验差异 ✓ 开发环境及构建⼯工具
core jQuery underscore requirejs jQuery UI Backbone.js Require-text Gruntjs Compo
nents 本地化 组件化 模块化 ⾃自动化 ⼀一体化 ⻚页⾯面化 livereload jshint autoprefixer uglify cssmin htmlmin less urlrewrite imagemin imageembed mocha r.js Web App Module s … jquery.ui.qunar.citypicker jquery.ui.qunar.datepicker jquery.ui.qunar.message jquery.ui.qunar.dialog background $.addPressClass $.location utils $.cookie $.spin flight common hotel user webserver
模块化开发-Requirejs ✓ 编译时资源打包 ✓ 实现同步、异步加载⾃自由切换 ✓ js依赖处理 ✓ 代码的拆分及复⽤用、按需加载
9 example
视图切换、URL路由 ✓ Quickling技术切换视图 ✓ ⼆二次开发backbonejs的路由完成url hash 对querystring 参数的⽀支持 ✓ ⽀支持视图定位,url分享,⽀支持浏览器前
进后退、⻚页⾯面刷新等
11 example ✓ http://pad.qunar.com/ ✓ http://pad.qunar.com/#hotel ✓ http://pad.qunar.com/#hotel/list/city=%E5%8C%97%E4%BA %AC&cityUrl=beijing_city&keyword=&fromDate=2014-12-18&t oDate=2014-12-19&sortType=&orderBy=&location=
模板前端渲染-underscore ✓ 单⻚页的渲染都在前端完成,需要⼀一套简单⾼高 效的前端模版 ✓ 使⽤用underscore的template,简洁、⾼高效 ✓ 采⽤用inline compress,将模版⽂文件编译成单 个模块化的js⽂文件
✓ 模块可以和其他静态资源⼀一起做CDN部署
响应式设计-iconfont ✓ iconfont⽮矢量字体处理icon ✓ CSS控制图形外观 ✓ 兼容移动设备屏幕不同devicePixelRatio 展⽰示差异
14 example
开发构建环境-gruntjs ✓ 构建⼯工具,同时提供⼀一套⽅方便的开发环境 ✓ 插件式易于扩展,丰富的第三⽅方插件 ✓ ⾃自⼰己开发插件
less&autoprefixer&cssmin&uglify等 ✓ Less将CSS赋予了动态语⾔言特性 ✓ CSS预编译,⾃自动补全浏览器⼚厂商前缀 ✓ ⾃自动内联图标⽂文件到CSS⽂文件中,减少 HTTP请求
实现插件完成数据mock 输⼊入⺴⽹网址 匹配URL connect Require本地⽂文件 代理到其他地址 不代理
18 ✓ 对浏览器及App内WebView做体验差异化 ✓ 当运⾏行在App内WebView时候,通过 Native组件对WebApp做能⼒力扩充。
19 问题 ✓ 针对搜索引擎的SEO ✓ http://pad.qunar.com/#hotel/list/city=%E5%8C%97%E4%BA %AC&cityUrl=beijing_city&keyword=&fromDate=2014-12-18&toDat e=2014-12-19&sortType=&orderBy=&location= ✓ http://pad.qunar.com/#!hotel/list/city=%E5%8C%97%E4%BA
%AC&cityUrl=beijing_city&keyword=&fromDate=2014-12-18&toDat e=2014-12-19&sortType=&orderBy=&location=
20 问题 ✓ 复杂的交互体验仍然有性能瓶颈 ✓ 设备差异导致体验很难⼀一致
谢谢