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
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
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
130
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
170
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
17
8.9k
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
190
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
210
トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略
ochtum
0
310
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
180
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
270
LaravelLive Japan の裏方のすべて — 第188回 PHP勉強会@東京 (2026-06-24)
suguruooki
2
150
アルゴリズムは何を圧縮しているのか ─ Haskell から育った「圧縮代数」というメンタルモデル
naoya
16
3.3k
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
510
Vite+ Unified Toolchain for the Web
naokihaba
0
740
Featured
See All Featured
Scaling GitHub
holman
464
140k
30 Presentation Tips
portentint
PRO
1
350
WENDY [Excerpt]
tessaabrams
11
38k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Agile that works and the tools we love
rasmusluckow
331
22k
Git: the NoSQL Database
bkeepers
PRO
432
67k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.7k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
2
320
Odyssey Design
rkendrick25
PRO
2
730
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
330
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
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 は割と使えるので頭の片隅に置いてお くといいかも •
技術の掛け合わせで解決できる課題もあるので、引き出し を広げていこう