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
300
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
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
1
270
CSC307 Lecture 10
javiergs
PRO
1
690
個人開発は儲からない - それでも開発開始1ヶ月で300万円売り上げた方法
taishiyade
0
120
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
350
Geminiの機能を調べ尽くしてみた
naruyoshimi
0
170
15年目のiOSアプリを1から作り直す技術
teakun
0
530
CSC307 Lecture 09
javiergs
PRO
1
850
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
12
6.9k
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
130
AIに仕事を丸投げしたら、本当に楽になれるのか
dip_tech
PRO
0
160
CSC307 Lecture 11
javiergs
PRO
0
580
AI活用のコスパを最大化する方法
ochtum
0
110
Featured
See All Featured
Amusing Abliteration
ianozsvald
0
120
Designing for Timeless Needs
cassininazir
0
140
Bash Introduction
62gerente
615
210k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
Accessibility Awareness
sabderemane
0
68
The untapped power of vector embeddings
frankvandijk
2
1.6k
Speed Design
sergeychernyshev
33
1.6k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
170
Utilizing Notion as your number one productivity tool
mfonobong
3
230
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
80
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 は割と使えるので頭の片隅に置いてお くといいかも •
技術の掛け合わせで解決できる課題もあるので、引き出し を広げていこう