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
2
310
TSConfig Solution Style & subpath imports to switch types on a per-file basis
South
May 22, 2025
Tweet
Share
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
510
JSConf jp 2021 kaonavi front-end development in the monolithic service
maminami373
1
240
単体テストゼロからテスト文化を醸成させた話 / Fostering the testing culture
maminami373
0
2.4k
Other Decks in Programming
See All in Programming
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
370
Go Conference mini in Sendai 2026 : Goに新機能を提案し実装されるまでのフロー徹底解説
yamatoya
0
520
API Platformを活用したPHPによる本格的なWeb API開発 / api-platform-book-intro
ttskch
1
120
Raku Raku Notion 20260128
hareyakayuruyaka
0
430
PJのドキュメントを全部Git管理にしたら、一番喜んだのはAIだった
nanaism
0
230
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.5k
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
140
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
3.2k
Fundamentals of Software Engineering In the Age of AI
therealdanvega
0
160
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
330
AIに任せる範囲を安全に広げるためにやっていること
fukucheee
0
110
Featured
See All Featured
Six Lessons from altMBA
skipperchong
29
4.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Building the Perfect Custom Keyboard
takai
2
710
GitHub's CSS Performance
jonrohan
1032
470k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.7k
BBQ
matthewcrist
89
10k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
140
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
How to Ace a Technical Interview
jacobian
281
24k
Mobile First: as difficult as doing things right
swwweet
225
10k
Fireside Chat
paigeccino
42
3.8k
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 は割と使えるので頭の片隅に置いてお くといいかも •
技術の掛け合わせで解決できる課題もあるので、引き出し を広げていこう