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
TypeScript in Wantedly
Search
Kento Moriwaki
May 29, 2018
2
660
TypeScript in Wantedly
Kento Moriwaki
May 29, 2018
Tweet
Share
More Decks by Kento Moriwaki
See All by Kento Moriwaki
わかった気になれる CRDT を使った共同編集
kentomoriwaki
5
3.7k
デザインシステムを導入してUIに秩序を取り戻す - React (Native)編 #rejectron2018
kentomoriwaki
16
3.5k
ReactでWebとNativeの共通UIライブラリを作ろう
kentomoriwaki
0
1.1k
BFFを導入しなかった理由
kentomoriwaki
4
13k
5分でわかる React "Suspense"
kentomoriwaki
3
1.4k
導入して1年経ったReact周辺の 技術スタックを反省します | React反省会@Wantedly
kentomoriwaki
10
8.5k
Immutable.jsとReact @Wantedly ~入門編~
kentomoriwaki
8
74k
React速習会@Wantedly
kentomoriwaki
1
400
Featured
See All Featured
The Invisible Side of Design
smashingmag
298
50k
Adopting Sorbet at Scale
ufuk
73
9.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
What's new in Ruby 2.0
geeforr
343
31k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
900
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
We Have a Design System, Now What?
morganepeng
50
7.2k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
420
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Transcript
©2018 Wantedly, Inc. TypeScript in Wantedly Roppongi.js#3 29.May.2018 - Kento
Moriwaki
©2018 Wantedly, Inc. 5ZQF4DSJQUಋೖ͠·ͨ͠
©2018 Wantedly, Inc. 8BOUFEMZͷձࣾϖʔδͷ ϦχϡʔΞϧͨ͠ 443Λಋೖ͢Δඞཁ͕͋Γɺ શମͷߏΛݟͨ͠
ͱͱܕ͕΄͍͠ଟ͔ͬ ͨͷͰɺ͍͍λΠϛϯάͩͱ ࢥ͍ಋೖͨ͠ എܠ
©2018 Wantedly, Inc. ೖΕͯΑ͔ͬͨ
©2018 Wantedly, Inc. ҆৺ͯ͠ίʔυΛมߋͰ͖Δ w 4UPSFͷߏΛม͑ͨΓͨ͠ͱ͖ɺมߋ͖͢Օॴ͕͙͢ʹΘ͔Δ ิ͕ޮ͘ w
λΠϐϯάݮΔ͠ɺ5ZQPݮΔ Τϥʔ͕ݮΔ w VOEFpOFEΤϥʔ͕΄΅ແ͘ͳΔ Α͔ͬͨͱ͜Ζ
©2018 Wantedly, Inc. ͜͏ͬͯಋೖ͠·ͨ͠
©2018 Wantedly, Inc. AUTDAͰϏϧυ͠ͳ͍
©2018 Wantedly, Inc. ϏϧυपΓΓΊΜͲ͍͘͞ w XFCQBDLʹMPBEFSΛՃͯ͠ɺͦΕΛ443༻ͷϏϧυมߋͯ͠ɺKFTUͰUTΛϏϧυ͢Δํ ๏ΛௐͯɻɻઃఆपΓΓΊΜͲ͍͘͞ɻ ݁ہCBCFMඞཁ w QPMZpMMೖΕͨΓɺSFBDUIPUMPBEFSͷϓϥάΠϯɺTUZMFEDPNQPOFOUTͷ࠷దԽͨ͠Γɺ
5ZQF4DSJQUͷϏϧυ݁ՌΛCBCFMʹ͔͚Δඞཁ͕Ͳ͏ͯ͠ग़ͯ͘Δɻ `tsc`ͰϏϧυ͠ͳ͍
©2018 Wantedly, Inc. !CBCFMQSFTFUUZQFTDSJQU w CBCFMͷUSBOTGPSNͰɺ5ZQF4DSJQUͷγϯλοΫεΛআͯ͘͠ΕΔૉΒ͍ͭ͠ w IUUQTHJUIVCDPNCBCFMCBCFMUSFFNBTUFSQBDLBHFTCBCFMQSFTFUUZQFTDSJQU Δ͜ͱCBCFMSDʹҰߦՃ͑Δ͚ͩ w
QSFTFUT<!CBCFMQSFTFUUZQFTDSJQU> w XFCQBDLͷมߋ͍Βͳ͍ɺKFTUͦͷ··ಈ͘ ࣮ɺbabel͚ͩͰTypeScriptͷϏϧυ͕Ͱ͖Δ
©2018 Wantedly, Inc. CBCFM CFUB ͔Β͑Δ w Ҏ্CFUBͷ։ൃ͕ଓ͍͍ͯΔ w CFUB·ͰਐΜͰ͍Δ͚Ͳ
શͳޓੑ࣋ͨͳ͍ w جຊతʹɺ5ZQF4DSJQUͷίʔυ͔ΒܕΞϊςʔγϣϯΛআ͍ͯ͠Δ͚ͩ w AOBNFTQBDFA ADPOTUFOVNAͳͲͷػೳ͕͑ͳ͍ w XPSLBSPVOEͪΌΜͱ͋Δ w AOVNCFSAͳͲͷΩϟετͰͰ͖ͳ͍ w +49ͱͷ۠ผ͕Ͱ͖ͳ͍ʁABTOVNCFSAΛ͍͍͑ ҙ
©2018 Wantedly, Inc. AUTDOP&NJUAͰܕνΣοΫͷΈߦ͏ w MJOUFSͳͲͱಉ͡Ϩϕϧͷѻ͍ w ܕΤϥʔ͕͋Δͱ$*͕ͪΌΜͱམͪΔΑ͏ʹ͢Δ w ։ൃதܕ͕ؒҧ͍ͬͯͯɺϏϧυͪΌΜͱͰ͖Δ
TypeScriptܕνΣοΫͷΈ
©2018 Wantedly, Inc. UZQFTDSJQUGTB
©2018 Wantedly, Inc. 3FEVYͷBDUJPO SFEVDFSपΓͲ͏ॻ͍ͨΒ͍͍ͷ ͔ϕετϓϥΫςΟε͕Θ͔Βͳ͍ w ௐͨΒ͍ΖΜͳॻ͖ํ͕ग़ͯ͘Δ w 3FEVYWͰܕఆ͕ٛΑ͘ͳΔΒ͍͠
࣌ w ͭ·ΓࠓΑ͘ͳ͍ͷ͔ͳʁ w W͢ͰʹϦϦʔεࡁΈͰ͕͢Ͳ͏มΘͬͨͷ͔Βͳ͍ w Ϩʔϧ͕ཉ͍͠ʂ typescript-fsa
©2018 Wantedly, Inc. ͦΜͳͱ͖ʹग़ձͬͨͷ͕ɺ5ZQF4DSJQU'4"Ͱ͠ ͨ w IUUQTHJUIVCDPNBJLPWFOUZQFTDSJQUGTB w "DUJPO$SFBUPSMJCSBSZGPS5ZQF4DSJQU'4"DPNQMJBOU w
͘͢͝ബ͍6UJMJUZ w GBNJMZ͕͍͔ͭ͋͘Δ w UZQFTDSJQUGTBSFEVDFST w UZQFTDSJQUGTBSFEVYUIVOL w UZQFTDSJQUGTBSFEVYTBHB typescript-fsa
©2018 Wantedly, Inc. redux-actionsͱࣅ͍ͯΔ
©2018 Wantedly, Inc. ඇಉظͳActionͷఆٛ ։࢝ɺऴྃɺࣦഊͷΞΫγϣϯΛಉ࣌ʹ࡞ͬͯ ͘ΕΔ
©2018 Wantedly, Inc. typescript-fsa-reducers SFEVDFSؔʹɺDBTFͱ͍͏ϝιου͕ ੜ͑ɺTXJUDIจͷΘΓʹͦΕΛ͏ ୈҰҾʹGTBΞΫγϣϯΛ͠ɺୈೋҾ ʹͦͷ߹ͷSFEVDFSॲཧΛ͔͘ɻ͜ ͷҾ͕͖ͪΜͱܕ͕ܾ·ͬͨͷ͕ͬ ͯ͘Δ
©2018 Wantedly, Inc. typescript-fsa-redux-thunk CJOE5IVOL"DUJPOͰɺඇಉظͳ"DUJPOΛғͬͯॲཧΛ࣮͢Δ ฦΓ͕݁ՌͷQBZMPBEʹͳΔɺEJTQBUDIͷ݁ՌΛJT'BJMVSF JT4VDDFTTͰධՁ͢Δ
©2018 Wantedly, Inc. w GTBܗࣜͰ"1*ϦΫΤετΛఆٛͰ͖Δ request-creator(internal)
©2018 Wantedly, Inc. $PNQPOFOUͷܕఆٛ
©2018 Wantedly, Inc. ίϯϙʔωϯτ͝ͱʹຖճܕఆٛΛॻ͘ͷΊΜͲ ͍͘͞ w ΄΅ಉ͡Α͏ͳQSPQTΛड͚͍ͯΔ߹ɺ͍·Θ͍ͨ͠ w ྫ͑$PNQBOZ͕͋ͬͨΒɺͲͷϑΟʔϧυ͕ඞཁ͔ίϯϙʔωϯτʹΑΔ͕ɺͲ͏͍͏ ܕͳͷ͔ڞ௨ͷͣ
ܕఆٛΛ؆୯ʹॻ͖͍ͨ
©2018 Wantedly, Inc. WtdModels υϝΠϯͰڞ௨ͳ&OUJUZΛఆ͍ٛͯ͘͠ "1*ɺ3BJMTͷBDUJWFNPEFMTFSJBMJ[FST ʹґଘ͍ͯ͠ΔͷͰɺ֤4FSJBMJ[FSʹରԠ ͨ͠ܕΛఆٛ͢Δ
©2018 Wantedly, Inc. WtdModels.Partial υϝΠϯͰڞ௨ͳ&OUJUZΛͱʹɺͦ ͷ$PNQPOFOUͰඞཁͳϑΟʔϧυΛ 8UE.PEFMT1BSUJBMΛͬͯએݴ͢Δɻ \$PNQPOFOU^.PEFMTͱ͍͏໊લʹͦͷ ܕΛ͓͍ͯɺίϯϙʔωϯτͱҰॹʹ FYQPSU͢Δϧʔϧ
©2018 Wantedly, Inc. WtdModels.Union ෳͷ$PNQPOFOUΛΈ߹Θͤͨ $PNQPOFOUͰɺͦΕͧΕͷ \$PNQPOFOU^.PEFMTͷఆٛΛ A8UE.PEFMT6OJPOAͰ݁߹ͯ͠ܕఆٛ͢ Δɻ தɺجຊతʹAA͍ͯ͠Δ͚ͩɻ
©2018 Wantedly, Inc. ·ͱΊ
©2018 Wantedly, Inc. 5ZQF4DSJQUੜ࢈ੑߴ͍ #BCFMΛ͑ઃఆָ UZQFTDSJQUGTB͕͓͢͢Ί
ܕఆָ͕ٛʹ͔͚ΔΑ͏ʹ͍ͯ͜͠͏ ·ͱΊ
©2018 Wantedly, Inc. ࠷ޙʹ we are hiring! https://www.wantedly.com/projects/59809