Skip to content

docs: fix two module guide snippets that do not work as written - #1116

Merged
antfu merged 1 commit into
nuxt:mainfrom
antfubot:docs/module-guide-snippets
Oct 6, 2026
Merged

antfu merged 1 commit into
nuxt:mainfrom
antfubot:docs/module-guide-snippets

Conversation

@antfubot

@antfubot antfubot commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to CodeRabbit's review on #1108, which merged before it was addressed.

  • The dock handle example called ctx.docks.register() outside onDevtoolsReady, where ctx does not exist.
  • The RPC example broadcast once from onDevtoolsReady. That hook runs when the dev server starts, before any client has connected, so the broadcast went nowhere. It now broadcasts on builder:watch, which also shows the intended use: pushing changes to whoever is connected.

Not changed: the review's third point asked to raise the stated Vite floor from 8.1.5 to ^8.3.2, on the grounds that @vitejs/devtools 0.7.6 requires it. It peers on vite: *. vite-plugin-vue-devtools v9 does peer on ^8.3.0, but on Vite 8.1.5 (Nuxt 4.5.1) the app boots, every dock registers including Vue DevTools, and the plugin prints no warning (checked in Chromium against the nuxt4 playground pinned to 8.1.5). So ^8.1.5 stays accurate.

Created with the help of an agent.

The dock handle example used ctx outside onDevtoolsReady, and the RPC
example broadcast once from devtools:ready, which runs before any client
is connected, so the message never arrived. Broadcast on a change instead.
@coderabbitai

coderabbitai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 72da27ad-aa54-42c7-8d35-786a2f5a85b7
📥 Commits

Reviewing files that changed from the base of the PR and between 230cdda and d800d06.

📒 Files selected for processing (1)
  • docs/content/2.module/0.guide.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The module guide updates two examples. The dock example registers an entry and updates its badge inside onDevtoolsReady. The RPC example broadcasts a message containing the changed path from builder:watch. Comments clarify that the broadcast reaches all connected clients and that none are connected when the hook runs.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Merge Risk: 🔵 Low · up to d800d

The guide’s broadcast example works, but its comment may mislead readers about whether connected clients can receive notifications. The change is otherwise mergeable; correcting that documentation is a bounded follow-up.

Architecture Summary

Architecture risk: 🔵 Low · up to d800d

The change affects 1 system.

Changed systems: docs

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — docs (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in docs/content/2.module/0.guide.md: The dock example now registers and updates the entry inside onDevtoolsReady; previously, registration and the badge update were shown directly.
  • observed — Modified behavior in docs/content/2.module/0.guide.md: The example replaces the immediate broadcast of a fixed greeting with a broadcast triggered by builder:watch, including the changed path in the notification. The comments specify that broadcasts reach every connected client and that no clients are connected when this hook runs.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the documentation changes and the two guide snippets that were fixed.
Description check ✅ Passed The description explains the two snippet fixes and provides relevant context about the Vite version discussion.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@antfu
antfu merged commit 7b9e10f into nuxt:main Oct 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants