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
girigiribauer
April 03, 2019
Technology
660
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
84
Figma デザインを自動マークアップさせた記録と肌感 / 20260425-nagaoka-tech-junction-1
girigiribauer
0
98
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
330
移動は善 / 20260124-NGK2026S
girigiribauer
1
230
Google Antigravity を使ってみた肌感 / 20251130-ai-craft-hacks-niigata
girigiribauer
0
120
なんとなく使っていたクリップボードの不思議 / 20250926-niigata-5min-tech
girigiribauer
1
110
タスクにもストック型・フロー型があるということに Todoist を使い始めて気づいた話 / 20250725-niigata-5min-tech
girigiribauer
0
110
Bluesky のフィードを作ろう / 20250620-niigata-5min-tech
girigiribauer
0
87
『Bluesky 公式アカウント移行まとめ』のアップデートをした話 / 20241018-niigata-5min-tech
girigiribauer
0
150
Other Decks in Technology
See All in Technology
大型犬好きによるPugの紹介
yamanoku
1
160
AI時代のPRレビューにどう向き合うか?
kairim0
1
240
アウトプット初心者、半年間のふりかえり
4o1sobblue
0
430
しろおびから始める!ログ活用の第一歩
shumei_ito
0
950
会社説明資料
persolserverworks
0
9.8k
PHPカンファレンス関西の招待状 / Invitation to PHP Conference Kansai
ykanoh
0
110
[JAWS-UG彩の国埼玉#12]そろそろ準備する?re:Invent2026をやさしく解説 / reinvent2026-sainokuni
sh_fk2
1
340
Getting Started with Google Antigravity
glaforge
0
300
脆弱性診断って、何をしているの? 〜弱点を見つけて、会社の改善につなげるまで〜
keeg
0
920
QA4AI 2026-Oct 生成AI時代の品質保証
tokuty
1
860
1つのリクエストを追って理解する - llm-dのP/D分離
akhino
1
160
Kiro Crewをはじめよう
kizawa2020
1
160
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
41
2.8k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
340
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
A designer walks into a library…
pauljervisheath
211
25k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Skip the Path - Find Your Career Trail
mkilby
1
260
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
Facilitating Awesome Meetings
lara
57
7.2k
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) Λτϥόʔγϯάͯ͘͠ΕΔ ͭ͋ΔʢผͷػձͰ୭͔͕Δ…!ʣ
まとめ • Ͳ͏͍͏ϓϦηοτ͕͋ΔͱΑΓֶͼ͕͋Δ ͔ɺ୭͔ڭ͑ͯ΄͍͠ • ໊ݹͰʰϑϩϯτΤϯυ͘͘ձʱΛ ຖ݄ͬͯΔΑʂ͜͏͍͏ͷ͘͘͢Δͱ ͍͍Αʂ