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
670
TypeScript in Wantedly
Kento Moriwaki
May 29, 2018
Tweet
Share
More Decks by Kento Moriwaki
See All by Kento Moriwaki
わかった気になれる CRDT を使った共同編集
kentomoriwaki
8
3.9k
デザインシステムを導入してUIに秩序を取り戻す - React (Native)編 #rejectron2018
kentomoriwaki
16
3.6k
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
410
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
RailsConf 2023
tenderlove
29
940
Git: the NoSQL Database
bkeepers
PRO
427
64k
Code Review Best Practice
trishagee
65
17k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.6k
Rails Girls Zürich Keynote
gr2m
94
13k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
The Cost Of JavaScript in 2023
addyosmani
46
7k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
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