|
1 | 1 | import { debounce } from 'perfect-debounce'
|
2 | 2 | import { VueAppInstance } from '../types'
|
3 | 3 | import { DevToolsEvents, apiHooks, setupDevToolsPlugin } from '../api'
|
4 |
| -import { devtoolsContext } from '../state' |
| 4 | +import { devtoolsContext, devtoolsState } from '../state' |
5 | 5 | import { hook } from '../hook'
|
6 | 6 | import { getAppRecord, getComponentId, getComponentInstance } from '../core/component/utils'
|
7 | 7 | import { getComponentBoundingRect } from '../core/component/state/bounding-rect'
|
@@ -96,6 +96,9 @@ export function registerComponentDevToolsPlugin(app: VueAppInstance) {
|
96 | 96 | }, 120)
|
97 | 97 |
|
98 | 98 | const componentAddedCleanup = hook.on.componentAdded(async (app, uid, parentUid, component) => {
|
| 99 | + if (devtoolsState.highPerfModeEnabled) |
| 100 | + return |
| 101 | + |
99 | 102 | if (app?._instance?.type?.devtools?.hide)
|
100 | 103 | return
|
101 | 104 |
|
@@ -124,6 +127,9 @@ export function registerComponentDevToolsPlugin(app: VueAppInstance) {
|
124 | 127 | })
|
125 | 128 |
|
126 | 129 | const componentUpdatedCleanup = hook.on.componentUpdated(async (app, uid, parentUid, component) => {
|
| 130 | + if (devtoolsState.highPerfModeEnabled) |
| 131 | + return |
| 132 | + |
127 | 133 | if (app?._instance?.type?.devtools?.hide)
|
128 | 134 | return
|
129 | 135 |
|
@@ -152,6 +158,9 @@ export function registerComponentDevToolsPlugin(app: VueAppInstance) {
|
152 | 158 | debounceSendInspectorState()
|
153 | 159 | })
|
154 | 160 | const componentRemovedCleanup = hook.on.componentRemoved(async (app, uid, parentUid, component) => {
|
| 161 | + if (devtoolsState.highPerfModeEnabled) |
| 162 | + return |
| 163 | + |
155 | 164 | if (app?._instance?.type?.devtools?.hide)
|
156 | 165 | return
|
157 | 166 |
|
|
0 commit comments