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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
SVG だけで Web サイトを作ってみた話 / 20261030-niigata-5min-tech
girigiribauer
0
61
続・BlueskyとXにクロスポストするツールを作った / 20260619-niigata-5min-tech
girigiribauer
0
97
Figma デザインを自動マークアップさせた記録と肌感 / 20260425-nagaoka-tech-junction-1
girigiribauer
0
110
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
340
移動は善 / 20260124-NGK2026S
girigiribauer
1
240
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
94
Other Decks in Technology
See All in Technology
Kiro を使うコツ (頼み方、覚えさせ方、任せ方) | 目指せ Kiro マスター 09
inariku
PRO
3
130
少ない人手 限られた予算 それでも守る 消せない・見つける・戻れる オールハザード型BCP on AWS / 20261107 Mitsutoshi Matsuo
shift_evolve
PRO
0
340
仕様と現実の間で落とし所を探るリモートMCPの認証・認可 — Sansanの認証基盤における課題と実践
sansantech
PRO
2
240
AI時代に求められる優秀なTechLeadの振る舞い
pospome
11
16k
続・ソフトウェアアーキテクトのための意思決定術: Decision Readiness, Revisited — When AI Changes the Economics of Software Architecture
snoozer05
PRO
9
2.8k
FinOpsを導入してマルチプロダクトのコスト最適化を実現する
kworkdev
PRO
0
140
【dbts2026】AIエージェントの 判断と探索を変える、 データベース エンジニアリング― 既存DBの処理と依存関係から作る、オペレーショナルオントロジー ―
shisyu_gaku
0
280
re:Invent2026 事前勉強会 歴史と愉しみ方10分LT編
toshi_atsumi
0
180
自治体AIコンタクトセンター、何をどこに任せる?~Amazon Connect Customer +Amazon Bedrockの実践知~ / 20261107 Satoshi Torano
shift_evolve
PRO
1
130
Cloudflareの向き先
chimame
1
170
Copilot Coworkで「みのるん式」やってみた
minorun365
PRO
2
1.7k
Kiro Crew の Bot (続く役目を任せる窓口) | 目指せ Kiro マスター 12
inariku
PRO
2
360
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Building Applications with DynamoDB
mza
96
7.3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Documentation Writing (for coders)
carmenintech
77
5.6k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
560
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
590
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
820
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
Color Theory Basics | Prateek | Gurzu
gurzu
1
520
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
620
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) Λτϥόʔγϯάͯ͘͠ΕΔ ͭ͋ΔʢผͷػձͰ୭͔͕Δ…!ʣ
まとめ • Ͳ͏͍͏ϓϦηοτ͕͋ΔͱΑΓֶͼ͕͋Δ ͔ɺ୭͔ڭ͑ͯ΄͍͠ • ໊ݹͰʰϑϩϯτΤϯυ͘͘ձʱΛ ຖ݄ͬͯΔΑʂ͜͏͍͏ͷ͘͘͢Δͱ ͍͍Αʂ