(heejongahn@gmail.com)
• .
• .
• http://ahnheejong.name/
• github, twitter @heejongahn
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
• ?
• ?
• , ?
• ?
• , ?
• [ ] ?
• ?
• , ?
• [ ] ?
• ?
• ?
• , ?
• [ ] ?
• ?
• ?
• ?
• , ?
• [ ] ?
• ?
• ?
• ?
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기


(PR)


(PR)
💩
💩
💩
💩
💩
💩
💩
💩
💩
💩
💩
💩
PR
PR
…
PR
!
http://earlbarr.com/publications/typestudy.pdf
• ICSE’17 .
http://earlbarr.com/publications/typestudy.pdf
• ICSE’17 .
• 

.
http://earlbarr.com/publications/typestudy.pdf
• ICSE’17 .
• 

.
• “Github open issue


?”
http://earlbarr.com/publications/typestudy.pdf
,
.
“…using Flow or TypeScript
could have prevented 

15% of the public bugs 

for public projects on GitHub.”
“ .
10% , .
, . That’s
shocking. If you could make a change to the way we do development
that would reduce the number of bugs being checked in by 10% or
more overnight, that’s a no-brainer. Unless it doubles development
time or something, we’d do it.”
“ .
10% , .
, . That’s
shocking. If you could make a change to the way we do development
that would reduce the number of bugs being checked in by 10% or
more overnight, that’s a no-brainer. Unless it doubles development
time or something, we’d do it.”
“ .
10% , .
, . That’s
shocking. If you could make a change to the way we do development
that would reduce the number of bugs being checked in by 10% or
more overnight, that’s a no-brainer. Unless it doubles development
time or something, we’d do it.”
( TypeScript MS )
https://www.youtube.com/watch?v=KQevsm64wPY
• .
• .
• .
• .
• .
• .
• “ .”
• + IDE +
• , .
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
https://www.typescriptlang.org/ https://flow.org/
TypeScript Flow
Microsoft Facebook
2012.10.01 2014. 11. 19
Hyperconnect, Reddit, Tumblr, Slack, 

VS Code, Angular, … 

