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
310
2
Share
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
1.9k
JSConf JP 2022 introduce React Query
maminami373
2
7.3k
Front-end rearchitect SPA
maminami373
0
530
JSConf jp 2021 kaonavi front-end development in the monolithic service
maminami373
1
250
単体テストゼロからテスト文化を醸成させた話 / Fostering the testing culture
maminami373
0
2.4k
Other Decks in Programming
See All in Programming
Xdebug と IDE による デバッグ実行の仕組みを見る / Exploring-How-Debugging-Works-with-Xdebug-and-an-IDE
shin1x1
0
360
L’IA au service des devs : Anatomie d'un assistant de Code Review
toham
0
220
仕様漏れ実装漏れをなくすトレーサビリティAI基盤のご紹介
orgachem
PRO
9
5.3k
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
230
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
830
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
450
Feature Toggle は捨てやすく使おう
gennei
0
510
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
290
AIエージェントで業務改善してみた
taku271
0
500
飯MCP
yusukebe
0
490
Coding as Prompting Since 2025
ragingwind
0
770
Strategy for Finding a Problem for OSS: With Real Examples
kibitan
0
140
Featured
See All Featured
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.1k
Agile that works and the tools we love
rasmusluckow
331
21k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
110
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
200
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
Making the Leap to Tech Lead
cromwellryan
135
9.8k
GitHub's CSS Performance
jonrohan
1032
470k
HDC tutorial
michielstock
1
610
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
We Have a Design System, Now What?
morganepeng
55
8.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
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 は割と使えるので頭の片隅に置いてお くといいかも •
技術の掛け合わせで解決できる課題もあるので、引き出し を広げていこう