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
230
3
Share
react best practice
react best practice
yiminghe
May 14, 2015
More Decks by yiminghe
See All by yiminghe
小程序终端技术架构
yiminghe
0
270
支付宝小程序的开放架构
yiminghe
0
200
gitc2016 react based architecture
yiminghe
1
180
antd at qcon2016
yiminghe
1
240
react-based architecture
yiminghe
2
180
React Ecosystem At Ant Financial
yiminghe
4
2.3k
ant design preview
yiminghe
1
330
react at alipay
yiminghe
43
4.5k
form validation in react
yiminghe
4
580
Other Decks in Technology
See All in Technology
暗黙知について一歩踏み込んで考える - 暗黙知の4タイプと暗黙考・暗黙動へ
masayamoriofficial
0
1.5k
あるアーキテクチャ決定と その結果/architecture-decision-and-its-result
hanhan1978
2
590
CDK Insightsで見る、AIによるCDKコード静的解析(+AI解析)
k_adachi_01
2
120
DIPS2.0データに基づく森林管理における無人航空機の利用状況
naokimuroki
1
200
組織的なAI活用を阻む 最大のハードルは コンテキストデザインだった
ixbox
6
1.8k
20260410 - CNTUG meetup #72 - DiskImage Builder 介紹:以 Kubespray CI 打造 RockyLinux 10 Cloud Image 為例
tico88612
0
120
幾億の壁を超えて/Beyond Countless Walls(JP)
ikuodanaka
0
120
#jawsugyokohama 100 LT11, "My AWS Journey 2011-2026 - kwntravel"
shinichirokawano
0
190
明日からドヤれる!超マニアックなAWSセキュリティTips10連発 / 10 Ultra-Niche AWS Security Tips
yuj1osm
0
320
新メンバーのために、シニアエンジニアが環境を作る時代
puku0x
0
760
Digitization部 紹介資料
sansan33
PRO
1
7.2k
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
5
14k
Featured
See All Featured
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.1k
RailsConf 2023
tenderlove
30
1.4k
A Soul's Torment
seathinner
6
2.6k
My Coaching Mixtape
mlcsv
0
97
For a Future-Friendly Web
brad_frost
183
10k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
160
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
260
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
330
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
460
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