Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,5 @@ packages/devtools/client/public/discovery/index.html

# Agent skills from npm packages (managed by skills-npm)
**/skills/npm-*

.context
31 changes: 31 additions & 0 deletions docs/content/2.module/3.migration-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,34 @@ The `runWizard` server RPC function has been removed from `ServerFunctions`. The
```

The `WizardFunctions`, `WizardActions`, and `GetWizardArgs` types have been removed from `@nuxt/devtools-kit`.

## Vite DevTools Integration is Now Always Enabled

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.

```diff
export default defineNuxtConfig({
devtools: {
enabled: true,
- viteDevTools: true,
},
})
```

### `client.devtools` Methods Now Control Vite DevTools

The `client.devtools.open()`, `client.devtools.close()`, and `client.devtools.toggle()` methods still work but now control the Vite DevTools panel:

- `open()` opens the Vite DevTools panel and switches to the Nuxt DevTools dock entry
- `close()` closes the Vite DevTools panel
- `toggle()` toggles the Nuxt DevTools dock entry in the Vite DevTools panel

The `Shift+Alt+D` keyboard shortcut now toggles the Nuxt DevTools entry in the Vite DevTools panel.

### `client.devtools.popup` Removed

The Picture-in-Picture popup feature (`client.devtools.popup`) has been removed. This was an experimental feature that required Chrome 111+.

### `showPanel` and `minimizePanelInactive` Settings Removed

The `showPanel` and `minimizePanelInactive` UI settings have been removed from `NuxtDevToolsOptions` as the built-in floating panel no longer exists.
11 changes: 0 additions & 11 deletions packages/devtools-kit/src/_types/client-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,6 @@ export interface NuxtDevtoolsHostClient {
toggle: () => void
reload: () => void
navigate: (path: string) => void

/**
* Popup the DevTools frame into Picture-in-Picture mode
*
* Requires Chrome 111 with experimental flag enabled.
*
* Function is undefined when not supported.
*
* @see https://developer.chrome.com/docs/web-platform/document-picture-in-picture/
*/
popup?: () => any
}

app: {
Expand Down
10 changes: 0 additions & 10 deletions packages/devtools-kit/src/_types/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ export interface ModuleOptions {
*/
viteInspect?: boolean

/**
* Enable Vite DevTools integration
*
* @experimental
* @default false
*/
viteDevTools?: boolean

/**
* Disable dev time authorization check.
*
Expand Down Expand Up @@ -201,12 +193,10 @@ export interface NuxtDevToolsOptions {
hiddenTabCategories: string[]
hiddenTabs: string[]
interactionCloseOnOutsideClick: boolean
minimizePanelInactive: number
pinnedTabs: string[]
scale: number
showExperimentalFeatures: boolean
showHelpButtons: boolean
showPanel: boolean | null
sidebarExpanded: boolean
sidebarScrollable: boolean
}
Expand Down
1 change: 0 additions & 1 deletion packages/devtools/client/components/DockingPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function toggleSplitScreen() {
<div i-carbon-split-screen />
{{ splitScreenEnabled ? 'Close Split Screen' : 'Split Screen' }}
</NButton>
<PictureInPictureButton />
</div>
<div px3 py2 flex="~ gap2">
<NButton n="primary sm" @click="refreshData">
Expand Down
68 changes: 0 additions & 68 deletions packages/devtools/client/components/PictureInPictureButton.vue

This file was deleted.

1 change: 0 additions & 1 deletion packages/devtools/client/composables/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export function telemetry(event: string, payload?: object, immediate = false) {
os: userAgentInfo.os.name,
osVersion: userAgentInfo.os.version,
deviceType: userAgentInfo.device.type,
inPopup: !!window.__NUXT_DEVTOOLS_IS_POPUP__,
...payload,
}, immediate)
}
15 changes: 0 additions & 15 deletions packages/devtools/client/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,31 +1,19 @@
<script setup lang="ts">
import { definePageMeta } from '#imports'
import { ref } from 'vue'
import { useClient } from '~/composables/client'
import { isFirstVisit } from '~/composables/storage'
import { useDevToolsOptions } from '~/composables/storage-options'
import { telemetryEnabled } from '~/composables/telemetry'

definePageMeta({
layout: 'none',
})

const client = useClient()
const telemetryModel = ref(true)

const {
showPanel,
} = useDevToolsOptions('ui')

function visit() {
telemetryEnabled.value = telemetryModel.value
isFirstVisit.value = false
}

function hideFloatingPanel() {
showPanel.value = false
client.value.devtools.close()
}
</script>

<template>
Expand All @@ -48,9 +36,6 @@ function hideFloatingPanel() {
<NButton to="/modules/overview" n="lg primary" @click="visit">
<span>Get Started</span>
</NButton>
<NButton v-if="showPanel !== false" n="borderless orange" @click="hideFloatingPanel">
<span>Always hide the floating panel</span>
</NButton>
</div>
<div p4>
<div flex="~ col gap-2" mxa>
Expand Down
29 changes: 0 additions & 29 deletions packages/devtools/client/pages/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ definePageMeta({

const {
interactionCloseOnOutsideClick,
showPanel,
showHelpButtons,
scale,
hiddenTabs,
pinnedTabs,
hiddenTabCategories,
minimizePanelInactive,
sidebarExpanded,
sidebarScrollable,
} = useDevToolsOptions('ui')
Expand Down Expand Up @@ -51,15 +49,6 @@ const scaleOptions = [
['Huge', 18 / 15],
]

const MinimizeInactiveOptions = [
['Always', 0],
['1s', 1000],
['2s', 2000],
['5s', 5000],
['10s', 10000],
['Never', -1],
]

const categories = getCategorizedTabs(useAllTabs())

function toggleTab(name: string, v?: boolean) {
Expand Down Expand Up @@ -116,11 +105,6 @@ watchEffect(() => {
if (client.value)
client.value.app.frameState.value.closeOnOutsideClick = interactionCloseOnOutsideClick.value
})

watchEffect(() => {
if (client.value)
client.value.app.frameState.value.minimizePanelInactive = minimizePanelInactive.value
})
</script>

<template>
Expand Down Expand Up @@ -232,19 +216,6 @@ watchEffect(() => {
<span>Show help buttons</span>
</NCheckbox>

<NCheckbox v-model="showPanel" n-primary>
<span>Show the floating panel</span>
</NCheckbox>

<div mx--2 my1 h-1px border="b base" op75 />

<p>Minimize floating panel on inactive</p>
<NSelect v-model.number="minimizePanelInactive" n-primary>
<option v-for="i of MinimizeInactiveOptions" :key="i[0]" :value="i[1]">
{{ i[0] }}
</option>
</NSelect>

<div mx--2 my1 h-1px border="b base" op75 />

<p>Open In Editor</p>
Expand Down
15 changes: 4 additions & 11 deletions packages/devtools/client/setup/vue-devtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,23 @@ export function ensureVueDevTools() {

const state = useDevToolsFrameState()

const isInPopup = window.__NUXT_DEVTOOLS_IS_POPUP__

function toggleClientDetected(state: boolean) {
function toggleClientDetected(detected: boolean) {
if (connected.value) {
rpc.value.updateDevToolsClientDetected({
iframe: state,
iframe: detected,
})
}
else {
onRpcConnected(() => {
rpc.value.updateDevToolsClientDetected({
iframe: state,
iframe: detected,
})
})
}
}

watchEffect(() => {
if (isInPopup) {
toggleClientDetected(true)
}
else {
toggleClientDetected(state.value?.open ?? false)
}
toggleClientDetected(state.value?.open ?? false)
})

createRpcClient(functions, {
Expand Down
8 changes: 2 additions & 6 deletions packages/devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,13 @@
"prepack": "pnpm build"
},
"peerDependencies": {
"@vitejs/devtools": "*",
"vite": ">=6.0"
},
"peerDependenciesMeta": {
"@vitejs/devtools": {
"optional": true
}
},
"dependencies": {
"@nuxt/devtools-kit": "workspace:*",
"@nuxt/kit": "catalog:prod",
"@vitejs/devtools": "catalog:buildtools",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟑 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the duplicate dependency entries
cat packages/devtools/package.json | jq '{dependencies: .dependencies["@vitejs/devtools"], devDependencies: .devDependencies["@vitejs/devtools"]}'

Repository: nuxt/devtools

Length of output: 142


🏁 Script executed:

# Read the package.json to see context around the duplicate entries
head -n 110 packages/devtools/package.json | tail -n 60

Repository: nuxt/devtools

Length of output: 2379


🏁 Script executed:

# Search for actual usage of `@vitejs/devtools` in the codebase
rg "@vitejs/devtools" --type json --type ts --type js -i

Repository: nuxt/devtools

Length of output: 586


Remove @vitejs/devtools from devDependencies.

The package is already listed in dependencies (line 53) and is imported at runtime in src/module-main.ts and src/runtime/plugins/vite-devtools.client.ts. The devDependencies entry at line 102 is redundant and should be removed.

πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/devtools/package.json` at line 53, Remove the redundant
devDependencies entry for "@vitejs/devtools" from package.json so the package is
only declared once (in dependencies); search for the devDependencies block that
contains "@vitejs/devtools" and delete that line, then run your package manager
(install/lockfile update) to sync changes β€” ensure runtime imports in
src/module-main.ts and src/runtime/plugins/vite-devtools.client.ts continue to
resolve from the single dependencies entry.

"@vitejs/devtools-kit": "catalog:types",
"@vue/devtools-core": "catalog:frontend",
"@vue/devtools-kit": "catalog:prod",
"birpc": "catalog:frontend",
Expand Down
2 changes: 0 additions & 2 deletions packages/devtools/src/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ export const defaultTabOptions: NuxtDevToolsOptions = {
interactionCloseOnOutsideClick: false,
showExperimentalFeatures: false,
showHelpButtons: true,
showPanel: true,
scale: 1,
minimizePanelInactive: 5000,
hiddenTabs: [],
pinnedTabs: [],
hiddenTabCategories: [],
Expand Down
Loading
Loading