docs: document curried pattern and named factory usage in defineTypedHrefWithNuqs#48
Draft
amotarao wants to merge 2 commits into
Draft
docs: document curried pattern and named factory usage in defineTypedHrefWithNuqs#48amotarao wants to merge 2 commits into
amotarao wants to merge 2 commits into
Conversation
…HrefWithNuqs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
ウォークスルー
変更内容
推定コードレビュー工数🎯 1 (Trivial) | ⏱️ ~3分 関連する可能性のあるPR
レビュアーの提案
詩
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
defineTypedHrefWithNuqsの()({...})という二重呼び出し構文が気になるという指摘を受け、シングルコール<Routes, RouteParamsMap>(nuqsMap)に変更できないか調査した。調査結果: TypeScript は明示的な型引数と残りの型引数の推論を同時に行えない(Partial Type Argument Inference が未実装 / microsoft/TypeScript#26242)。TypeScript 5.9 でも確認済み。
以下のアプローチをすべて試したが、
NuqsMapが引数から推論されずデフォルト型が使われた:NuqsMap = NuqsParsersMap<Routes>const型パラメータ(TypeScript 5.0)objectを制約にした intersectionNuqsMap & NuqsParsersMap<Routes>対応: カリー化の設計意図と、
()({...})を避けた Named Factory パターンを JSDoc に明記した。Summary by CodeRabbit