@@ -12,6 +12,7 @@ import { JobQueue } from './util/queue'
12
12
import { scan } from './legacy/scan'
13
13
import { addBuiltinLayers , removeLayersForApp } from './timeline'
14
14
import { getBackend , availableBackends } from './backend'
15
+ import { hook } from './global-hook.js'
15
16
16
17
const jobs = new JobQueue ( )
17
18
@@ -30,6 +31,10 @@ async function registerAppJob (options: AppRecordOptions, ctx: BackendContext) {
30
31
return
31
32
}
32
33
34
+ if ( ! options . version ) {
35
+ throw new Error ( '[Vue Devtools] Vue version not found' )
36
+ }
37
+
33
38
// Find correct backend
34
39
const baseFrameworkVersion = parseInt ( options . version . substring ( 0 , options . version . indexOf ( '.' ) ) )
35
40
for ( let i = 0 ; i < availableBackends . length ; i ++ ) {
@@ -221,16 +226,6 @@ export async function removeApp (app: App, ctx: BackendContext) {
221
226
}
222
227
}
223
228
224
- // eslint-disable-next-line camelcase
225
- function _legacy_getVueFromApp ( app ) {
226
- if ( app . constructor . name === 'VueComponent' ) {
227
- // When Vue.extend is used the component is an instance of VueComponent instead of Vue.
228
- // VueComponent has a property super which points to the original Vue constructor
229
- return app . constructor . super
230
- }
231
- return app . constructor
232
- }
233
-
234
229
// eslint-disable-next-line camelcase
235
230
export async function _legacy_getAndRegisterApps ( ctx : BackendContext ) {
236
231
// Remove apps that are legacy
@@ -242,11 +237,11 @@ export async function _legacy_getAndRegisterApps (ctx: BackendContext) {
242
237
243
238
const apps = scan ( )
244
239
apps . forEach ( app => {
245
- const Vue = _legacy_getVueFromApp ( app )
240
+ const Vue = hook . Vue
246
241
registerApp ( {
247
242
app,
248
243
types : { } ,
249
- version : Vue . version ,
244
+ version : Vue ? .version ,
250
245
meta : {
251
246
Vue,
252
247
} ,
0 commit comments