docs: refine Vite DevTools integration plans#1030
Conversation
|
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 (5)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughThe PR updates Vite DevTools Kit 0.4.2 and Devframe 0.7.5 integration documentation. It defines plans for dock foundation, platform-service cleanup, Code Server, and Data Inspector integration, while removing superseded plan documents. The plans specify implementation steps, compatibility boundaries, dependency alignment, acceptance criteria, verification commands, tests, and STOP conditions. Estimated code review effort: 3 (Moderate) | ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 9
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plans/vite-devtools-integration/01-dock-foundation.md`:
- Around line 120-138: Update the existing devtools.setup(ctx) registration flow
in module-main.ts to guard both the Nuxt group and nuxt:devtools dock
registrations with the same client-context classifier used elsewhere. Keep the
existing IDs, metadata, and direct hub-member activation/lookups unchanged,
while preventing SSR setup from registering either dock entry.
In `@plans/vite-devtools-integration/02-platform-services-cleanup.md`:
- Around line 221-229: Update the Verification section to explicitly list pnpm
11 validation commands: pnpm lint, pnpm prepare or pnpm build, pnpm typecheck,
pnpm test:unit, and the appropriate Playwright command. Place pnpm prepare/build
before pnpm typecheck, and replace the vague “shared commands” wording without
adding npm or yarn commands.
- Around line 145-147: Update the analyze-build integration plan to define the
server-to-client trigger that publishes the active terminal session ID
immediately when a build starts, before “view terminal” becomes available, and
clears it when the build completes. Specify whether this uses an immediate
refresh or a start-response contract, and ensure client state is derived from
that refreshed server info rather than processAnalyzeBuildInfo or an exit event.
- Around line 109-120: The pre-ready bridge state must also retain terminal
exits, not just registrations and chunks. Update the legacy terminal bridge
state and registration flow to persist each exit code/status received before
devtools:ready, then apply the buffered result when the corresponding session is
registered so it ends as stopped for code 0 or omitted and error for defined
non-zero codes; add a test covering exit before readiness.
- Around line 116-124: Guard legacy-ID bridge operations with a per-run
generation or session token so delayed write, exit, and remove events from a
prior registration cannot affect the replacement session. Update the
re-register/clear/restart flow to assign a new token and require each hook to
match the currently mapped token before acting, while preserving normal handling
for the active run.
In `@plans/vite-devtools-integration/03-code-server-plugin.md`:
- Around line 191-199: Expand the Verification section to document the complete
validation sequence using pnpm 11: run lint, prepare or build before typecheck,
then typecheck, unit tests, and the appropriate Playwright/dev e2e commands.
Explicitly include the Nuxt tsconfig generation step via the documented
prepare/build command, and retain the existing test coverage requirements and
prohibition on installing code-server in CI.
In `@plans/vite-devtools-integration/04-data-inspector-plugin.md`:
- Around line 208-215: Update the Verification section to explicitly list the
required repository validation commands instead of referring to “shared
commands.” Specify pnpm 11, run pnpm prepare or pnpm build before pnpm
typecheck, and include the required lint, unit, Playwright, e2e, and
documentation build checks in the correct order.
- Around line 183-189: Update the data inspector plugin plan to either define
optional polling behavior—including its refresh trigger, lifecycle cleanup, and
required tests—or remove optional polling from the planned scope and related
test requirements. Keep the remaining query and source-shape coverage unchanged.
In `@plans/vite-devtools-integration/README.md`:
- Around line 117-123: Update the verification command block in the README to
explicitly require pnpm 11 before running install, lint, build, typecheck, or
unit tests. Add a clear pnpm version precondition or check, while preserving the
existing command sequence.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: dfabb012-582e-4e34-a2a1-647d9033172e
📒 Files selected for processing (9)
plans/README.mdplans/vite-devtools-integration/01-dock-foundation.mdplans/vite-devtools-integration/01-messages-unification.mdplans/vite-devtools-integration/02-platform-services-cleanup.mdplans/vite-devtools-integration/02-terminals-reuse.mdplans/vite-devtools-integration/03-code-server-plugin.mdplans/vite-devtools-integration/03-dock-groups-presentation.mdplans/vite-devtools-integration/04-data-inspector-plugin.mdplans/vite-devtools-integration/README.md
💤 Files with no reviewable changes (3)
- plans/vite-devtools-integration/01-messages-unification.md
- plans/vite-devtools-integration/02-terminals-reuse.md
- plans/vite-devtools-integration/03-dock-groups-presentation.md
| In `module-main.ts`'s existing `devtools.setup(ctx)` callback, register the group | ||
| before the hub iframe: | ||
|
|
||
| ```ts | ||
| ctx.docks.register({ | ||
| id: NUXT_DEVTOOLS_GROUP_ID, | ||
| type: 'group', | ||
| title: 'Nuxt', | ||
| icon: '/__nuxt_devtools__/client/nuxt.svg', | ||
| category: 'framework', | ||
| defaultOrder: -900, | ||
| defaultChildId: 'nuxt:devtools', | ||
| }) | ||
| ``` | ||
|
|
||
| Add `groupId: NUXT_DEVTOOLS_GROUP_ID` to the existing `nuxt:devtools` iframe and | ||
| change its `defaultOrder` to `-300`. Keep its ID, URL, icon, and title unchanged. | ||
| Existing calls that activate or look up `nuxt:devtools`, including the single | ||
| Vue DevTools iframe bridge, must continue to target the hub member directly. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
sed -n '110,165p' plans/vite-devtools-integration/01-dock-foundation.mdRepository: nuxt/devtools
Length of output: 2619
🏁 Script executed:
rg -n "connectDevToolsKit|client classifier|SSR|devtools.setup|register the group|nuxt:devtools|NUXT_DEVTOOLS_GROUP_ID" plans/vite-devtools-integration/01-dock-foundation.mdRepository: nuxt/devtools
Length of output: 1860
🏁 Script executed:
sed -n '1,115p' plans/vite-devtools-integration/01-dock-foundation.mdRepository: nuxt/devtools
Length of output: 5037
🏁 Script executed:
rg -n "devtools\.setup|ctx\.docks\.register|NUXT_DEVTOOLS_GROUP_ID|nuxt:devtools|defaultChildId|groupId" packages/devtools/src packages/devtools-kit/srcRepository: nuxt/devtools
Length of output: 2393
🏁 Script executed:
sed -n '80,125p' packages/devtools/src/module-main.ts && printf '\n---\n' && sed -n '180,240p' packages/devtools-kit/src/index.ts && printf '\n---\n' && rg -n "register\\(|defaultChildId|switchEntry\\(|toggleEntry\\(|getStateById\\(" packages/devtools-kit/src packages/devtools/src -g '*.ts'Repository: nuxt/devtools
Length of output: 6377
🏁 Script executed:
rg -n "docks\.register|register\(.*id:|update\(.*id:|defaultChildId|duplicate" packages docs plans -g '*.md' -g '*.ts'Repository: nuxt/devtools
Length of output: 3878
🏁 Script executed:
sed -n '40,60p' plans/vite-devtools-integration/README.md && printf '\n---\n' && sed -n '80,95p' plans/vite-devtools-integration/README.mdRepository: nuxt/devtools
Length of output: 2121
🏁 Script executed:
sed -n '165,195p' plans/vite-devtools-integration/01-dock-foundation.mdRepository: nuxt/devtools
Length of output: 969
Gate dock registration on the client context too. In module-main.ts's devtools.setup(ctx) callback, apply the same client classifier before ctx.docks.register(...); otherwise the SSR setup can still register the Nuxt group and nuxt:devtools member, creating duplicate Nuxt groups across environments.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plans/vite-devtools-integration/01-dock-foundation.md` around lines 120 -
138, Update the existing devtools.setup(ctx) registration flow in module-main.ts
to guard both the Nuxt group and nuxt:devtools dock registrations with the same
client-context classifier used elsewhere. Keep the existing IDs, metadata, and
direct hub-member activation/lookups unchanged, while preventing SSR setup from
registering either dock entry.
- Gate Plan 01's dock/group registration by the client-context classifier so the SSR Vite instance never registers a duplicate inert Nuxt group. - Plan 02: buffer terminal exit status (not just registrations/chunks) before devtools:ready, and guard re-register/restart with a per-run generation token so stale write/exit/remove events can't hit the replacement session. - Plan 02: define the exact contract for delivering the active analyze-build terminal session ID to the client (extend getAnalyzeBuildInfo + the existing refresh call site). - Clarify Plan 04's Data Inspector polling mention as an upstream SPA feature requiring no Nuxt-side implementation or tests. - Make every plan's Verification section self-contained (spell out the pnpm 11 lint/build-or-prepare/typecheck/test:unit/e2e sequence instead of referring to "shared commands"); note pnpm 11 explicitly in the README's shared verification block.
Replace the stale Devframe 0.6 integration plans with four independently executable plans targeting Vite DevTools Kit 0.4.2 and Devframe 0.7.5.
The new sequence establishes the Nuxt dock group, completes Messages and terminal convergence, replaces the bespoke VS Code integration with the Code Server plugin, and replaces DiscoveryJS with a preconfigured Data Inspector source. It records the verified platform constraints, migration boundaries, dependencies, drift checks, acceptance criteria, and STOP conditions for future implementation agents.
This PR was created with the help of an agent.