Skip to content

Commit 8807be5

Browse files
antfuclaude
andauthored
feat(v4)!: always use Vite DevTools, remove floating panel (#952)
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f82457d commit 8807be5

26 files changed

Lines changed: 198 additions & 1247 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,5 @@ packages/devtools/client/public/discovery/index.html
5959

6060
# Agent skills from npm packages (managed by skills-npm)
6161
**/skills/npm-*
62+
63+
.context

docs/content/2.module/3.migration-v4.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,34 @@ The `runWizard` server RPC function has been removed from `ServerFunctions`. The
7979
```
8080

8181
The `WizardFunctions`, `WizardActions`, and `GetWizardArgs` types have been removed from `@nuxt/devtools-kit`.
82+
83+
## Vite DevTools Integration is Now Always Enabled
84+
85+
The `viteDevTools` module option has been removed. Nuxt DevTools now always integrates with [Vite DevTools](https://github.com/vitejs/devtools) as a dock entry. The built-in floating panel has been removed — DevTools is accessed through the Vite DevTools panel instead.
86+
87+
```diff
88+
export default defineNuxtConfig({
89+
devtools: {
90+
enabled: true,
91+
- viteDevTools: true,
92+
},
93+
})
94+
```
95+
96+
### `client.devtools` Methods Now Control Vite DevTools
97+
98+
The `client.devtools.open()`, `client.devtools.close()`, and `client.devtools.toggle()` methods still work but now control the Vite DevTools panel:
99+
100+
- `open()` opens the Vite DevTools panel and switches to the Nuxt DevTools dock entry
101+
- `close()` closes the Vite DevTools panel
102+
- `toggle()` toggles the Nuxt DevTools dock entry in the Vite DevTools panel
103+
104+
The `Shift+Alt+D` keyboard shortcut now toggles the Nuxt DevTools entry in the Vite DevTools panel.
105+
106+
### `client.devtools.popup` Removed
107+
108+
The Picture-in-Picture popup feature (`client.devtools.popup`) has been removed. This was an experimental feature that required Chrome 111+.
109+
110+
### `showPanel` and `minimizePanelInactive` Settings Removed
111+
112+
The `showPanel` and `minimizePanelInactive` UI settings have been removed from `NuxtDevToolsOptions` as the built-in floating panel no longer exists.

packages/devtools-kit/src/_types/client-api.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,6 @@ export interface NuxtDevtoolsHostClient {
7272
toggle: () => void
7373
reload: () => void
7474
navigate: (path: string) => void
75-
76-
/**
77-
* Popup the DevTools frame into Picture-in-Picture mode
78-
*
79-
* Requires Chrome 111 with experimental flag enabled.
80-
*
81-
* Function is undefined when not supported.
82-
*
83-
* @see https://developer.chrome.com/docs/web-platform/document-picture-in-picture/
84-
*/
85-
popup?: () => any
8675
}
8776

8877
app: {

packages/devtools-kit/src/_types/options.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,6 @@ export interface ModuleOptions {
4343
*/
4444
viteInspect?: boolean
4545

46-
/**
47-
* Enable Vite DevTools integration
48-
*
49-
* @experimental
50-
* @default false
51-
*/
52-
viteDevTools?: boolean
53-
5446
/**
5547
* Disable dev time authorization check.
5648
*
@@ -201,12 +193,10 @@ export interface NuxtDevToolsOptions {
201193
hiddenTabCategories: string[]
202194
hiddenTabs: string[]
203195
interactionCloseOnOutsideClick: boolean
204-
minimizePanelInactive: number
205196
pinnedTabs: string[]
206197
scale: number
207198
showExperimentalFeatures: boolean
208199
showHelpButtons: boolean
209-
showPanel: boolean | null
210200
sidebarExpanded: boolean
211201
sidebarScrollable: boolean
212202
}

packages/devtools/client/components/DockingPanel.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ function toggleSplitScreen() {
3131
<div i-carbon-split-screen />
3232
{{ splitScreenEnabled ? 'Close Split Screen' : 'Split Screen' }}
3333
</NButton>
34-
<PictureInPictureButton />
3534
</div>
3635
<div px3 py2 flex="~ gap2">
3736
<NButton n="primary sm" @click="refreshData">

packages/devtools/client/components/PictureInPictureButton.vue

Lines changed: 0 additions & 68 deletions
This file was deleted.

packages/devtools/client/composables/telemetry.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export function telemetry(event: string, payload?: object, immediate = false) {
1515
os: userAgentInfo.os.name,
1616
osVersion: userAgentInfo.os.version,
1717
deviceType: userAgentInfo.device.type,
18-
inPopup: !!window.__NUXT_DEVTOOLS_IS_POPUP__,
1918
...payload,
2019
}, immediate)
2120
}

packages/devtools/client/pages/index.vue

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,19 @@
11
<script setup lang="ts">
22
import { definePageMeta } from '#imports'
33
import { ref } from 'vue'
4-
import { useClient } from '~/composables/client'
54
import { isFirstVisit } from '~/composables/storage'
6-
import { useDevToolsOptions } from '~/composables/storage-options'
75
import { telemetryEnabled } from '~/composables/telemetry'
86
97
definePageMeta({
108
layout: 'none',
119
})
1210
13-
const client = useClient()
1411
const telemetryModel = ref(true)
1512
16-
const {
17-
showPanel,
18-
} = useDevToolsOptions('ui')
19-
2013
function visit() {
2114
telemetryEnabled.value = telemetryModel.value
2215
isFirstVisit.value = false
2316
}
24-
25-
function hideFloatingPanel() {
26-
showPanel.value = false
27-
client.value.devtools.close()
28-
}
2917
</script>
3018

3119
<template>
@@ -48,9 +36,6 @@ function hideFloatingPanel() {
4836
<NButton to="/modules/overview" n="lg primary" @click="visit">
4937
<span>Get Started</span>
5038
</NButton>
51-
<NButton v-if="showPanel !== false" n="borderless orange" @click="hideFloatingPanel">
52-
<span>Always hide the floating panel</span>
53-
</NButton>
5439
</div>
5540
<div p4>
5641
<div flex="~ col gap-2" mxa>

packages/devtools/client/pages/settings.vue

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ definePageMeta({
1313
1414
const {
1515
interactionCloseOnOutsideClick,
16-
showPanel,
1716
showHelpButtons,
1817
scale,
1918
hiddenTabs,
2019
pinnedTabs,
2120
hiddenTabCategories,
22-
minimizePanelInactive,
2321
sidebarExpanded,
2422
sidebarScrollable,
2523
} = useDevToolsOptions('ui')
@@ -51,15 +49,6 @@ const scaleOptions = [
5149
['Huge', 18 / 15],
5250
]
5351
54-
const MinimizeInactiveOptions = [
55-
['Always', 0],
56-
['1s', 1000],
57-
['2s', 2000],
58-
['5s', 5000],
59-
['10s', 10000],
60-
['Never', -1],
61-
]
62-
6352
const categories = getCategorizedTabs(useAllTabs())
6453
6554
function toggleTab(name: string, v?: boolean) {
@@ -116,11 +105,6 @@ watchEffect(() => {
116105
if (client.value)
117106
client.value.app.frameState.value.closeOnOutsideClick = interactionCloseOnOutsideClick.value
118107
})
119-
120-
watchEffect(() => {
121-
if (client.value)
122-
client.value.app.frameState.value.minimizePanelInactive = minimizePanelInactive.value
123-
})
124108
</script>
125109

126110
<template>
@@ -232,19 +216,6 @@ watchEffect(() => {
232216
<span>Show help buttons</span>
233217
</NCheckbox>
234218

235-
<NCheckbox v-model="showPanel" n-primary>
236-
<span>Show the floating panel</span>
237-
</NCheckbox>
238-
239-
<div mx--2 my1 h-1px border="b base" op75 />
240-
241-
<p>Minimize floating panel on inactive</p>
242-
<NSelect v-model.number="minimizePanelInactive" n-primary>
243-
<option v-for="i of MinimizeInactiveOptions" :key="i[0]" :value="i[1]">
244-
{{ i[0] }}
245-
</option>
246-
</NSelect>
247-
248219
<div mx--2 my1 h-1px border="b base" op75 />
249220

250221
<p>Open In Editor</p>

packages/devtools/client/setup/vue-devtools.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,23 @@ export function ensureVueDevTools() {
1818

1919
const state = useDevToolsFrameState()
2020

21-
const isInPopup = window.__NUXT_DEVTOOLS_IS_POPUP__
22-
23-
function toggleClientDetected(state: boolean) {
21+
function toggleClientDetected(detected: boolean) {
2422
if (connected.value) {
2523
rpc.value.updateDevToolsClientDetected({
26-
iframe: state,
24+
iframe: detected,
2725
})
2826
}
2927
else {
3028
onRpcConnected(() => {
3129
rpc.value.updateDevToolsClientDetected({
32-
iframe: state,
30+
iframe: detected,
3331
})
3432
})
3533
}
3634
}
3735

3836
watchEffect(() => {
39-
if (isInPopup) {
40-
toggleClientDetected(true)
41-
}
42-
else {
43-
toggleClientDetected(state.value?.open ?? false)
44-
}
37+
toggleClientDetected(state.value?.open ?? false)
4538
})
4639

4740
createRpcClient(functions, {

0 commit comments

Comments
 (0)