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
330
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
Oxcを導入して開発体験が向上した話
yug1224
4
340
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.8k
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
260
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
280
dRuby over BLE
makicamel
2
390
Inside Stream API
skrb
1
780
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
280
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
810
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.5k
Datadog LLM Observabilityで実現する 安全なLLM Usage 管理
3150
0
120
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
260
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
190
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
870
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Design in an AI World
tapps
1
250
30 Presentation Tips
portentint
PRO
1
330
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Typedesign – Prime Four
hannesfritz
42
3.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Designing Experiences People Love
moore
143
24k
The Curse of the Amulet
leimatthew05
2
13k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
240
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
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 は割と使えるので頭の片隅に置いてお くといいかも •
技術の掛け合わせで解決できる課題もあるので、引き出し を広げていこう