feat(console-query-debugger): create console query debugger#5817
feat(console-query-debugger): create console query debugger#5817piggggggggy merged 5 commits intodevelopfrom
Conversation
Signed-off-by: piggggggggy <samuel.park@mz.co.kr>
Signed-off-by: piggggggggy <samuel.park@mz.co.kr>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 4 Skipped Deployments
|
|
🎉 @skdud4659 and @seungyeoneeee have been randomly selected as the reviewers! Please review. 🙏 |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new in-browser debugging utility for Vue Query to enhance developer observability and troubleshooting during development.
- Adds a dedicated debug tool that provides summary, detailed, and specific inspections for Vue Query data.
- Integrates the debug tool into the application in development mode via a dynamic import.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/web/src/_dev-tools/vue-query-console-debug.ts | New debug utility exposing methods dump(), log(), inspect() to inspect Vue Query internal state |
| apps/web/src/App.vue | Dynamically imports and initializes the debug utility when running in DEV mode |
Comments suppressed due to low confidence (1)
apps/web/src/_dev-tools/vue-query-console-debug.ts:20
- Consider adding automated tests for the debug tool functions (dump, log, inspect) to verify their behavior and prevent regressions.
export function initVueQueryConsoleDebug(client: QueryClient) {
Signed-off-by: piggggggggy <samuel.park@mz.co.kr>
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a Vue Query Console Debugger tool that exposes a global debug object (QUERY_DEBUG) to help developers inspect and filter Vue Query states in the browser console.
- Implements the debugger in a new file (vue-query-console-debug.ts) with methods to dump summaries, log detailed info, and inspect individual queries.
- Conditionally imports the debugger in App.vue during development to enhance developer observability.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/web/src/_dev-tools/vue-query-console-debug.ts | Provides query summarization, filtering, and logging methods to inspect Vue Query state details. |
| apps/web/src/App.vue | Implements conditional dynamic import of the debug tool to expose QUERY_DEBUG only in DEV mode. |
Signed-off-by: piggggggggy <samuel.park@mz.co.kr>
There was a problem hiding this comment.
Pull Request Overview
This pull request adds a new in-browser console debugger for Vue Query to improve developer observability by summarizing and inspecting query states. The key changes include:
- Creation of the Vue Query Console Debugger tool in a new file.
- Exposure of the debugger on the global window object.
- Integration of the debugger in development mode within the App.vue file.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/web/src/_dev-tools/vue-query-console-debug.ts | Adds a module that implements query summarization, logging, and inspection. |
| apps/web/src/App.vue | Updates to automatically load the debugger module in DEV mode. |
Comments suppressed due to low confidence (1)
apps/web/src/_dev-tools/vue-query-console-debug.ts:52
- [nitpick] The variable name 'q' is ambiguous; renaming it to something like 'querySummary' can improve code readability.
let summary = _summarizeQueries().map((q) => ({
sulmoJ
left a comment
There was a problem hiding this comment.
Debugging for view queries is also possible in version vue 2.7! Thank you!!
LGTM~~
Signed-off-by: piggggggggy <samuel.park@mz.co.kr>
Skip Review (optional)
style,chore,ci,test,docs)Description (optional)
Add Vue Query Console Debugger for Enhanced Developer Observability
This PR introduces a custom in-browser console-based debugging utility for inspecting the internal state of Vue Query.
Features
string), resourceIdentifier(string), activeOnly(boolean)Why
In real-world development, it’s common to unintentionally create queries that are technically registered in the cache but never actually fetch data — typically due to conditional logic with enabled: false.
This tool helps developers clearly distinguish such inactive or placeholder queries from meaningful ones, improving clarity and reducing noise during debugging.
Additionally, this project is currently built on Vue 2.7, which is not compatible with the official Vue Query Devtools.
Due to this limitation, we lacked a way to inspect query cache state visually.
This lightweight, console-based debugger was implemented as a practical alternative to make up for the missing Devtools support in a Vue 2.x environment.
Usage
Vue Query 디버깅을 위한 콘솔 기반 디버거 도구 추가
이 PR에서는 Vue Query의 내부 상태를 브라우저 콘솔에서 직접 확인할 수 있는 디버깅 유틸을 추가합니다.
디버거는 전역 객체 window.__QUERY_DEBUG__를 통해 접근할 수 있습니다.
주요 기능
__QUERY_DEBUG__.dump()로 모든 쿼리의 요약 테이블 출력string), resourceIdentifier(string), activeOnly(boolean)도입 배경
실제 개발 과정에서는 조건부 로직, 복잡한 구조 등으로 인해
enabled는 false이지만 queryKey가 생성되는 불필요한 쿼리가 생기기 쉽습니다.
이 도구는 그러한 쿼리를 구분해주고,
디버깅 시 어떤 쿼리가 실제로 의미 있는지 빠르게 식별할 수 있게 도와줍니다.
또한, 현재 프로젝트는 Vue 2.7을 기반으로 하고 있어 Vue Query Devtools 공식 도구를 사용할 수 없는 환경입니다.
이러한 상황에서 직접적인 쿼리 캐시 확인 수단이 부족해,
개발자도구 콘솔에서 직접 확인 가능한 경량 디버거를 구현하게 되었습니다.
사용 예시
2025-04-24.5.48.46.mov
Things to Talk About (optional)