File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
packages/runtime-core/src Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,11 @@ interface DevtoolsHook {
2828 once : ( event : string , handler : Function ) => void
2929 off : ( event : string , handler : Function ) => void
3030 appRecords : AppRecord [ ]
31- _buffer : any [ ] [ ]
31+ /**
32+ * Added at https://github.com/vuejs/devtools/commit/f2ad51eea789006ab66942e5a27c0f0986a257f9
33+ * Returns wether the arg was buffered or not
34+ */
35+ cleanupBuffer ?: ( matchArg : unknown ) => boolean
3236}
3337
3438export let devtools : DevtoolsHook
@@ -109,18 +113,14 @@ const _devtoolsComponentRemoved = /*#__PURE__*/ createDevtoolsComponentHook(
109113export const devtoolsComponentRemoved = (
110114 component : ComponentInternalInstance
111115) => {
112- if ( devtools && devtools . _buffer . length ) {
113- let wasBuffered = false
114- devtools . _buffer = devtools . _buffer . filter ( item => {
115- if ( item . some ( arg => arg === component ) ) {
116- wasBuffered = true
117- return false
118- }
119- return true
120- } )
121- if ( wasBuffered ) return
116+ if (
117+ devtools &&
118+ typeof devtools . cleanupBuffer === 'function' &&
119+ // remove the component if it wasn't buffered
120+ ! devtools . cleanupBuffer ( component )
121+ ) {
122+ _devtoolsComponentRemoved ( component )
122123 }
123- _devtoolsComponentRemoved ( component )
124124}
125125
126126function createDevtoolsComponentHook ( hook : DevtoolsHooks ) {
You can’t perform that action at this time.
0 commit comments