Skip to content

Commit 5af5022

Browse files
committedFeb 18, 2025
fix(devtools): remove unused RPC code
1 parent 184b1fa commit 5af5022

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed
 

Diff for: ‎client/composables/rpc.ts

+1-15
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import type { NuxtDevtoolsClient, NuxtDevtoolsIframeClient } from '@nuxt/devtools-kit/types'
22
import type { $Fetch } from 'nitropack'
3-
import type { ClientFunctions, ServerFunctions } from '../../src/devtools'
43
import { onDevtoolsClientConnected } from '@nuxt/devtools-kit/iframe-client'
54
import { ref, watchEffect } from 'vue'
6-
import { globalRefreshTime, path, query, refreshSources } from '~/util/logic'
5+
import { path, query, refreshSources } from '~/util/logic'
76

87
export const appFetch = ref<$Fetch>()
98

@@ -28,17 +27,4 @@ onDevtoolsClientConnected(async (client) => {
2827
})
2928
devtools.value = client.devtools
3029
devtoolsClient.value = client
31-
client.devtools.extendClientRpc<ServerFunctions, ClientFunctions>('nuxt-robots', {
32-
refreshRouteData(path) {
33-
// if path matches
34-
if (devtoolsClient.value?.host.nuxt.vueApp.config?.globalProperties?.$route.matched[0].components?.default.__file.includes(path))
35-
refreshSources()
36-
},
37-
refresh() {
38-
refreshSources()
39-
},
40-
refreshGlobalData() {
41-
globalRefreshTime.value = Date.now()
42-
},
43-
})
4430
})

Diff for: ‎src/devtools.ts

-15
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,8 @@ import type { Resolver } from '@nuxt/kit'
22
import type { Nuxt } from 'nuxt/schema'
33
import type { ModuleOptions } from './module'
44
import { existsSync } from 'node:fs'
5-
import { extendServerRpc, onDevToolsInitialized } from '@nuxt/devtools-kit'
65
import { useNuxt } from '@nuxt/kit'
76

8-
export interface ServerFunctions {}
9-
10-
export interface ClientFunctions {
11-
refresh: () => void
12-
refreshRouteData: (path: string) => void
13-
refreshGlobalData: () => void
14-
}
15-
167
const DEVTOOLS_UI_ROUTE = '/__nuxt-robots'
178
const DEVTOOLS_UI_LOCAL_PORT = 3030
189

@@ -44,12 +35,6 @@ export function setupDevToolsUI(options: ModuleOptions, resolve: Resolver['resol
4435
})
4536
}
4637

47-
// wait for DevTools to be initialized
48-
onDevToolsInitialized(async () => {
49-
/* const rpc = */
50-
extendServerRpc<ClientFunctions, ServerFunctions>('nuxt-robots', {})
51-
})
52-
5338
nuxt.hook('devtools:customTabs', (tabs) => {
5439
tabs.push({
5540
// unique identifier

0 commit comments

Comments
 (0)
Please sign in to comment.