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
SWC Transformerから見るTypeScript関数記述ベストプラクティス
Search
Fujimura Kaito
May 11, 2024
Technology
1
220
SWC Transformerから見るTypeScript関数記述ベストプラクティス
Fujimura Kaito
May 11, 2024
Tweet
Share
Other Decks in Technology
See All in Technology
온디바이스 AI 및 로컬 AI의 도전 과제 / Challenges of On-Device AI and Local AI
inureyes
PRO
0
780
Mutation Testingを活用して テスト品質を考える /introduction to mutation testing
kakehashi
3
380
監視網ルータにSONiCを採用して機器更改してみた
sonic
0
140
AWS でのクラウド時代のログ活用
itotsum
1
120
BigQuery データ キャンバスでデータモデリングしてみた / I tried data modeling with BigQuery Data Canvas
sansan_randd
4
650
まずは開発組織を整えるところからはじめる
ichimichi
0
110
意義から考えるObservability入門 #srenext
stefafafan
2
820
SREがいない”今いる場所”で 「SRE」について聞いて、考えてみた
maimyyym
1
210
データベース06: SQL (3/3) 副問い合わせ
trycycle
0
120
TCPポート使い切り事件
motooka
1
120
プロダクトオーナー向け生成AI支援サービスの仮説検証事例
yosuke_matsuura
PRO
1
190
巨大ガジェット買ってみた
2bo
0
270
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
69
8.7k
Embracing the Ebb and Flow
colly
80
4.2k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
Building Applications with DynamoDB
mza
88
5.7k
YesSQL, Process and Tooling at Scale
rocio
165
13k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
22
1.5k
How to train your dragon (web standard)
notwaldorf
76
5.3k
Creatively Recalculating Your Daily Design Routine
revolveconf
211
11k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
16
1.6k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
Side Projects
sachag
451
41k
Transcript
SWC Transformer TypeScript TSKaigi 2024 @fujiyamaorange
Pay / Biome Utility Types Pick Pay for Business fujiyamaorange
TypeScript SWC Transform emit
None
None
Function Expression Arrow Function Function Declaration
None
SWC Transformer
TypeScript SWC Transform emit
SWC ~Speedy Web Compiler~ Next.js 12 Rust Babel 17 Rust
SWC (TypeScript Babel )
SWC Transformer
React 3 ※React =JSX alt data-testid
Before After
Before After alt
Before After data-testid
None
TypeScript SWC Transform emit
20.93s 22.78s 22.59s Transform 12000 React cargo test --example --
--test-threads=1 Transform
SWC Transformer
I/O
20.93s 22.78s 22.59s 17.70s 19.56s 19.31s (Transform) 3.23s 3.22s 3.28s
Transform
Transform ( )
Transform
Transform SWC fork SWC create
Transform SWC fork SWC create
( ) parse 919.22ms 959.42ms 929.58ms 931.66ms transform 56.26ms 61.25ms
58.77ms 15.72ms emit 8.75s 9.70s 9.56s 7.22s all 20.93s 22.78s 22.59s 17.70s ※
TypeScript SWC Transform emit
emit e.#mtd_name(self) mtd_name SWC AST Node SWC 200 AST Node
( : →FnDecl)
FnDecl AST emit!
emit AST Node AST emit
None
TypeScript SWC Transform emit
None
TypeScript (function) (function expression) (Arrow function expressions) SWC SWC Next.js
Compiler Trait swc_ecma_visit::VisitMut TSKaigi Canva ~Gray Purple Isometric Elements & Mockups 5G Technology Technology Presentation~ carbon