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+React入門
Search
rchaser53
December 19, 2016
Programming
1
780
TypeScript+React入門
rchaser53
December 19, 2016
Tweet
Share
More Decks by rchaser53
See All by rchaser53
LLVM IR入門
rchaser53
4
2.5k
pitch loaderについて
rchaser53
1
490
Rustからwasmを生成してみた話
rchaser53
1
710
Base64 VLQ概要
rchaser53
2
1.4k
sourcemap規格概要
rchaser53
1
1.1k
Other Decks in Programming
See All in Programming
Honoのおもしろいミドルウェアをみてみよう
yusukebe
1
200
SwiftUIで単方向アーキテクチャを導入して得られた成果
takuyaosawa
0
260
一休.com のログイン体験を支える技術 〜Web Components x Vue.js 活用事例と最適化について〜
atsumim
0
110
バックエンドのためのアプリ内課金入門 (サブスク編)
qnighy
8
1.7k
[JAWS-UG横浜 #80] うわっ…今年のServerless アップデート、少なすぎ…?
maroon1st
1
170
Multi Step Form, Decentralized Autonomous Organization
pumpkiinbell
1
660
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
210
Writing documentation can be fun with plugin system
okuramasafumi
0
120
Open source software: how to live long and go far
gaelvaroquaux
0
620
知られざるDMMデータエンジニアの生態 〜かつてツチノコと呼ばれし者〜
takaha4k
4
1.3k
2024年のkintone API振り返りと2025年 / kintone API look back in 2024
tasshi
0
210
DROBEの生成AI活用事例 with AWS
ippey
0
130
Featured
See All Featured
Site-Speed That Sticks
csswizardry
3
370
Documentation Writing (for coders)
carmenintech
67
4.6k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
29
2.2k
Bash Introduction
62gerente
610
210k
Done Done
chrislema
182
16k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
Music & Morning Musume
bryan
46
6.3k
Six Lessons from altMBA
skipperchong
27
3.6k
Transcript
TypeScript + React 入門 @rchaser53
伝えたいこと 静的解析があると本当に楽 (TypeScript でもFlow でもOK) ゆるく導入してもメリットはある 少しずつ学んでいく
本日のリポジトリ 取引先のフィールドが淡々と出力されるだけのものです TypeScript で書いた際の雰囲気をお楽しみください https://github.com/rchaser53/TsxDemo
静的解析があると本当に楽 N 番煎じなので静的解析については略 補完や構文エラーが出るのは非常に便利 visual studio code 優秀 ( 好きなeditor
を使いたいならtsserver で頑張ろう)
補完機能は思ったより大事 オブジェクトの構造の把握が容易になる => 新規メンバーや臨時メンバーが入りやすい => リファクタリングもしやすい interface を充実させれば下手なドキュメントより優秀? ( エラーが出るから少なくともメンテはされる)
ゆるく導入してもメリットはある ハードルは日に日に下がっている TypeScript 2 系で設定は大分楽になった TypeScript 2.1.4 でmodule の宣言も不要に
例1. props のinterface だけでも効果あり export interface Props { name: string
label: string index: number } export class Row extends React.Component< Props, {} > { // 略 }
例2. 導入が楽なところから攻める(tsconfig 編) noUnusedLocals 使用していないローカル変数をチェックする noUnusedParameters 使用していない引数をチェックする
例2. 導入が楽なところから攻める( 型編) readonly property を読取り専用にする export interface Circle {
readonly radius: number x: number y: number } let circleA: CirCle = { radius: 10, x: 5, y: 5 } circleA.radiux = 20 // Error! circleA.x = 10 // ok
ハードルが低く効果がわかりやすい所から 体感してもらえないと導入しても使ってくれない 簡単にできて、効果が実感しやすい所から攻める やってくれる人を少しずつ増やしていく
少しずつ学んでいく 一から全部やろうとするから辛い 空いた時間で少しずつ綺麗にしていく ( ファイル、関数、オブジェクト単位で少しずつ) 最初のうちは分かる物だけ使えばよい
わかる機能から始める 非常に多機能。最初から全部は辛い 簡単なものから使っていく 特に既存プロジェクトに一気に導入するのは辛い
皆で一斉にやらなくたっていい 誰かまず始める 空き時間で型を付けたり、interface を宣言したりする (2-3 日に1 回、2-30 分くらいでも十分に効果あり) ある程度ノウハウがたまったら展開していく (
コードレビューあたりを利用)
終わりに 何事もすぐに理想の状態にはならない ちょっとずつ頑張っていく