Skip to content

docs(kit): add client script & client context page#390

Merged
antfu merged 3 commits into
mainfrom
docs/kit-client-context
Jul 2, 2026
Merged

docs(kit): add client script & client context page#390
antfu merged 3 commits into
mainfrom
docs/kit-client-context

Conversation

@antfubot

@antfubot antfubot commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds a new DevTools Kit doc page — Client Script & Client Context (/kit/client-context) — introducing the two client-side foundations of embedded mode:

  • The client script (@vitejs/devtools/client/inject): what it does when it runs in the host page (RPC connect, build context, publish global, mount the dock), how injection works via transformIndexHtml and virtual:vite-devtools-injection, and when it applies (dev serve, non-SSR, top-level windows only).
  • The client context (DevToolsClientContext): a property overview (rpc, clientType, docks, panel, commands, when), access via getDevToolsClientContext(), the DockClientScriptContext extras for dock scripts, and how iframe panels connect instead.
  • Troubleshooting: what to check when the client script isn't injected (backend integration, middleware mode, JS-only entries), with the manual import '@vitejs/devtools/client/inject' escape hatch, the double-mount caveat, and a dev-only import guard.

Also registers the page in the VitePress sidebar and the DevTools Kit nav dropdown, after "Dock System".

Verified with a full pnpm build + vitepress build.

Linked Issues

Additional context

Created with the help of an agent.

@pkg-pr-new

pkg-pr-new Bot commented Jul 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vitejs/devtools@390
npm i https://pkg.pr.new/@vitejs/devtools-kit@390
npm i https://pkg.pr.new/@vitejs/devtools-rolldown@390
npm i https://pkg.pr.new/@vitejs/devtools-self-inspect@390

commit: 6ed97e4

@antfu antfu merged commit 4fafa50 into main Jul 2, 2026
8 of 9 checks passed
@antfu antfu deleted the docs/kit-client-context branch July 2, 2026 08:14
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