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
210
SWC Transformerから見るTypeScript関数記述ベストプラクティス
Fujimura Kaito
May 11, 2024
Tweet
Share
Other Decks in Technology
See All in Technology
Angular Signals under the Hood
fabiangosebrink
0
220
Platform Engineering on Serverless
_kensh
3
420
はてなのSRE組織2024 / Road to SRE NEXT@福岡
cohalz
1
540
[JSAI24] Attention Lattice Adapter: Visual Explanation for Vision-Language Foundation Models
keio_smilab
PRO
0
130
GopherDay Taiwan 2024 - 利用 Gemini Pro 與 Golang 打造創新智能的 LINE Bot 應用
line_developers_tw
PRO
0
230
OpenFOAM(自宅ではじめる流体解析)
kamakiri1225
0
140
Capacitor製のWebViewアプリからReact Native製のハイブリッドアプリへ
yukukotani
4
620
Oracle Database 23ai セキュリティ新機能
oracle4engineer
PRO
1
1.9k
Re:ゼロから始める Observability
nenonaninu
1
360
SRECon 2024 Keynote: Is It Already Time To Version Observability? (Signs Point To Yes)
charity
2
130
Databricksにおける生成AIの取り組み
taka_aki
1
140
.NET 8 New Features with Code Examples
_mertmetin
0
190
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
Why Our Code Smells
bkeepers
PRO
331
56k
Docker and Python
trallard
35
2.8k
Making the Leap to Tech Lead
cromwellryan
125
8.6k
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
Building a Modern Day E-commerce SEO Strategy
aleyda
22
6.5k
Clear Off the Table
cherdarchuk
86
310k
Visualization
eitanlees
137
14k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
Teambox: Starting and Learning
jrom
128
8.5k
Code Review Best Practice
trishagee
56
16k
Building Your Own Lightsaber
phodgson
100
5.8k
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