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
TypeScript から JavaScript への変換が見えやすくするビューワーを作った話...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
girigiribauer
April 03, 2019
Technology
650
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TypeScript から JavaScript への変換が見えやすくするビューワーを作った話 / 20190403-typescript-studying
雑でごめんなさい
girigiribauer
April 03, 2019
More Decks by girigiribauer
See All by girigiribauer
続・BlueskyとXにクロスポストするツールを作った / 20260619-niigata-5min-tech
girigiribauer
0
76
Figma デザインを自動マークアップさせた記録と肌感 / 20260425-nagaoka-tech-junction-1
girigiribauer
0
93
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
320
移動は善 / 20260124-NGK2026S
girigiribauer
1
220
Google Antigravity を使ってみた肌感 / 20251130-ai-craft-hacks-niigata
girigiribauer
0
110
なんとなく使っていたクリップボードの不思議 / 20250926-niigata-5min-tech
girigiribauer
1
96
タスクにもストック型・フロー型があるということに Todoist を使い始めて気づいた話 / 20250725-niigata-5min-tech
girigiribauer
0
110
Bluesky のフィードを作ろう / 20250620-niigata-5min-tech
girigiribauer
0
83
『Bluesky 公式アカウント移行まとめ』のアップデートをした話 / 20241018-niigata-5min-tech
girigiribauer
0
150
Other Decks in Technology
See All in Technology
アプリをもっと"iOSアプリっぽく"する小さな工夫 / Small Touches That Make Your App Feel More Like an iOS App
matsuji
2
930
Claude Codeを「使うほど育つ」AI秘書にするノウハウ
minorun365
PRO
31
26k
[2026-09-11]SREは誰のもの?運用エンジニアが始める 「SRE領域への越境」とチームの進化の軌跡 〜Road to NEXT CRE
tosite
0
290
AI時代、データエンジニアが一番おもろい
genshun9
0
630
What the customer really needed
kawaguti
PRO
3
200
aws-iot-platform-architecture-use-cases.pdf
ma2shita
0
240
作品が生態系になった ─ Mini Tokyo 3D から世界へ
nagix
0
190
ユーザー価値を届け続けるためにウォンテッドリーが大切にしている文化
kotaminato
0
170
作って終わりじゃないサーバーレス 〜9年運用する大規模EC物流API基盤の設計・運用のリアル〜
zozotech
PRO
0
110
エージェントはローカル、検証はMicroVM — Lambda MicroVMsでつくるServerless CI
fujioka6789
1
100
AIによるクリエイティブ生成を行う上での試行錯誤
plaidtech
PRO
0
160
登壇の自信を奪う3匹のオバケ / 3 Ghosts That Rob You of Your Confidence in Public Speaking
pauli
9
980
Featured
See All Featured
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
700
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
670
How to make the Groovebox
asonas
2
2.4k
New Earth Scene 8
popppiees
4
2.6k
Code Reviewing Like a Champion
maltzj
528
40k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Become a Pro
speakerdeck
PRO
31
6.3k
The Curious Case for Waylosing
cassininazir
1
510
Context Engineering - Making Every Token Count
addyosmani
9
1.1k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
A Soul's Torment
seathinner
8
3.6k
Transcript
TypeScript から JavaScript への 変換が見えやすくする ビューワーを作った話 2019/04/03 TypeScript ษڧձ @girigiribauer
\ 沖縄から来ました /
ts2js-viewer を雑に作った • TypeScript ͕ JavaScript ʹͲͷΑ͏ʹ ม͞ΕΔ͔ɺखؒΛ͔͚ͣʹαΫοͱ ֬ೝ͍ͨ͠ •
https://ts2js-viewer.netlify.com/ ʹ্͛·ͨ͠
左に書いたら、右に出るやつ
変換が分かりやすい! • Enum ͷڍಈͱ͔ʢkey, value ͕ަޓʹೖΔʣ • ܕ͕શ෦֎ΕΔͱ͔ • async
/ await ͕ͿΘͬͱ͘ͳΔͱ͔ ࡶʹ࡞ͬͨϨϕϧͳͷͰɺ ϓϦηοτͷίʔυϕλॻ͖ͩ͠ɺ ʮ͜͏͍͏ม͋ͬͨํ͕͍͍Μ͡Όͳ͍ʁʯ Έ͍ͨͳͷ͕શવཏͰ͖ͯ·ͤΜ
How to use • import * as ts from “typescript";
Ͱ ࡶʹಡΈࠐΜͰͬͪΌ͏ • `npm i typescript` ͩͱ warning ͰͪΌ͏ global ʹΠϯετʔϧͨ͠ͷΛ `npm link` ͯ͠͏ͷ͕ຊདྷͷ͍ํͬΆ͍
Using the Compiler API • https://github.com/Microsoft/TypeScript/ wiki/Using-the-Compiler-API • ts.transpileModule(code, options)
͕γϯϓϧ • γϯϓϧʹม͢Δͭͷଞʹɺ நߏจ (AST) Λτϥόʔγϯάͯ͘͠ΕΔ ͭ͋ΔʢผͷػձͰ୭͔͕Δ…!ʣ
まとめ • Ͳ͏͍͏ϓϦηοτ͕͋ΔͱΑΓֶͼ͕͋Δ ͔ɺ୭͔ڭ͑ͯ΄͍͠ • ໊ݹͰʰϑϩϯτΤϯυ͘͘ձʱΛ ຖ݄ͬͯΔΑʂ͜͏͍͏ͷ͘͘͢Δͱ ͍͍Αʂ