Skip to content

Commit

Permalink
fix: Revert using ref/watch
Browse files Browse the repository at this point in the history
  • Loading branch information
Azurewarth0920 committed Feb 26, 2024
1 parent f6401c1 commit a5c1688
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/devtools-kit/__tests__/api/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('vue plugin', () => {
await new Promise<void>((resolve) => {
devtools.hook.on.vueAppInit(() => {
const [appRecord] = devtoolsAppRecords.value
expect(devtools.state.pluginBuffer.value.findIndex(([descriptor]) => descriptor.packageName === 'vue-router')).toBeGreaterThanOrEqual(0)
expect(devtools.state.pluginBuffer.findIndex(([descriptor]) => descriptor.packageName === 'vue-router')).toBeGreaterThanOrEqual(0)
expect(appRecord.moduleDetectives?.vueRouter).toBe(true)
resolve()
})
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools-kit/src/core/app-record/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export async function toggleActiveAppRecord(id: string) {
devtoolsContext.clear()
const appRecord = devtoolsAppRecords.value.find(record => record.id === id)
if (appRecord) {
devtoolsState.pluginBuffer.value = devtoolsState.pluginBuffer.value.filter(([plugin]) => plugin.id !== 'components')
devtoolsState.pluginBuffer = devtoolsState.pluginBuffer.filter(([plugin]) => plugin.id !== 'components')
const api = new DevToolsPluginApi()
appRecord.api = api
setActiveAppRecord(appRecord)
Expand Down
3 changes: 1 addition & 2 deletions packages/devtools-kit/src/state/state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ref } from 'vue'
import { target as global } from '@vue/devtools-shared'
import { debounce } from 'perfect-debounce'
import type { DevToolsState } from '../types'
Expand All @@ -15,7 +14,7 @@ function initStateFactory() {
appRecords: [],
activeAppRecord: null,
selectedComponentId: null,
pluginBuffer: ref([]),
pluginBuffer: [],
tabs: [],
commands: [],
vitePluginDetected: false,
Expand Down
3 changes: 1 addition & 2 deletions packages/devtools-kit/src/types/state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Ref } from 'vue'
import type { CustomCommand } from '../core/custom-command'
import type { CustomTab } from '../core/custom-tab'
import type { AppRecord, PluginDescriptor, PluginSetupFunction } from './app'
Expand All @@ -10,7 +9,7 @@ export interface DevToolsState {
appRecords: AppRecord[]
activeAppRecord: AppRecord | null
selectedComponentId: string | null
pluginBuffer: Ref<[PluginDescriptor, PluginSetupFunction][]>
pluginBuffer: [PluginDescriptor, PluginSetupFunction][]
tabs: CustomTab[]
commands: CustomCommand[]
activeAppRecordId: string | null
Expand Down

0 comments on commit a5c1688

Please sign in to comment.