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
310
SWC Transformerから見るTypeScript関数記述ベストプラクティス
Kaito Fujimura
May 11, 2024
Tweet
Share
Other Decks in Technology
See All in Technology
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
1
160
AWS版GitHub?Amazon CodeCatalystの全体像をまとめてみた
oshanqq
1
3.2k
React Aria で実現する次世代のアクセシビリティ
ryo_manba
3
290
Dojo 20240830 COBOL to Java on Z
ichikawayasuhisa
0
240
GraphQLとスキーマファーストで切り開く ライドシェアの未来
ku0522a
0
490
Practical GenAI with Go - Elastic and Golang Sydney
adriancole
0
130
EitherT_with_Future
aoiroaoino
0
380
OCI コスト管理
ocise
1
110
標準最高!標準はださくないぞ! at fukuoka.ts #1
yoiwamoto
0
150
Evolving DevOps Teams and Flexible Organizational Culture
kakehashi
1
130
Namespace, Now and Then
tagomoris
0
170
実践ジオフェンス 効率的に開発するために
navitimejapan
PRO
2
130
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
18
2.9k
RailsConf 2023
tenderlove
26
790
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Making Projects Easy
brettharned
113
5.8k
Debugging Ruby Performance
tmm1
72
12k
How to Think Like a Performance Engineer
csswizardry
15
910
Optimizing for Happiness
mojombo
375
69k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
165
48k
A designer walks into a library…
pauljervisheath
201
24k
What's new in Ruby 2.0
geeforr
340
31k
Fireside Chat
paigeccino
31
2.9k
Build The Right Thing And Hit Your Dates
maggiecrowley
29
2.2k
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