Skip to content

Commit 65a0347

Browse files
committed
docs: recommend Vite DevTools kit for mounting built-in plugins into Vite
The migration note and each affected plugin's docs page now lead with createPluginFromDevframe (@vitejs/devtools-kit/node) for a Vite DevTools host, with devframeVite (@devframes/vite/dev-spa) as the DevTools-free fallback — matching the existing framework/hub docs' stance that Vite DevTools is the recommended integration path for a Vite app. Created with the help of an agent.
1 parent 2fcf4c1 commit 65a0347

6 files changed

Lines changed: 92 additions & 3 deletions

File tree

docs/guide/migration-0.9.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export default defineConfig({
289289

290290
## Built-in plugins' `/vite` subpath is removed
291291

292-
`a11yVitePlugin`, `assetsVitePlugin`, `dataInspectorVitePlugin`, `inspectVitePlugin`, `messagesVitePlugin`, and `ogVitePlugin` — each plugin's `@devframes/plugin-<name>/vite` export — were one-line renames over `devframeVite(def, options)`. Call `devframeVite` directly against the plugin's default export instead:
292+
`a11yVitePlugin`, `assetsVitePlugin`, `dataInspectorVitePlugin`, `inspectVitePlugin`, `messagesVitePlugin`, and `ogVitePlugin` — each plugin's `@devframes/plugin-<name>/vite` export — were one-line renames over `devframeVite(def, options)`. For a Vite app, mount the plugin into [Vite DevTools](https://devtools.vite.dev) instead, with `createPluginFromDevframe` from `@vitejs/devtools-kit/node`:
293293

294294
```ts
295295
// 0.8.x
@@ -303,6 +303,17 @@ export default defineConfig({
303303
```ts
304304
// 0.9
305305
import a11yDevframe from '@devframes/plugin-a11y'
306+
import { createPluginFromDevframe } from '@vitejs/devtools-kit/node'
307+
308+
export default defineConfig({
309+
plugins: [createPluginFromDevframe(a11yDevframe)],
310+
})
311+
```
312+
313+
Without Vite DevTools, call `devframeVite` directly against the plugin's default export instead — the lower-level, DevTools-free path:
314+
315+
```ts
316+
import a11yDevframe from '@devframes/plugin-a11y'
306317
import { devframeVite } from '@devframes/vite/dev-spa'
307318

308319
export default defineConfig({

docs/plugins/a11y.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,23 @@ Runs the panel alone, without a host page to scan — serves at `/__devframes_pl
5454

5555
## Mount into a Vite host
5656

57+
For a [Vite DevTools](https://devtools.vite.dev) app, mount the panel with `createPluginFromDevframe` from `@vitejs/devtools-kit/node`:
58+
59+
```ts
60+
// vite.config.ts
61+
import a11yDevframe from '@devframes/plugin-a11y'
62+
import { createPluginFromDevframe } from '@vitejs/devtools-kit/node'
63+
import { defineConfig } from 'vite'
64+
65+
export default defineConfig({
66+
plugins: [
67+
createPluginFromDevframe(a11yDevframe),
68+
],
69+
})
70+
```
71+
72+
Without Vite DevTools, `devframeVite` from `@devframes/vite/dev-spa` mounts the panel directly, no DevTools dock required:
73+
5774
```ts
5875
// vite.config.ts
5976
import a11yDevframe from '@devframes/plugin-a11y'

docs/plugins/assets.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,23 @@ pnpx @devframes/plugin-assets --read-only # disable upload / rename / delete / m
2828

2929
## Mount into a Vite host
3030

31+
For a [Vite DevTools](https://devtools.vite.dev) app, mount the panel with `createPluginFromDevframe` from `@vitejs/devtools-kit/node`:
32+
33+
```ts
34+
// vite.config.ts
35+
import assetsDevframe from '@devframes/plugin-assets'
36+
import { createPluginFromDevframe } from '@vitejs/devtools-kit/node'
37+
import { defineConfig } from 'vite'
38+
39+
export default defineConfig({
40+
plugins: [
41+
createPluginFromDevframe(assetsDevframe),
42+
],
43+
})
44+
```
45+
46+
Without Vite DevTools, `devframeVite` from `@devframes/vite/dev-spa` mounts the panel directly, no DevTools dock required:
47+
3148
```ts
3249
// vite.config.ts
3350
import assetsDevframe from '@devframes/plugin-assets'

docs/plugins/data-inspector.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,18 @@ pnpx @devframes/plugin-data-inspector attach # attach to a process
106106

107107
## Mount into a Vite host
108108

109+
For a [Vite DevTools](https://devtools.vite.dev) app, mount the panel with `createPluginFromDevframe` from `@vitejs/devtools-kit/node`:
110+
109111
```ts
110112
import dataInspectorDevframe from '@devframes/plugin-data-inspector'
111113
import { registerDataSource } from '@devframes/plugin-data-inspector/registry'
112114
// vite.config.ts
113-
import { devframeVite } from '@devframes/vite/dev-spa'
115+
import { createPluginFromDevframe } from '@vitejs/devtools-kit/node'
114116
import { defineConfig } from 'vite'
115117

116118
export default defineConfig({
117119
plugins: [
118-
devframeVite(dataInspectorDevframe),
120+
createPluginFromDevframe(dataInspectorDevframe),
119121
{
120122
name: 'my-app:data-sources',
121123
configureServer(server) {
@@ -131,6 +133,14 @@ export default defineConfig({
131133
})
132134
```
133135

136+
Without Vite DevTools, `devframeVite` from `@devframes/vite/dev-spa` mounts the panel directly, no DevTools dock required — swap it in for `createPluginFromDevframe` above:
137+
138+
```ts
139+
import { devframeVite } from '@devframes/vite/dev-spa'
140+
141+
devframeVite(dataInspectorDevframe)
142+
```
143+
134144
Hub hosts mount the default export like any devframe definition.
135145

136146
## Programmatic

docs/plugins/inspect.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,23 @@ Opens the inspector against a fresh standalone devframe connection — handy as
4242

4343
## Mount into a Vite host
4444

45+
For a [Vite DevTools](https://devtools.vite.dev) app, mount the panel with `createPluginFromDevframe` from `@vitejs/devtools-kit/node`:
46+
47+
```ts
48+
// vite.config.ts
49+
import inspectDevframe from '@devframes/plugin-inspect'
50+
import { createPluginFromDevframe } from '@vitejs/devtools-kit/node'
51+
import { defineConfig } from 'vite'
52+
53+
export default defineConfig({
54+
plugins: [
55+
createPluginFromDevframe(inspectDevframe),
56+
],
57+
})
58+
```
59+
60+
Without Vite DevTools, `devframeVite` from `@devframes/vite/dev-spa` mounts the panel directly, no DevTools dock required:
61+
4562
```ts
4663
// vite.config.ts
4764
import inspectDevframe from '@devframes/plugin-inspect'

docs/plugins/og.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,23 @@ pnpx @devframes/plugin-og
2222

2323
## Mount into a Vite host
2424

25+
For a [Vite DevTools](https://devtools.vite.dev) app, mount the panel with `createPluginFromDevframe` from `@vitejs/devtools-kit/node`:
26+
27+
```ts
28+
// vite.config.ts
29+
import ogDevframe from '@devframes/plugin-og'
30+
import { createPluginFromDevframe } from '@vitejs/devtools-kit/node'
31+
import { defineConfig } from 'vite'
32+
33+
export default defineConfig({
34+
plugins: [
35+
createPluginFromDevframe(ogDevframe),
36+
],
37+
})
38+
```
39+
40+
Without Vite DevTools, `devframeVite` from `@devframes/vite/dev-spa` mounts the panel directly, no DevTools dock required:
41+
2542
```ts
2643
// vite.config.ts
2744
import ogDevframe from '@devframes/plugin-og'

0 commit comments

Comments
 (0)