@@ -2,6 +2,7 @@ import type { DevtoolsContext } from '../../ctx'
22import type { App , ComponentBounds , ComponentInstance , CustomInspectorOptions , DevToolsPlugin , TimelineEventOptions , TimelineLayerOptions } from '../../types'
33import { getPluginSettings , initPluginSettings } from '../../core/plugin/plugin-settings'
44
5+ import { devtoolsState } from '../../ctx'
56import { DevToolsContextHookKeys , DevToolsV6PluginAPIHookKeys , DevToolsV6PluginAPIHookPayloads , DevToolsV6PluginAPIHooks } from '../../ctx/hook'
67import { getActiveInspectors } from '../../ctx/inspector'
78import { devtoolsHooks } from '../../hook'
@@ -56,6 +57,9 @@ export class DevToolsV6PluginAPI {
5657
5758 // component inspector
5859 notifyComponentUpdate ( instance ?: ComponentInstance ) {
60+ if ( devtoolsState . highPerfModeEnabled ) {
61+ return
62+ }
5963 const inspector = getActiveInspectors ( ) . find ( i => i . packageName === this . plugin . descriptor . packageName )
6064 if ( inspector ?. id ) {
6165 // @TODO : handler
@@ -85,10 +89,16 @@ export class DevToolsV6PluginAPI {
8589 }
8690
8791 sendInspectorTree ( inspectorId : string ) {
92+ if ( devtoolsState . highPerfModeEnabled ) {
93+ return
94+ }
8895 this . hooks . callHook ( DevToolsContextHookKeys . SEND_INSPECTOR_TREE , { inspectorId, plugin : this . plugin } )
8996 }
9097
9198 sendInspectorState ( inspectorId : string ) {
99+ if ( devtoolsState . highPerfModeEnabled ) {
100+ return
101+ }
92102 this . hooks . callHook ( DevToolsContextHookKeys . SEND_INSPECTOR_STATE , { inspectorId, plugin : this . plugin } )
93103 }
94104
@@ -102,6 +112,9 @@ export class DevToolsV6PluginAPI {
102112
103113 // timeline
104114 now ( ) : number {
115+ if ( devtoolsState . highPerfModeEnabled ) {
116+ return 0
117+ }
105118 return Date . now ( )
106119 }
107120
@@ -110,6 +123,9 @@ export class DevToolsV6PluginAPI {
110123 }
111124
112125 addTimelineEvent ( options : TimelineEventOptions ) {
126+ if ( devtoolsState . highPerfModeEnabled ) {
127+ return
128+ }
113129 this . hooks . callHook ( DevToolsContextHookKeys . TIMELINE_EVENT_ADDED , { options, plugin : this . plugin } )
114130 }
115131
0 commit comments