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
320
2
Share
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
1.9k
JSConf JP 2022 introduce React Query
maminami373
2
7.4k
Front-end rearchitect SPA
maminami373
0
540
JSConf jp 2021 kaonavi front-end development in the monolithic service
maminami373
1
250
単体テストゼロからテスト文化を醸成させた話 / Fostering the testing culture
maminami373
0
2.4k
Other Decks in Programming
See All in Programming
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
160
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
380
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
290
Spec-driven Development: How AI Changes Everything (And Nothing)
simas
PRO
0
520
Kingdom of the Machine
yui_knk
2
1.3k
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
510
Making the RBS Parser Faster
soutaro
0
640
Don't Prompt Harder, Structure Better
kitasuke
0
800
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
0
110
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
5
1.4k
第3木曜LT会 #28
tinykitten
PRO
0
120
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
170
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
900
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
270
Heart Work Chapter 1 - Part 1
lfama
PRO
6
35k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
330
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.4k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Technical Leadership for Architectural Decision Making
baasie
3
350
Raft: Consensus for Rubyists
vanstee
141
7.4k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
730
Art, The Web, and Tiny UX
lynnandtonic
304
21k
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 は割と使えるので頭の片隅に置いてお くといいかも •
技術の掛け合わせで解決できる課題もあるので、引き出し を広げていこう