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
攻めつづける FRESH! のWeb ver.新春
Search
sutiwo
February 11, 2018
Technology
3
4.9k
攻めつづける FRESH! のWeb ver.新春
#insideFE #insideFE_B
15:40〜 のセッションです。
Inside Frontend :
https://inside-frontend.com/#seminar-b3
sutiwo
February 11, 2018
Tweet
Share
More Decks by sutiwo
See All by sutiwo
FRESH! クライアントサイドパフォーマンス改善
sutiwo
1
2.3k
Kill Pollingした話
sutiwo
1
1.5k
Other Decks in Technology
See All in Technology
怖くない!ゼロから始めるPHPソースコードコンパイル入門
colopl
0
160
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
140
型情報を用いたLintでコード品質を向上させる
sansantech
PRO
2
140
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
120
LINE Developersプロダクト(LIFF/LINE Login)におけるフロントエンド開発
lycorptech_jp
PRO
0
150
DUSt3R, MASt3R, MASt3R-SfM にみる3D基盤モデル
spatial_ai_network
2
270
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
210
How to be an AWS Community Builder | 君もAWS Community Builderになろう!〜2024 冬 CB募集直前対策編?!〜
coosuke
PRO
2
2.9k
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
160
サイバー攻撃を想定したセキュリティガイドライン 策定とASM及びCNAPPの活用方法
syoshie
3
1.4k
日本版とグローバル版のモバイルアプリ統合の開発の裏側と今後の展望
miichan
1
140
ハイテク休憩
sat
PRO
2
180
Featured
See All Featured
The Invisible Side of Design
smashingmag
298
50k
Music & Morning Musume
bryan
46
6.2k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
Scaling GitHub
holman
459
140k
YesSQL, Process and Tooling at Scale
rocio
170
14k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
A better future with KSS
kneath
238
17k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Transcript
߈Ί͚ͭͮΔ FRESH! ͷWeb @su.wo INSIDE FRONTEND #2 2018.2.11 ver. ৽य़
• su.wo / su.wo_ •Front-end engineer •CyberAgent, Inc. •FRESH!
•ੜ์ૹϓϥοτϑΥʔϜ •ϑϩϯτνʔϜPCͱSPϒϥβɺ৴ը໘
•ੜ์ૹϓϥοτϑΥʔϜ •ϑϩϯτνʔϜPCͱSPϒϥβɺ৴ը໘
•ϥΠϒϑΝϯσΟϯάػೳͷ։ൃத৺ hNps:/ /daily.freshlive.tv/posts/3378766 •FullHDͰͷੜ৴͕Մೳʹ hNps:/ /www.cyberagent.co.jp/news/detail/id=21288 •4Kղ૾ͷߴը࣭ରԠ༧ఆ hNps:/ /www.cyberagent.co.jp/news/detail/id=21239
1. Payment Request API ͷಋೖ 2. React v15 to v16
Ͱͬͨ͜ͱ 3. Puppeteer Λͬͨ E2E ςετ 4. ͦͷଞͷऔΓΈ Agenda
1. Payment Request API ͷಋೖ 2. React v15 to v16
Ͱͬͨ͜ͱ 3. Puppeteer Λͬͨ E2E ςετ 4. ͦͷଞͷऔΓΈ Agenda
None
- FRESH! ͷαʔϏεͰίΠϯΛߪೖ - ߪೖͨ͠ίΠϯֹ(ॴֹ࣋)ʹԠͯ͡ࢧԉ - ࢧԉͨ݁͠Ռ༷ʑͳಛయ͕ڗडͰ͖Δ ϥΠϒϑΝϯσΟϯάͱ
- FRESH! ͷαʔϏεͰίΠϯΛߪೖ - ߪೖͨ͠ίΠϯֹ(ॴֹ࣋)ʹԠͯ͡ࢧԉ - ࢧԉͨ݁͠Ռ༷ʑͳಛయ͕ڗडͰ͖Δ ϥΠϒϑΝϯσΟϯάͱ
ैདྷͷํ๏
None
None
None
- GMO ϖΠϝϯτήʔτΣΠͷαΠτભҠ - FRESH! ͰΧʔυใอ࣋͠ͳ͍
- ೃછΈ͋Δख๏ - ߪೖͷʹผυϝΠϯભҠ - ςϯϓϨʔτͷߋ৽͕໘ (ϩάɾσβΠϯ)
FRESH! ʹΧʔυใ͕อ࣋͞Εͯ͠·͏ҹ
- ܾࡁʹඞཁͳΠϯλʔϑΣʔεΛϒϥβωΠςΟϒͰఏڙ - ΫϨδουΧʔυใͷೖྗɾPayment Appͱͷ࿈ܞΛ୲͏ - ࢧ͍ॲཧߦΘͳ͍ - ܾࡁΛΑΓศརͰηΩϡΞʹ Payment
Request API ͱ
Payment Request API Ͱ؆୯ɾߴͳܾࡁΛ࣮ݱ͢Δ | Web | Google Developers :
https://developers.google.com/web/updates/2016/07/payment-request?hl=ja
None
None
- ϒϥβ Chrome ͷΈ - basic-card ͷΈରԠ - PRA༻ͷΤϯυϙΠϯτΛ༻ҙ FRESH!
ॳظಋೖͰͷରԠ
1. Payment Request API ͷಋೖ 2. React v15 to v16
Ͱͬͨ͜ͱ 3. Puppeteer Λͬͨ E2E ςετ 4. ͦͷଞͷऔΓΈ Agenda
FRESH! === Isomorphic (React + Fluxible)
React v16.0 - React Blog : https://reactjs.org/blog/2017/09/26/react-v16.0.html
v15 -> v16 Ͱͬͨ͜ͱ 1. Fluxible, ֎෦UIίϯϙʔωϯτΛΞοϓσʔτ 2. <Fragment />
, return string ͷ༻ 3. SSRͰ renderToStream ॻ͖͑
<Fragment /> ͷ༻
<Fragment /> ͷ༻ <div>, <span> Ͱғ͍ͬͯͨ
<Fragment /> ͷ༻
<Fragment /> ͷ༻ <div>, <span> ғΘͳͯ͘ ͍͍
return String
v15.5.4 v16.0 Autocannon Ͱͷଌఆ݁Ռ
Benchmark 0 750 1500 2250 3000 Avg Stdev Max 1.921
179 491 2.504 465 954 v15.5.4 v16.0 ms
renderToString -> renderToNodeStream -SSR ࣌ ReactElement Λॳظͷ HTML ʹඳը͢Δ -Node.js
ͷ StreamAPI Writable Λͬͯඇಉظॲཧ -metaλάͷ࡞Ͱ෭࡞༻͕ൃੜ (ޙड़)
Request1 -> Request1 ͷ renderToNodeStream -> Request2 -> Request2 ͷ
renderToNodeStream -> Request2ͷ .on(‘finish’) Metadata Λऔͬͯdispose(ΫϦΞ)͢Δ -> Request1ͷ .on(‘finish’) Metadata ͕ۭʹͳΔ ෭࡞༻ εϨουηʔϑ
Request1 -> Request1 ͷ renderToNodeStream -> Request2 -> Request2 ͷ
renderToNodeStream -> Request2ͷ .on(‘finish’) Metadata ΛऔͬͯΫϦΞ͢Δ -> Request1ͷ .on(‘finish’) Metadata ͕ۭʹͳΔ ෭࡞༻ εϨουηʔϑ metadata Λ contextɺfluxͳͲάϩʔόϧεςʔτ
renderToNodeStream Ͱͷ Benchmark renderToString renderToStream
1. Payment Request API ͷಋೖ 2. React v15 to v16
Ͱͬͨ͜ͱ 3. Puppeteer Λͬͨ E2E ςετ 4. ͦͷଞͷऔΓΈ Agenda
ϦϦʔε֬ೝͷྲྀΕ ※࣮ࡍͷσϓϩΠϑϩʔͱҟͳΔ
ϦϦʔε֬ೝͷྲྀΕ STG
ϦϦʔε֬ೝͷྲྀΕ STG • QAςετ • σΟϨΫλʔ֬ೝ • ຊ൪ϦϦʔε2-3લ
ϦϦʔε֬ೝͷྲྀΕ Standby STG
ϦϦʔε֬ೝͷྲྀΕ Standby STG • ϦϦʔεՕॴͷ֬ೝ • νΣοΫγʔτ✅
ϦϦʔε֬ೝͷྲྀΕ Standby STG PRD
ϦϦʔε֬ೝͷྲྀΕ Standby STG PRD • ϦϦʔεՕॴͷ֬ೝ • Τϥʔϩάͷ֬ೝͳͲ • νΣοΫγʔτ✅
ϦϦʔε֬ೝͷྲྀΕ Standby STG PRD
ϦϦʔε֬ೝͷྲྀΕ Standby STG PRD νΣοΫγʔτ✅ νΣοΫγʔτ✅
ϦϦʔε֬ೝͷྲྀΕ Standby STG PRD νΣοΫγʔτ✅ νΣοΫγʔτ✅ όοΫΤϯυAPIϦϦʔεͰಉ͡ྲྀΕ
150
150߲ νΣοΫγʔτ✅ ಓʹ֬ೝ
None
ࣗಈԽ͠Α͏
ಡΈ : ύΝύΝςΟΟΞ
Node.js ͔Β Headless Chrome (v59 <=) Λૢ࡞ 1݄12ʹ v1.0 ϦϦʔε
Chrome DevTools νʔϜ͕ϝϯςφϯε
- Node.js =< 8 async/await ͑Δ - Transpile ෆཁ -
ςετ߲+αͷػೳ (ScreenShot, FMPͷܭଌ)
Assertion Test Framework Browser Operation
None
Using that Headless Chrome You’ve Been Hearing About : https://medium.com/@ivanmontiel/using-that-headless-chrome-youve-been-hearing-about-543a8cc07af5
େมͳ͜ͱ - ൪εςʔλε͕ෳ͋Γςετ࣮ߦ࣌ཁ݅Λຬͨ ͞ͳ͍ͷ͕͋Δ - ܾࡁͷςετͰߪೖ͕ඞཁͳ߹ঢ়ଶ - ᘳʹ࡞Δͷ࿑ྗ͕͔͔Δ
ࠓޙΓ͍ͨ͜ͱ - CIͰϙνοͱ࣮ߦ - CronͰఆظ࣮ߦ - εΫϦʔϯγϣοτͱςετ݁Ռͷอ࣋ - FMPͷܭଌ
1. Payment Request API ͷಋೖ 2. React v15 to v16
Ͱͬͨ͜ͱ 3. Puppeteer Λͬͨ E2E ςετ 4. ͦͷଞͷऔΓΈ Agenda
FRESH! INITIATIVE LABORATORY (FIL)
FRESH! INITIATIVE LABORATORY (FIL) 20%ϧʔϧͷΑ͏ͳ੍
FIL is - ִिͷ༵ۚʹ࣮ࢪ - ظతεύϯͰඞཁʹͳΓͦ͏ͳٕज़Λݕূ - ۀʹࡴ͞Εͯ์ஔؾຯͩͬͨ՝ΛҰ - ʹετοΫ
Webmen FRESH! EQUALIZER (WebAudioAPI) ಈը࠶ੜͷมߋػೳ Speech Synthesis API ΛͬͨίϝϯτಡΈ্͛ػೳ
1. Payment Request API ͷಋೖ ܾࡁ͕εϜʔζʹͳͬͨ ·ͱΊ
2. React v15 to v16 Ͱͬͨ͜ͱ Ϩεϙϯε͕ඦms͘ͳͬͨ ·ͱΊ
3. Puppeteer Λͬͨ E2E ςετ ϦϦʔε֬ೝָ͕ʹͳͬͨ ·ͱΊ
4. ͦͷଞͷऔΓΈ FILͰΑ͍ͷ͕࡞Εͨ ·ͱΊ
͜Ε͔Β߈Ίଓ͚Α͏
Thank you, Ask Me Anything FRESH! Front-end Team