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
ECMAScript、Web標準の型はどう管理されているか / How ECMAScript ...
Search
petamoriken / 森建
August 30, 2024
Programming
3
510
ECMAScript、Web標準の型はどう管理されているか / How ECMAScript and Web standards types are maintained
fukuoka.ts #1(オンライン)
https://fukuoka-ts.connpass.com/event/320038/
petamoriken / 森建
August 30, 2024
Tweet
Share
More Decks by petamoriken / 森建
See All by petamoriken / 森建
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
470
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
210
フロントエンドの標準仕様をどう追っているか / How I follow the frontend standards specs
petamoriken
4
1.8k
DOM Observable
petamoriken
1
230
Deno に Web 標準 API を実装する / Implementing Web standards API to Deno
petamoriken
0
640
Contributing to Deno is fun!
petamoriken
0
330
Stage 2 Decorators の変遷 / Stage 2 Decorators history
petamoriken
0
6.6k
linaria: Zero-Runtime CSS in JS
petamoriken
2
2.3k
ESNext の議論に参加しよう / Join the ESNext discussion
petamoriken
3
830
Other Decks in Programming
See All in Programming
Modern Angular with Signals and Signal StoreNew Rules for Your Architecture @bastacon 2025 in Frankfurt
manfredsteyer
PRO
0
160
Better Code Design in PHP
afilina
0
190
From the Wild into the Clouds - Laravel Meetup Talk
neverything
0
190
CDKを使ったPagerDuty連携インフラのテンプレート化
shibuya_shogo
0
130
Rails 1.0 のコードで学ぶ find_by* と method_missing の仕組み / Learn how find_by_* and method_missing work in Rails 1.0 code
maimux2x
1
280
自力でTTSモデルを作った話
zgock999
0
140
はじめての Go * WASM * OCR
sgash708
1
140
AWS CDKにおけるL2 Constructの仕組み / aws-cdk-l2-construct
gotok365
4
500
バッチを作らなきゃとなったときに考えること
irof
2
580
Drawing Heighway’s Dragon- Recursive Function Rewrite- From Imperative Style in Pascal 64 To Functional Style in Scala 3
philipschwarz
PRO
0
190
DevNexus - Create AI Infused Java Apps with LangChain4j
kdubois
0
150
はじめてのIssueOps - GitHub Actionsで実現するコメント駆動オペレーション
tmknom
7
1.8k
Featured
See All Featured
A better future with KSS
kneath
238
17k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Automating Front-end Workflow
addyosmani
1369
200k
RailsConf 2023
tenderlove
29
1k
A Tale of Four Properties
chriscoyier
158
23k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.4k
Adopting Sorbet at Scale
ufuk
75
9.2k
Why Our Code Smells
bkeepers
PRO
336
57k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Producing Creativity
orderedlist
PRO
344
40k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Transcript
ECMAScript、Web 標準の型は どう管理されているか fukuoka.ts #1 pixiv Inc. 森内建太 petamoriken 2024.8.30
2 自己紹介 • Web エンジニア • Deno コントリビューター • ECMAScript や Web 標準 を追うのが好き petamoriken カスタマーオペレーション
&セーフティ本部 オペレーション開発部
3
4 © ンバヂ https://x.com/nbaji9 https://www.nicovideo.jp/watch/sm42515407
5 tsconfig.json の compilerOptions.lib で指定する • ECMAScript ◦ “ES2023” や “ESNext” • Web 標準 ◦ “DOM” や “DOM.Iterable”
TypeScript の組み込み型定義
6 tsconfig.json
7 microsoft/TypeScript の src/lib 内にある 組み込み型定義の実態
8 • ECMAScript ◦ 型の追加、修正は手作業 • Web 標準 ◦ 2つ以上のブラウザに実装された型が自動更新 ◦
microsoft/TypeScript-DOM-lib-generator 組み込み型定義の実態
(余談)ES2024 の型を実装中 9
10 Mozilla の saschanaz さんによる管理 2つ以上のブラウザで実装された型が自動更新 • TypeScript へはバージョンアップ時に取り込まれる • 最新の型を使いたい場合は @types/web へ TypeScript-DOM-lib-generator
11 w3c/webref から最新の Web IDL を JSON で取得 TypeScript-DOM-lib-generator の仕組み
12 Browser Compat Data と突合する • ブラウザの実装状況や廃止された API かを調べる TypeScript-DOM-lib-generator の仕組み
13
14 最後にパッチを当てて型ファイルを生成 • イベント名のマッピング(文字列リテラル型対応) • ジェネリクス対応 などなど TypeScript-DOM-lib-generator の仕組み
15
16 TypeScript の組み込み型定義について • ECMAScript の型の追加、修正は手作業 • Web 標準の型は自動更新 ◦ Web IDL と Browser Compat
Data を使っている まとめ