feat(use-api-query-key): refactor use-api-query-key composable & create api-doc cli#5668
Conversation
Signed-off-by: samuel.park <samuel.park@megazone.com>
Signed-off-by: samuel.park <samuel.park@megazone.com>
Signed-off-by: samuel.park <samuel.park@megazone.com>
Signed-off-by: samuel.park <samuel.park@megazone.com>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
|
🎉 @WANZARGEN and @seungyeoneeee have been randomly selected as the reviewers! Please review. 🙏 |
| ], | ||
| }, | ||
| } as const; | ||
| export type APIDoc = typeof API_DOC; |
There was a problem hiding this comment.
[Question] Great implementation! Since API_DOC is only used for type inference and isn’t referenced anywhere else, it won’t affect runtime performance due to Vite’s tree shaking.
Just curious—did you consider defining APIDoc directly as a TypeScript type without creating the API_DOC object? It would achieve the same type safety and autocomplete without creating a constant, even if it’s tree-shaken. Not a required change, just wanted to know your thoughts! 😊
--
[Question] 좋은 구현이네요! API_DOC이 타입 추론용으로만 사용되고 다른 곳에서는 참조되지 않기 때문에, Vite의 트리 쉐이킹 덕분에 런타임 성능에 영향을 주지 않을 거라는 점도 확인했습니다.
그런데 혹시 API_DOC 객체를 생성하지 않고 TypeScript 타입으로만 APIDoc을 정의하는 방법도 고려해보셨나요? 이렇게 하면 (트리 쉐이킹과 관계없이) 상수를 만들지 않고도 동일한 타입 안정성과 자동 완성을 얻을 수 있습니다. 꼭 바꿀 필요는 없고, 단지 의견이 궁금해서 여쭤봅니다! 😊
Skip Review (optional)
style,chore,ci,test,docs)Description (optional)
use-api-query-keycomposable. Improve arguments injection method. (service / resource / verb)Things to Talk About (optional)