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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
520
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
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
440
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
160
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
290
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
160
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
180
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
180
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
330
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
3
1.9k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
1k
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
540
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
410
我々はなぜ「層」を分けるのか〜「関心の分離」と「抽象化」で手に入れる変更に強いシンプルな設計〜 #phperkaigi / PHPerKaigi 2026
shogogg
2
510
Featured
See All Featured
Believing is Seeing
oripsolob
1
95
Building a Scalable Design System with Sketch
lauravandoore
463
34k
エンジニアに許された特別な時間の終わり
watany
106
240k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
500
Site-Speed That Sticks
csswizardry
13
1.1k
How to train your dragon (web standard)
notwaldorf
97
6.6k
Navigating Team Friction
lara
192
16k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
1.9k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
300
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
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 は割と使えるので頭の片隅に置いてお くといいかも •
技術の掛け合わせで解決できる課題もあるので、引き出し を広げていこう