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
そのSPA、本当に必要ですか?
Search
nishaya
May 31, 2017
Technology
3.5k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
そのSPA、本当に必要ですか?
nishaya
May 31, 2017
More Decks by nishaya
See All by nishaya
ブラウザで一緒に音楽をつくる
nishaya
0
2.3k
Webで音楽を奏でる
nishaya
0
6.3k
ES.next — 20年目のECMAScriptに向けて
nishaya
0
1.4k
Other Decks in Technology
See All in Technology
BALLAS Technology Deck
ballas_inc
0
380
新米を「売り越さない」、Aurora DSQLで作る在庫ゼロ死守の限定ドロップEC
yama3133
0
200
[General] 개발자로 해외 기업에서 일하기
skydoves
1
310
The future of architectural work
ufried
0
190
IBC 2026 動画技術関連レポート / IBC 2026 Report
cyberagentdevelopers
PRO
2
450
Cloudflareの向き先
chimame
1
160
視野はAIに、視座は人に / ai-for-breadth-humans-for-perspective
nkzn
6
3.2k
内製アプリとClaudeスキルのセキュリティチェック、 Backlogの課題で回しています。
ayaka_egaaa
0
160
cdkd (CDK Direct)
gotok365
4
280
TSKaigi Sendai 2026 - tsgo時代のTypeScript Playgroundはどう動くか
teamlab
PRO
0
110
Kiro を使うコツ (頼み方、覚えさせ方、任せ方) | 目指せ Kiro マスター 09
inariku
PRO
3
120
AWS構成から考えるWebセキュリティ ― WordPressの構築経験から考える公開範囲と更新運用【JAWS FESTA 2026 in AKITA】
cscengineer
PRO
2
390
Featured
See All Featured
sira's awesome portfolio website redesign presentation
elsirapls
0
500
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.7k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
890
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
380
Leo the Paperboy
mayatellez
10
2.4k
How STYLIGHT went responsive
nonsquared
100
6.4k
Building Adaptive Systems
keathley
44
3.3k
Faster Mobile Websites
deanohume
310
32k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Transcript
ͦͷSPAɺ ຊʹඞཁͰ͔͢ʁ Roppongi.rb #3 2017/05/31 ೋࣾ୩ ߉༎ @nishaya
ࣗݾհ • ೋࣾ୩ ߉༎ • GitHub: @nishaya • WebΞϓϦέʔγϣϯΤϯδχΞ •
(ג) Speee ϓϩδΣΫτਪਐࣨ • React2016ʙ
࠷ۙͷࣄ • ۈଵγεςϜ1 • API: Rails w/jsonapi-resources • Front: React/Redux
1 χϡʔεղઆ - ϥζύΠͰένένۈଵཧγεςϜɺSpeee͕ɿITpro http:/ /itpro.nikkeibp.co.jp/atcl/column/14/346926/050800960/
झຯͷ։ൃ • React/ReduxͰγϯηαΠβʔΛ࡞ͬ ͨ2 • ԻΛग़͍ͨ͠ͱ͍͏ڧ͍Ϟνϕʔ γϣϯ • React/Redux৯Θͣݏ͍Λࠀ͢Δ •
ࣄલʹ͓͍ͬͯͨ͜ͱͰϓϩδΣ ΫτͰͷ໎͍͕ܰݮ͞Εͨ 2 ReactͰγϯηαΠβʔΛ࡞ͬͨ - Speee DEVELOPER BLOG http:/ /tech.speee.jp/entry/2017/04/06/100000
AGENDA • SPAʹͭΒ͍ʁ • SPA=ϑϩϯτΤϯυʁ • ͦͷSPAɺຊʹඞཁͰ͔͢ʁ • ͦΕͰSPAΛ࡞ΔͳΒ •
զʑԿΛ͔ͨ͠
SPAʹͭΒ͍ʁ • ReactΘ͔Βͳ͗͢ΔɻReduxՃΘΔͱ͞Βʹ • JSXॻ͖ͨ͘ͳ͍ • σʔλϑϩʔ͍ͮΒ͍
SPA=ϑϩϯτΤϯυʁ WebΞϓϦέʔγϣϯͷϑϩϯτΤϯυͱ͍͏ΑΓ… • APIͱ࿈ܞͯ͠ಈ࡞͢ΔΫϥΠΞϯτΞϓϦέʔγϣϯ • αʔόαΠυͱҟͳΔίϯςΩετΛ࣋ͬͨผͷαʔϏε ैདྷͷϑϩϯτΤϯυͷԆͱͯ͠ɺ ಉ͡εΩϧ/ϚΠϯυηοτͰΓͱ͛Δͷ͍͠ɻ
ͦͷSPAɺຊʹඞཁͰ͔͢ʁ SPA͕࠷దղ͔ɺཱͪࢭ·ͬͯߟ͑Δ • ͪΐͬͱUI֨ྑ͍ͨ͘͠ • RailsͷΤίγεςϜͷதͰReact͑े • ͍ܰؾ࣋ͪͰΔͱࢮ͵ • ࠓͳΜͱ͔ಈ͘ͷ͕࡞Εͯɺӡ༻͍ͯ͘͠͏ͪʹࢮ͵
• ! ͬͯΈ͍ͨ " ͍ͬͯ͘
ͦΕͰSPAΛ࡞ΔͳΒ ࣄલʹ͓͖͍ͬͯͨ͜ͱ • έʔεͷݟۃΊ • ํੑ • ணखલͷ४උ
έʔεͷݟۃΊ SPAʹϚον͢ΔέʔεΛߟ͑Δ • APIଆʹશͯͷσʔλͱϩδοΫΛஔ͖ɺදࣔɺΠϯλϥΫγϣ ϯΛߦ͏͜ͱʹಛԽ • ෳͷϚΠΫϩαʔϏεΛ౷߹͢Δ৽͍͠αʔϏεͱͯ͠ • όοΫΤϯυͱϑϩϯτΛઈରࠞͥͨ͘ͳ͍
ํੑΛܾΊΔ • ࣮ํΛݻΊΔ • Smart/Dumb ComponentͷΓ͚ • stateͷઃܭํ • ߈Ί͗͢ͳ͍
• ཧղͷ͢͠͞ޮͷ͏ͪ
ணखલͷ४උ • ެࣜಡΉ • best practiceΛ಄ʹೖΕΔ • ࠷ݶඞཁͳͷΛΓɺখ࢝͘͞ΊΔ • ԿͰ͍͍͔ΒϓϩδΣΫτͱผʹԿ͔ಈ͘ͷΛ࡞Δ
• ϓϩδΣΫτͰ׆͔ͤΔֶͼ͕͋Δͣ
զʑԿΛ͔ͨ͠ • ެࣜͷϕετϓϥΫςΟεʹै • JSON APIͷ࠾༻(jsonapi-resources) • APIͱϑϩϯτͷίϛϡχέʔγϣϯίετݮ • APIRuby/RailsͰͳ͍͍͕ͯ͘ɺϝϯςφϯεੑΛॏࢹ
• ϑϩϯτʹAPIଆͷresourceͱରԠͨ͠ϞσϧΛಋೖ͠ɺUI Componentͱ • σʔλϑϩʔΛ͍͘͢
·ͱΊ • ແཧͯ͠/͍ܰؾ࣋ͪͰSPAʹखΛग़͞ͳ͍ • έʔεʹϚον͢Δ͔ͷஅΛ • ͦͷ্ͰɺΔͳΒ͔͠Δ͖४උΛ • ͛͗ͣ͢ɺίϯτϩʔϧՄೳͳൣғͰਐΊΕා͘ͳ͍