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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
South
May 22, 2025
Programming
340
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
550
JSConf jp 2021 kaonavi front-end development in the monolithic service
maminami373
1
260
単体テストゼロからテスト文化を醸成させた話 / Fostering the testing culture
maminami373
0
2.5k
Other Decks in Programming
See All in Programming
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.8k
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.7k
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
1
120
エージェンティックRAGにAWSで入門しよう!
har1101
9
1.9k
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
210
OSINT for SRE: 学術論文とポストモーテムから探る システム障害の共通パターン / SRE NEXT 2026
tomoyk
1
2.5k
スマートグラスで並列バイブコーディング
hyshu
0
280
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
210
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
390
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
2
230
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
830
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
360
Featured
See All Featured
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
220
[SF Ruby Conf 2025] Rails X
palkan
2
1.1k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
890
Six Lessons from altMBA
skipperchong
29
4.3k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
210
Mind Mapping
helmedeiros
PRO
1
280
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Technical Leadership for Architectural Decision Making
baasie
3
430
Marketing to machines
jonoalderson
1
5.6k
Tell your own story through comics
letsgokoyo
1
990
Building Applications with DynamoDB
mza
96
7.1k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
180
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 は割と使えるので頭の片隅に置いてお くといいかも •
技術の掛け合わせで解決できる課題もあるので、引き出し を広げていこう