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 から JavaScript への変換が見えやすくするビューワーを作った話...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
68
Figma デザインを自動マークアップさせた記録と肌感 / 20260425-nagaoka-tech-junction-1
girigiribauer
0
87
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
310
移動は善 / 20260124-NGK2026S
girigiribauer
1
190
Google Antigravity を使ってみた肌感 / 20251130-ai-craft-hacks-niigata
girigiribauer
0
98
なんとなく使っていたクリップボードの不思議 / 20250926-niigata-5min-tech
girigiribauer
1
89
タスクにもストック型・フロー型があるということに Todoist を使い始めて気づいた話 / 20250725-niigata-5min-tech
girigiribauer
0
100
Bluesky のフィードを作ろう / 20250620-niigata-5min-tech
girigiribauer
0
78
『Bluesky 公式アカウント移行まとめ』のアップデートをした話 / 20241018-niigata-5min-tech
girigiribauer
0
140
Other Decks in Technology
See All in Technology
AWS環境のセキュリティ不安を解消した企業事例 ~よくある課題と対策を一挙公開~
asanoharuki
1
280
QAタスクをスキル化したいときに考えること
aomoriringo
0
150
Webの技術とガジェットで子どもも大人も楽しめるワクワク体験を提供する / Qiita Tech Festa Day 2026
you
PRO
1
330
「待ち時間」の消滅と「自我消耗」の加速:生成AI時代のエンジニアを救うメンタル・リソース管理
poropinai1966
0
400
AIがコードを書く時代、人間は何を保証するのか———馬場さんと考える、開発者に求められる新しい責任と価値 - TECH PLAY
netmarkjp
0
1.2k
[MIRU26] To What Extent Does MLLM-as-a-Judge Exhibit Cross-Model Preference Bias?
keio_smilab
PRO
0
170
システム監視入門
grimoh
5
800
LangfuseによるLLMOps基盤の構築と活用事例
zozotech
PRO
1
250
SnowflakeCoCoでデータエンジニアリング!
foursue
0
120
セキュリティ研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
32
28k
なぜ、あなたのエージェントは言うことを聞かないのか
segavvy
1
620
PLaMo 3.0 Primeの事後学習
pfn
PRO
0
260
Featured
See All Featured
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.8k
30 Presentation Tips
portentint
PRO
1
360
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
230
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
450
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
560
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
240
Designing for Timeless Needs
cassininazir
1
430
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
190
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
470
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
160
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
420
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) Λτϥόʔγϯάͯ͘͠ΕΔ ͭ͋ΔʢผͷػձͰ୭͔͕Δ…!ʣ
まとめ • Ͳ͏͍͏ϓϦηοτ͕͋ΔͱΑΓֶͼ͕͋Δ ͔ɺ୭͔ڭ͑ͯ΄͍͠ • ໊ݹͰʰϑϩϯτΤϯυ͘͘ձʱΛ ຖ݄ͬͯΔΑʂ͜͏͍͏ͷ͘͘͢Δͱ ͍͍Αʂ