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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kaito Fujimura
May 11, 2024
Technology
1
550
SWC Transformerから見るTypeScript関数記述ベストプラクティス
Kaito Fujimura
May 11, 2024
Tweet
Share
More Decks by Kaito Fujimura
See All by Kaito Fujimura
iPhone Eye Tracking機能から学ぶやさしいアクセシビリティ
fujiyamaorange
0
1k
Other Decks in Technology
See All in Technology
WebアクセシビリティをCI/CDで担保する ― axe DevTools × Playwright C#実践ガイド
tomokusaba
2
170
AIエージェント、 社内展開の前に知っておきたいこと
oracle4engineer
PRO
2
150
AI駆動AI普及活動 ~ 社内AI活用の「何から始めれば?」をAIで突破する
oracle4engineer
PRO
1
110
AWSの資格って役に立つの?
tk3fftk
2
360
品質を経営にどう語るか #jassttokyo / Communicating the Strategic Value of Quality to Executive Leadership
kyonmm
PRO
2
490
わからなくて良いなら、わからなきゃだめなの?
kotaoue
1
370
決済サービスを支えるElastic Cloud - Elastic Cloudの導入と推進、決済サービスのObservability
suzukij
2
660
AI時代の「本当の」ハイブリッドクラウド — エージェントが実現した、あの頃の夢
ebibibi
0
150
NewSQL_ ストレージ分離と分散合意を用いたスケーラブルアーキテクチャ
hacomono
PRO
4
390
Yahoo!ショッピングのレコメンデーション・システムにおけるML実践の一例
lycorptech_jp
PRO
1
220
会社紹介資料 / Sansan Company Profile
sansan33
PRO
16
410k
最強のAIエージェントを諦めたら品質が上がった話 / how quality improved after giving up on the strongest AI agent
kt2mikan
0
190
Featured
See All Featured
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Raft: Consensus for Rubyists
vanstee
141
7.4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Rails Girls Zürich Keynote
gr2m
96
14k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.9k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.4k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
980
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
130
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.5k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
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