Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
react best practice
Search
yiminghe
May 14, 2015
Technology
240
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
react best practice
react best practice
yiminghe
May 14, 2015
More Decks by yiminghe
See All by yiminghe
小程序终端技术架构
yiminghe
0
300
支付宝小程序的开放架构
yiminghe
0
240
gitc2016 react based architecture
yiminghe
1
190
antd at qcon2016
yiminghe
1
250
react-based architecture
yiminghe
2
190
React Ecosystem At Ant Financial
yiminghe
4
2.3k
ant design preview
yiminghe
1
350
react at alipay
yiminghe
43
4.6k
form validation in react
yiminghe
4
580
Other Decks in Technology
See All in Technology
Guerilla InnerSource in enterprises, during the AI hype
onenashev
PRO
0
150
データエンジニアの困りごとをDevinと一緒に解消する
10xinc
2
790
Does an AI Watermark Survive Translation?
machinetranslation
0
520
APIセキュリティを組織で実現するには~注力する点と設計・実装に入れたい対策~
riiimparm
3
930
Benchmarking Vector Databases: pgvector vs. LanceDB
tsho
0
140
Driving AI Adoption Using In-House GPUs to Serve Qwen
po3rin
2
430
Azure App Service / Container Apps の組み込み認証
kuniteru
0
190
【Oracle AI Spotlight ウェビナー】AWSか、Azureか、Google Cloudか。その議論にオラクルを含める意義。
oracle4engineer
PRO
2
220
20260906 「AWS運用入門」著者が教える、運用業務への生成AI活用入門
masaruogura
0
220
プロダクト思考 × 基盤思考を AIで実現する Compound Engineering
tkc66buzz
1
240
Kiro Crewしか勝たん!?
miu_crescent
PRO
0
170
GuardDuty 検知対応を DevOps Agent で効率化しようとしている話 / GuardDuty Investigations with DevOps Agent
masahirokawahara
1
280
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Site-Speed That Sticks
csswizardry
13
1.5k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Practical Orchestrator
shlominoach
191
12k
Designing Experiences People Love
moore
143
24k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
How to make the Groovebox
asonas
2
2.4k
Fireside Chat
paigeccino
42
4k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
490
Are puppies a ranking factor?
jonoalderson
2
3.9k
Transcript
react best prac*ce
[email protected]
承玉
Outline • Technology stack – react/koa/webpack/npm • Prac*ce
• Summary
• Technology stack
react • react: library for build user interface
react • render
react • diff
React-‐components • Components based on react • hDps://github.com/react-‐component
react-‐component
koa • Koa: next genera*on web framework for node.js
chain
chair • 基于 koa,整合支付宝基础服务 – Session – Hsf(Tr) – Drm
– Tair – Ls
chair • Router • logger • Proxy (generate
from jar)
webpack • hDp://webpack.github.io/ • Module bundler
npm • Package manager for javascript (react,jquery,angular…)
tnpm • 集团内部源,支持私有包
• prac*ce
tnpm • package.json:
commonjs • commonjs for browser and server
react • Components Composi*on
Custom page • aliloan
React rerender • Render on data change
webpack • commonjs compile, sourcemap • Common code extrac*on
• Css extrac*on
webpack • Development – Build into memory – koa middleware
– No hash
webpack • Build – Compress – hash
jsx on server • jsx as skeleton on server
share code with server • u*l/enum/jsx … • app/common/getUserFromIvr.js:
dev.assets • Half dead – Serve sta*c resources in nodejs
memory (webpack) – Speedy cbd cycle
summary • server-‐browser harmony – js rules all – Use
React on server and browser – Use npm on server and browser – Use webpack on server and browser