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
RiotからVueに移行した話 #gotandajs
Search
mizuki_r
December 02, 2016
Programming
2.7k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RiotからVueに移行した話 #gotandajs
GotandaJS #6 の資料です
mizuki_r
December 02, 2016
More Decks by mizuki_r
See All by mizuki_r
FrontendUp_新規事業で_Remixを採用した理由と対策.pdf
rymizuki
0
270
税理士ドットコムの 技術的挑戦 #tapioca_lt
rymizuki
0
320
PHPを始めて1年、レガシーシステムにどう向き合っているか #phpstudy
rymizuki
1
870
モダンとレガシー #gotandaem
rymizuki
0
610
Vuexに型を付けるパターンを調べた #gotandajs
rymizuki
0
160
DockerでNodeの開発は厳しいのか? #gotandajs
rymizuki
3
430
マネージャー!きみは何者だ! #gotandaem
rymizuki
0
1.9k
物語を楽しむための物語論
rymizuki
0
570
失敗と向き合う
rymizuki
0
1.6k
Other Decks in Programming
See All in Programming
AmebaブログはKMPから卒業します
kmars0605
0
250
Performance Optimization With LLMs
xleitix
0
210
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
260
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
130
No More NoSuchMethodError
exoego
1
120
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.8k
golang-bob.pdf
iwatsukayura
0
140
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
440
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
340
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
380
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
1.2k
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
280
Featured
See All Featured
So, you think you're a good person
axbom
PRO
2
2.2k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
460
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
230
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Marketing to machines
jonoalderson
1
5.9k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
580
Facilitating Awesome Meetings
lara
57
7.2k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
620
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Designing Experiences People Love
moore
143
24k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
470
Transcript
RiotからVueに移行した話 2016/12/02 GotandaJS #6 @mizuki_r
@mizuki_r (株)モバイルファクトリー フロントエンドエンジニア JS, Perl Angular, Vue, Riot “HTMLは情報設計言語です!” 2
本日のお話
本日のお題
本日のお題 RiotͰॻ͍͍ͯͨͷΛ Vueʹॻ͖͑ͨɻ
本日のお題 • ViewϑϨʔϜϫʔΫΓ͑ͷφϨοδڞ༗ • flux͍͍ͧ • view vs logicͷநԽେࣄ
ビルド環境
ビルド環境(前) • webpack • babel?preset[]=2015 • style + css +
postcss + scss • riot
ビルド環境(後) • webpack • babel?preset[]=2015 • style + css +
postcss + scss • vue
ビルド環境
なぜVueか?
基本的なHTML,CSS,そしてJavaScript • ϑϨʔϜϫʔΫͷߏͱͯ͠ɺHTMLɺCSSɺ JS͕ͦΕͧΕଘࡏ͍ͯ͠Δ • expressionͷॻ͖͚͑ͩͰ΄΅΄΅͓ΘΔ
ライフサイクル ·͋ͦΜͳʹࣅͯΔΘ͚͡Όͳ͍… ͕ɺ mount → created, mount unmount → unmount
update → watch etc… Riot࠷খͷϥΠϑαΠΫϧ͔࣋ͬͯ͠ͳ͍ͷͰɺ VueͷҠߦָɻ
jQueryの資産をそのまま活かせる • slick • masonry
やったこと
やったこと • SyntagmeͷStoreͷͷड͚औΓํΛมߋ • RouterΛࣗ࡞ͷͷ͔ΒVueRouterมߋ • *.tagΛ*.vueॻ͖͑ॻ͖͑ॻ͖͑
SyntagmeのStateを受け取る AppComponentͷcreatedͰsyntagmeͱଓ
VueRouterへ • ·͋ͦͦݩ͕ࣗ࡞ͩͬͨΜͰ… • શ෦ॻ͖͠ • VueRouter·͡ศར
*.tag to *.vue • HTML to pug • هड़ྔతʹHTMLॻ͘ͷΊΜͲ͔ͬͨ •
ActionCreatorͷͭͳ͗͠ • γϯλοΫεͷஔ͖͑
戦略
戦略 - 前日談 • ։ൃ։͔࢝ΒVueԽݟࠐΜͰ͍ͨ • ॳظRiotͰΘʔͬͯॻ͍ͯɺVue͕͍͍̎ ײͬ͡Ά͍ใ͕ग़ἧͬͨΒҠߦ͢Δ༧ఆ ――͕ɺ్தఀظ͕ڬ·ΓଦੑͷΑ͏ʹRiotͰॻ͍͍ͯͨɻ
fluxアーキテクチャの採用 • ࣗ࡞ϑϨʔϜϫʔΫSyntagmeͷར༻ • Angular to Whatever༻Λఆͯ͠࡞͍͚ͬͯͨͲɺRiotͰಈ͘Μͩͥʁ • ViewActionCreatorʹใΛ͠ɺσʔλProviderComponent͕Store͔Βड͚ औͬͯViewಉ࢜ͰσʔλΛͤ͞Δઃܭɻ͜ΕʹΑΓɺActionCreatorͷଓͱ
ProviderComponent͑͞ม͑ΕଞͷViewʹҠߦ͘͢͠ͳΔʕʕͱ͍͏Ծઆͩͬ ͨ • ઈରʹViewʹϩδοΫΛॻ͔ͳ͍ͱ͍͏ܾҙ • ActionCreatorͱReducerʹॲཧΛدͤΔ͍ͬͯ͏ϥΠϯ͚ͩࢮक
viewの役割 • ActionCreatorΛୟ͘ • DOM͔Βऔͬͯ͘Δ • routerͷભҠ Ҏ্
小さいコンポーネントをたくさん • Riotͷརͱׂ͕ͯ͠͠қ͍͜ͱΛ׆͔ͨ͠ • ରͷDOMΛΓऔΓ • ผϑΝΠϧʹషΓ͚ͯλάͰғΉ͚ͩ • grepͰ୳ͤΔൣғ •
ίϯϙʔωϯτͷ༰ • ϑϨʔϜϫʔΫʹґଘͨ͠γϯλοΫ
振り返り
良かったこと • View : LogicͷநԽͷޭ • Vueͷtickͷॲཧ͕ૉఢ • ެࣜαϙʔτڧ͍ •
ຊޠυΩϡϝϯτڧ͍ • ମײύϑΥʔϚϯεͷվળ • Τϥʔ͕ܹݮͨ͠ • ָ͍͠
苦労した • JavaScript͔ΒϖʔδભҠ • action-creatorͷதͰ͚ͬͯͨͲɺvueͰͲ͏͖͔͢அͰ͖ͣɺcomponentʹҾ͖ͨ͠ • ͖Δɻઈ͖ΔɻͬͯΔݟ͚ͩͰ200ߦॻ ͖͑ͱ͔ຊʹ͏͖Δ • routerͷҠ২
• ͜͜ͷڍಈ͕Ұ൪มΘΓ͍͢ɻશ෦reducerܦ༝ͰURLͱ͔औಘ͔ͯͨ͠Βக໋తʹͳΒ ͳ͔͕ͬͨɺ؊Λྫྷͨ͠ • ΤϯτϦʔϙΠϯτ͕গͳ͔ͬͨͷͰٹΘΕͨɻଟ͔ͬͨΒઈͯͨ͠
今後 • syntagme to vuex͢Δͷʁ • ͨͿΜ͠ͳ͍ • ݱঢ়Viewʹґଘ͠ͳ͍ϩδοΫΛॻ͍͖ͯͨͷʹ͜͜ ͰVueʹґଘ͢Δͷͪΐͬͱ
• ϩδοΫॻ͖͢ͷVueͷWAFॻ͖͑Δͷͱن ͕ҧ͏
まとめ
まとめ • RiotΛVueʹஔ͖͑ΔࣄྫΛհ͠·ͨ͠ • ViewʹॲཧΛॻ͔ͳ͍ͷ͕Ұ൪ • ͦͷͨΊʹflux! ֮ͦͯ͠ޛʂ • ઓུେࣄ
• ਖ਼ਏ͍ͷͰɺҠ২Λߟ͑ͯΔਓͳΔͰಈ͖·͠ΐ ͏
ご清聴ありがとうございました