(http://www.typescriptlang.org/community/friends.html)
React, Vue, …
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
• TypeScript Flow .
• TypeScript Flow .
• , .
• TypeScript Flow .
• , .
• 😇
• TypeScript Flow .
• , .
• 😇
• 👆 , .
• TypeScript Flow .
• , .
• 😇
• 👆 , .
• .
😥
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
•
• IDE
•
… because JavaScript was not designed
around a type system, Flow sometimes
has to make a tradeoff. When this
happens Flow tends to favor
soundness over completeness,
ensuring that code doesn’t have any
bugs.
(https://flow.org/en/docs/lang/types-and-expressions/#soundness-and-completeness-a-
classtoc-idtoc-soundness-and-completeness-hreftoc-soundness-and-completenessa)
Non-Goals: [...] Apply a sound or
"provably correct" type system.
Instead, strike a balance between
correctness and productivity.
(https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals)
Non-Goals: [...] Apply a sound or
"provably correct" type system.
Instead, strike a balance between
correctness and productivity.
(https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals)
“ 

” . 

.
… because JavaScript was not designed
around a type system, Flow sometimes
has to make a tradeoff. When this
happens Flow tends to favor
soundness over completeness,
ensuring that code doesn’t have any
bugs.
(https://flow.org/en/docs/lang/types-and-expressions/#soundness-and-completeness-a-
classtoc-idtoc-soundness-and-completeness-hreftoc-soundness-and-completenessa)


.
… because JavaScript was not designed
around a type system, Flow sometimes
has to make a tradeoff. When this
happens Flow tends to favor
soundness over completeness,
ensuring that code doesn’t have any
bugs.
(https://flow.org/en/docs/lang/types-and-expressions/#soundness-and-completeness-a-
classtoc-idtoc-soundness-and-completeness-hreftoc-soundness-and-completenessa)
Non-Goals: [...] Apply a sound or
"provably correct" type system.
Instead, strike a balance between
correctness and productivity.
(https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals)
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
• alert ?
• alert ?
•
• alert ?
•
• !
• alert arg 

• alert arg 

• if
• alert arg 

• if
• ‘ ’ 



• Flow (soundness)
• Flow (soundness)
•
• Flow (soundness)
•
• const
• Flow (soundness)
•
• const
• ‘ ’
• Flow (soundness)
•
• const
• ‘ ’
•
[flow] number (This type is incompatible with 

an implicitly-returned undefined.)
[ts] Type '"JavaScript"' is not comparable
to type '"TypeScript" | "Flow"'.
•
• IDE
•
https://octoverse.github.com/
https://code.visualstudio.com/
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
• TypeScript
• TS ?
• , Go To Definition IDE
• , Go To Definition IDE
• ( , ) (link)
• , Go To Definition IDE
• ( , ) (link)
• JSDoc
• TypeScript 2.5~
• JSDoc
• HTML <script>
• Zero configuration needed
• Flow
https://twitter.com/disjukr/status/924216888703426560
• , Go To Definition IDE
• ( , ) (link)
• JSDoc
• (link)
• , Go To Definition IDE
• ( , ) (link)
• JSDoc
• (link)
• …
•
• IDE
•
• https://eng.lyft.com/typescript-at-lyft-64f0702346ea
• https://eng.lyft.com/typescript-at-lyft-64f0702346ea
• lyft TypeScript
• https://eng.lyft.com/typescript-at-lyft-64f0702346ea
• lyft TypeScript
• (2017 9 28 )
• .
# of TypeScript Flow
StackOverflow
Github
(Open/Closed)
Github PR
(Open/Closed)
npm 

( + )
# of TypeScript Flow
StackOverflow ~ 38,000 ~ 900
Github
(Open/Closed)
Github PR
(Open/Closed)
npm 

( + )
# of TypeScript Flow
StackOverflow ~ 38,000 ~ 900
Github
(Open/Closed)
~2,400 / ~11,200 ~1,500 / ~2,200
Github PR
(Open/Closed)
npm 

( + )
# of TypeScript Flow
StackOverflow ~ 38,000 ~ 900
Github
(Open/Closed)
~2,400 / ~11,200 ~1,500 / ~2,200
Github PR
(Open/Closed)
~100 / ~5,000 ~60 / ~1,200
npm 

( + )
# of TypeScript Flow
StackOverflow ~ 38,000 ~ 900
Github
(Open/Closed)
~2,400 / ~11,200 ~1,500 / ~2,200
Github PR
(Open/Closed)
~100 / ~5,000 ~60 / ~1,200
npm 

~7.2 million ~2.9 million
( + )
# of TypeScript Flow
StackOverflow ~ 38,000 ~ 900
Github
(Open/Closed)
~2,400 / ~11,200 ~1,500 / ~2,200
Github PR
(Open/Closed)
~100 / ~5,000 ~60 / ~1,200
npm 

~7.2 million ~2.9 million
( + )
~3,700 + 250k ~340 + 43k
# of TypeScript Flow
StackOverflow ~ 38,000 ~ 900
Github
(Open/Closed)
~2,400 / ~11,200 ~1,500 / ~2,200
Github PR
(Open/Closed)
~100 / ~5,000 ~60 / ~1,200
npm 

~7.2 million ~2.9 million
( + )
~3,700 + 250k ~340 + 43k
https://octoverse.github.com/
# of TypeScript Flow
StackOverflow ~ 38,000 ~ 900
Github
(Open/Closed)
~2,400 / ~11,200 ~1,500 / ~2,200
Github PR
(Open/Closed)
~100 / ~5,000 ~60 / ~1,200
npm 

~7.2 million ~2.9 million
( + )
~3,700 + 250k ~340 + 43k
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
• …
• LoC Flow TypeScript .
• .
• .
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
“Love for TypeScript” (https://github.com/Microsoft/TypeScript/issues/10011)
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
• Plain JavaScript
• Flow
• npm install -g typescript
• my-cool-lib
•
• npm install my-cool-lib @types/my-cool-lib
•
• , , , /
, , …
• https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
•
• , , / ,
, …
• —allowSyntheticalDefaultImport
• —strict 

= —noImplicitAny + —noImplicitThis + —alwaysStrict 

+ —strictNullCheck + —strictFunctionType
• —lib, —target
• .
• https://www.typescriptlang.org/docs/handbook/compiler-options.html
• MS
•
• ts-loader(https://github.com/TypeStrong/ts-loader)
• awesome-typescript-loader(https://github.com/s-panferov/
awesome-typescript-loader)
• awesome-typescript-loader ( )
• https://
stackoverflow.com/
questions/tagged/
typescript
https://www.typescriptlang.org/

samples/index.html
https://github.com/Microsoft/TypeScriptSamples/
https://github.com/Microsoft/TypeScript/wiki
• https://www.typescriptlang.org/
docs/handbook/declaration-files/
introduction.html
• 

• .js(x), .ts(x)
(e.g. css-in-js)
• .
• .
• .
• .
• .
• .
• myScript.js -> myScript.ts
• myComponent.jsx -> myScript.tsx
• JS TS
• ( ) or
• TS JS
• 1.8~: —allowJs
• 2.3~: —checkJs JS – JSDoc 

https://github.com/Microsoft/TypeScript/wiki/Type-Checking-JavaScript-Files
•
•
•
•
• 

• 

• /


https://commons.wikimedia.org/wiki/File:Community_Immunity.jpg
→
•
• + /
• +
•
• flow-bin -> tsc
•
• babel-preset-flow
•
• Flow: ES6 

(import type { MyType } import { type MyType } )
• TS: ES6 (import { MyType })
•
• Flow: type Animal = { name: string }
• TS: interface Animal { name: string; }
•
• Flow: type Dog = Animal & { bark: () => void }
• TS: interface Dog extends Animal { bark: () => void; }
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
•
• : TS
•
• : TS
•
• TS “ … ”
•
• : TS
•
• TS “ … ”
•
• ! !
• JS(babel-loader) + TS(awesome-ts-loader)
• Flow + —allowJS
• `in`
• TS JS TS babel-loader
• TS JS TS babel-loader
• babel-transform-runtime
• TS JS TS babel-loader
• babel-transform-runtime
• TS JS Map, Set
• TS JS TS babel-loader
• babel-transform-runtime
• TS JS Map, Set
•
• Global State
• babel
• —allowJs Flow JS
• error TS8010: 'types' can only be used in a .ts file.
• https://github.com/flowtype/flow-remove-types
• flow
•
• … ( )
• https://github.com/Microsoft/
TypeScript/issues/10485
• 

• Workaround 1

-> Disjoint Union
• Workaround 2

-> hasKey ( @pelotom)
• optional X
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
• ?
• , ?
• TypeScript ?
• ?
• ?
• ?
• , .
• , TypeScript .
• , .
• Webpack .
• .
• , . !
. .
• , .
• , TypeScript .
• , .
• Webpack .
• .
• , . !
ahnheejong.name | github.com/hejeongahn | twitter.com/heejongahn
TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기
• To Type or Not to Type: Quantifying Detectable Bugs in JavaScript
• TypeScript Design Goals
• Github Octoverse 2017
• Trade-offs in Control Flow Analysis #9998
• Treat `in` operator as type guard #10485
• Various TypeScript & VS Code release notes
• Why We Chose TypeScript
• TypeScript at Lyft
• Flow and TypeScript
• TypeScript vs. Flow
• Flow vs. TypeScript
• Type Systems for JavaScript: Elm, Flow, and TypeScript

More Related Content

PDF
톰캣 운영 노하우
PPTX
Airflow를 이용한 데이터 Workflow 관리
PDF
Spring Data JPA from 0-100 in 60 minutes
PPT
Spring data presentation
PDF
Building Advanced XSS Vectors
PDF
글로벌 게임 플랫폼에서 무정지, 무점검 서버 개발과 운영 사례
PDF
NextJS, A JavaScript Framework for building next generation SPA
PPTX
Server side rendering review
톰캣 운영 노하우
Airflow를 이용한 데이터 Workflow 관리
Spring Data JPA from 0-100 in 60 minutes
Spring data presentation
Building Advanced XSS Vectors
글로벌 게임 플랫폼에서 무정지, 무점검 서버 개발과 운영 사례
NextJS, A JavaScript Framework for building next generation SPA
Server side rendering review

What's hot (20)

PDF
Neat tricks to bypass CSRF-protection
PDF
서버학개론(백엔드 서버 개발자를 위한)
PDF
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
PPT
Jsp/Servlet
PDF
Api presentation
PDF
[232] 성능어디까지쥐어짜봤니 송태웅
PPTX
Tutorial: Using GoBGP as an IXP connecting router
PPTX
Spring Boot and REST API
PPTX
TypeScript intro
KEY
Web API Basics
PDF
PostGIS 시작하기
PDF
Optimizing {Java} Application Performance on Kubernetes
PPTX
Node.js Express
PDF
Explore Android Internals
PPTX
Spark Sql and DataFrame
PDF
JAX-RS 2.0: RESTful Web Services
PDF
REST APIs with Spring
PPTX
REST API
PPTX
Spring Security 5
Neat tricks to bypass CSRF-protection
서버학개론(백엔드 서버 개발자를 위한)
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
Jsp/Servlet
Api presentation
[232] 성능어디까지쥐어짜봤니 송태웅
Tutorial: Using GoBGP as an IXP connecting router
Spring Boot and REST API
TypeScript intro
Web API Basics
PostGIS 시작하기
Optimizing {Java} Application Performance on Kubernetes
Node.js Express
Explore Android Internals
Spark Sql and DataFrame
JAX-RS 2.0: RESTful Web Services
REST APIs with Spring
REST API
Spring Security 5
Ad

Viewers also liked (7)

PDF
Redis From 2.8 to 4.x
PDF
AWS Lambda를 기반으로한 실시간 빅테이터 처리하기
PDF
Python 게임서버 안녕하십니까 : RPC framework 편
PDF
인프런 - 스타트업 인프랩 시작 사례
PPTX
소프트웨어 공부하는법
PDF
Node.js API 서버 성능 개선기
PDF
책 읽어주는 딥러닝: 배우 유인나가 해리포터를 읽어준다면 DEVIEW 2017
Redis From 2.8 to 4.x
AWS Lambda를 기반으로한 실시간 빅테이터 처리하기
Python 게임서버 안녕하십니까 : RPC framework 편
인프런 - 스타트업 인프랩 시작 사례
소프트웨어 공부하는법
Node.js API 서버 성능 개선기
책 읽어주는 딥러닝: 배우 유인나가 해리포터를 읽어준다면 DEVIEW 2017
Ad

Similar to TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기 (20)

PDF
PDF
Flow or Type - how to React to that?
PDF
Safer JS Codebases with Flow
PDF
James Baxley - Statically typing your GraphQL app
PPTX
Static Type Checking with FlowJs
PDF
Helen Zhukova "JS static typing. What and why."
PPTX
SubmitJS: Is react + redux + typescript a good combination? Dmytro Beseda
PDF
Clean & Typechecked JS
PPTX
Getting started with typescript
PDF
TypeScriptについて
PPTX
HItchhickers Guide to TypeScript
PPTX
Type script - advanced usage and practices
PDF
Gabriele Petronella - FP for front-end development: should you care? - Codemo...
PDF
Introduction to TypeScript
PDF
Power Leveling your TypeScript
PDF
Structure on a freeform world
PDF
TypeScript 101 - We RISE Tech Conference
PDF
Programming TypeScript Making your JavaScript applications scale Boris Cherny
PDF
Introduction to typescript
PDF
Milano JS Meetup - Gabriele Petronella - Codemotion Milan 2016
Flow or Type - how to React to that?
Safer JS Codebases with Flow
James Baxley - Statically typing your GraphQL app
Static Type Checking with FlowJs
Helen Zhukova "JS static typing. What and why."
SubmitJS: Is react + redux + typescript a good combination? Dmytro Beseda
Clean & Typechecked JS
Getting started with typescript
TypeScriptについて
HItchhickers Guide to TypeScript
Type script - advanced usage and practices
Gabriele Petronella - FP for front-end development: should you care? - Codemo...
Introduction to TypeScript
Power Leveling your TypeScript
Structure on a freeform world
TypeScript 101 - We RISE Tech Conference
Programming TypeScript Making your JavaScript applications scale Boris Cherny
Introduction to typescript
Milano JS Meetup - Gabriele Petronella - Codemotion Milan 2016

More from Heejong Ahn (7)

PDF
플렉스팀 프론트엔드 기술 스택의 이해: `lint`, `build`, `run`
PDF
프로그래머의 배움
PDF
Being a Multiplier
PDF
Hello, React Hooks!
PDF
Pure UI
PDF
더 나은 팀을 위하여
PDF
Just Enough Category Theory for Haskell, part 1
플렉스팀 프론트엔드 기술 스택의 이해: `lint`, `build`, `run`
프로그래머의 배움
Being a Multiplier
Hello, React Hooks!
Pure UI
더 나은 팀을 위하여
Just Enough Category Theory for Haskell, part 1

Recently uploaded (20)

PPTX
From Curiosity to ROI — Cost-Benefit Analysis of Agentic Automation [3/6]
PDF
Human Computer Interaction Miterm Lesson
PDF
“Introduction to Designing with AI Agents,” a Presentation from Amazon Web Se...
PDF
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...
PDF
Altius execution marketplace concept.pdf
PDF
【AI論文解説】高速・高品質な生成を実現するFlow Map Models(Part 1~3)
PPTX
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
PDF
NewMind AI Journal Monthly Chronicles - August 2025
PDF
TicketRoot: Event Tech Solutions Deck 2025
PDF
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
PDF
Addressing the challenges of harmonizing law and artificial intelligence tech...
PPT
Overviiew on Intellectual property right
PDF
Decision Optimization - From Theory to Practice
PDF
The Digital Engine Room: Unlocking APAC’s Economic and Digital Potential thro...
PDF
Child-friendly e-learning for artificial intelligence education in Indonesia:...
PDF
Technical Debt in the AI Coding Era - By Antonio Bianco
PDF
Intravenous drug administration application for pediatric patients via augmen...
PDF
Domain-specific knowledge and context in large language models: challenges, c...
PDF
Be ready for tomorrow’s needs with a longer-lasting, higher-performing PC
PDF
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
From Curiosity to ROI — Cost-Benefit Analysis of Agentic Automation [3/6]
Human Computer Interaction Miterm Lesson
“Introduction to Designing with AI Agents,” a Presentation from Amazon Web Se...
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...
Altius execution marketplace concept.pdf
【AI論文解説】高速・高品質な生成を実現するFlow Map Models(Part 1~3)
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
NewMind AI Journal Monthly Chronicles - August 2025
TicketRoot: Event Tech Solutions Deck 2025
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
Addressing the challenges of harmonizing law and artificial intelligence tech...
Overviiew on Intellectual property right
Decision Optimization - From Theory to Practice
The Digital Engine Room: Unlocking APAC’s Economic and Digital Potential thro...
Child-friendly e-learning for artificial intelligence education in Indonesia:...
Technical Debt in the AI Coding Era - By Antonio Bianco
Intravenous drug administration application for pediatric patients via augmen...
Domain-specific knowledge and context in large language models: challenges, c...
Be ready for tomorrow’s needs with a longer-lasting, higher-performing PC
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf

TypeScript와 Flow: 
자바스크립트 개발에 정적 타이핑 도입하기