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
Kaito Fujimura
May 11, 2024
Technology
1
470
SWC Transformerから見るTypeScript関数記述ベストプラクティス
Kaito Fujimura
May 11, 2024
Tweet
Share
Other Decks in Technology
See All in Technology
GitHub Coding Agent 概要
kkamegawa
1
990
カンファレンスのつくりかた / The Conference Code: What Makes It All Work
tomzoh
7
800
AIエージェントデザインパターンの選び方
almondo_event
0
110
AIオンボーディングとAIプロセスマイニング
nrryuya
5
1.1k
Eight Engineering Unit 紹介資料
sansan33
PRO
0
3.1k
Oracle Database オプティマイザ・ヒントの活用
oracle4engineer
PRO
1
130
面接を通過するためにやってて良かったこと3選
sansantech
PRO
0
100
Introduction to Bill One Development Engineer
sansan33
PRO
0
230
研究開発部メンバーの働き⽅ / Sansan R&D Profile
sansan33
PRO
3
17k
Oracle Cloud Infrastructure:2025年5月度サービス・アップデート
oracle4engineer
PRO
0
280
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
1
7.1k
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
2.6k
Featured
See All Featured
Music & Morning Musume
bryan
47
6.5k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Facilitating Awesome Meetings
lara
54
6.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.7k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Designing for humans not robots
tammielis
253
25k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Product Roadmaps are Hard
iamctodd
PRO
53
11k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
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