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
TSConfig Solution Style & subpath imports to sw...
Search
South
May 22, 2025
Programming
350
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TSConfig Solution Style & subpath imports to switch types on a per-file basis
South
May 22, 2025
More Decks by South
See All by South
Automating Web Accessibility Testing with AI Agents
maminami373
1
2k
JSConf JP 2022 introduce React Query
maminami373
2
7.4k
Front-end rearchitect SPA
maminami373
0
560
JSConf jp 2021 kaonavi front-end development in the monolithic service
maminami373
1
270
単体テストゼロからテスト文化を醸成させた話 / Fostering the testing culture
maminami373
0
2.5k
Other Decks in Programming
See All in Programming
私のClaude Code活用法 (個人開発編) - PHPerKaigi mini #4(2026/08/24)
panda_program
1
160
仕様駆動開発の消費期限
watany
20
9k
Go 1.27 における memory allocation の高速化
andpad
0
320
引き算の組織 ― アウトカムとAIに全振りするために辞めたこと ― / Organization by Subtraction
hirokiyamamoto14
PRO
0
300
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
250
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
280
VibeCodingからAgenticWorkflowへ
starfish719
0
870
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
260
ソフトウェアエンジニアにとっての生成AI - 特性を知って使い倒す / generative ai for software enginner
kishida
7
2.1k
【デモ】Kiroで体験する仕様駆動開発|設計からコーディングまでAIと進める開発フロー
cmkudo
0
390
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
1.2k
MySQLとPostgreSQLって何が違うの?
akagami
0
140
Featured
See All Featured
The Language of Interfaces
destraynor
162
27k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
900
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
57k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
The Invisible Side of Design
smashingmag
301
52k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
430
WENDY [Excerpt]
tessaabrams
11
39k
Evolving SEO for Evolving Search Engines
ryanjones
0
260
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Abbi's Birthday
coloredviolet
3
9.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Transcript
TSConfig Solution Style & subpath imports でファイル単位で型を切り替える TSKaigi 2025 |
株式会社Gaudiy kotori
自己紹介 • kotori ( @maminami_minami) • 株式会社Gaudiy Enabling Team •
Love: 酒・アニメ・声優 • 趣味: お絵描き
Solution Style • 複数の tsconfig を用意 • 適用する設定をファイル毎に切り替え • Vite
の react-ts template でも採用
Subpath imports • import のパスを他のモジュールに 再マッピングする Node.js の機能 • package.json
imports フィールド に定義 • # で始まる必要がある
課題 Storybook でFragment Masking が 解除された Fragment Props を利用したい! w/
GraphQL Fragment Colocation
Fragment Colocation -> 使うデータは近くに宣言! Fragment Masking -> 宣言したデータだけ使えるように制限!
gql.tada • GraphQL を型安全に扱えるエコシステム • GraphQL Codegen と違い generate コマンドの実行なしで即時
に gql tag の変更を型推論可能に • TypeScript LSP Plugin として gql.tada/ts-plugin を tsconfig plugins フィールドに追加
詳しくは Gaudiy Tech Blog にて! https://techblog.gaudiy.com/entry/2024/08/15/113040
setup graphql w/ gql.tada
Storybook w/ Fragment
Storybook w/ Fragment gql.tada の maskFragments() でマスクして Props に渡さないと型エラー
Storybook w/ nested Fragment
Storybook w/ nested Fragment
Storybook w/ nested Fragment 😭 😇 重複したフィールド… 可読性…
Storybook w/ nested Fragment 理想
解決方法💪
Subpath imports
Solution Style
Storybook w/ nested Fragment 理想 型エラーにならない!型推論が効く!🥰 .stories.tsx 以外では Fragment Masking
が適用
まとめ
まとめ • gql.tada はいいゾ • Subpath imports は割と使えるので頭の片隅に置いてお くといいかも •
技術の掛け合わせで解決できる課題もあるので、引き出し を広げていこう