@vue/devtools-kit 7.5.5 → 7.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1764,9 +1764,13 @@ async function getComponentId(options) {
1764
1764
  }
1765
1765
  }
1766
1766
  function isFragment(instance) {
1767
- var _a25;
1767
+ var _a25, _b25;
1768
1768
  const subTreeType = (_a25 = instance.subTree) == null ? void 0 : _a25.type;
1769
- return subTreeType === Fragment;
1769
+ const appRecord = getAppRecord(instance);
1770
+ if (appRecord) {
1771
+ return ((_b25 = appRecord == null ? void 0 : appRecord.types) == null ? void 0 : _b25.Fragment) === subTreeType;
1772
+ }
1773
+ return false;
1770
1774
  }
1771
1775
  function isBeingDestroyed(instance) {
1772
1776
  return instance._isBeingDestroyed || instance.isUnmounted;
@@ -2583,7 +2587,8 @@ function createDevToolsCtxHooks() {
2583
2587
  });
2584
2588
  hooks2.hook("timelineEventAdded" /* TIMELINE_EVENT_ADDED */, ({ options, plugin }) => {
2585
2589
  var _a25;
2586
- if (devtoolsState.highPerfModeEnabled || !((_a25 = devtoolsState.timelineLayersState) == null ? void 0 : _a25[plugin.descriptor.id]))
2590
+ const internalLayerIds = ["performance", "component-event", "keyboard", "mouse"];
2591
+ if (devtoolsState.highPerfModeEnabled || !((_a25 = devtoolsState.timelineLayersState) == null ? void 0 : _a25[plugin.descriptor.id]) && !internalLayerIds.includes(options.layerId))
2587
2592
  return;
2588
2593
  hooks2.callHookWith(async (callbacks) => {
2589
2594
  await Promise.all(callbacks.map((cb) => cb(options)));
@@ -3014,11 +3019,11 @@ function createDevToolsHook() {
3014
3019
  }
3015
3020
  function subscribeDevToolsHook() {
3016
3021
  const hook2 = import_devtools_shared10.target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
3017
- hook2.on("app:init" /* APP_INIT */, (app, version) => {
3022
+ hook2.on("app:init" /* APP_INIT */, (app, version, types) => {
3018
3023
  var _a25, _b25, _c;
3019
3024
  if ((_c = (_b25 = (_a25 = app == null ? void 0 : app._instance) == null ? void 0 : _a25.type) == null ? void 0 : _b25.devtools) == null ? void 0 : _c.hide)
3020
3025
  return;
3021
- devtoolsHooks.callHook("app:init" /* APP_INIT */, app, version);
3026
+ devtoolsHooks.callHook("app:init" /* APP_INIT */, app, version, types);
3022
3027
  });
3023
3028
  hook2.on("app:unmount" /* APP_UNMOUNT */, (app) => {
3024
3029
  devtoolsHooks.callHook("app:unmount" /* APP_UNMOUNT */, app);
@@ -3145,6 +3150,9 @@ var DevToolsV6PluginAPI = class {
3145
3150
  selectInspectorNode(inspectorId, nodeId) {
3146
3151
  this.hooks.callHook("customInspectorSelectNode" /* CUSTOM_INSPECTOR_SELECT_NODE */, { inspectorId, nodeId, plugin: this.plugin });
3147
3152
  }
3153
+ visitComponentTree(payload) {
3154
+ return this.hooks.callHook("visitComponentTree" /* VISIT_COMPONENT_TREE */, payload);
3155
+ }
3148
3156
  // timeline
3149
3157
  now() {
3150
3158
  return Date.now();
@@ -3632,10 +3640,11 @@ var ComponentWalker = class {
3632
3640
  constructor(options) {
3633
3641
  // Dedupe instances (Some instances may be both on a component and on a child abstract/functional component)
3634
3642
  this.captureIds = /* @__PURE__ */ new Map();
3635
- const { filterText = "", maxDepth, recursively } = options;
3643
+ const { filterText = "", maxDepth, recursively, api } = options;
3636
3644
  this.componentFilter = createComponentFilter(filterText);
3637
3645
  this.maxDepth = maxDepth;
3638
3646
  this.recursively = recursively;
3647
+ this.api = api;
3639
3648
  }
3640
3649
  getComponentTree(instance) {
3641
3650
  this.captureIds = /* @__PURE__ */ new Map();
@@ -3734,6 +3743,12 @@ var ComponentWalker = class {
3734
3743
  });
3735
3744
  this.mark(instance, true);
3736
3745
  }
3746
+ this.api.visitComponentTree({
3747
+ treeNode,
3748
+ componentInstance: instance,
3749
+ app: instance.appContext.app,
3750
+ filter: this.componentFilter.filter
3751
+ });
3737
3752
  return treeNode;
3738
3753
  }
3739
3754
  /**
@@ -4063,7 +4078,8 @@ function createComponentsDevToolsPlugin(app) {
4063
4078
  filterText: payload.filter,
4064
4079
  // @TODO: should make this configurable?
4065
4080
  maxDepth: 100,
4066
- recursively: false
4081
+ recursively: false,
4082
+ api
4067
4083
  });
4068
4084
  payload.rootNodes = await walker2.getComponentTree(instance);
4069
4085
  }
@@ -4497,7 +4513,7 @@ function getAppRecordId(app, defaultId) {
4497
4513
  app.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ = id;
4498
4514
  return id;
4499
4515
  }
4500
- function createAppRecord(app) {
4516
+ function createAppRecord(app, types) {
4501
4517
  const rootInstance = getAppRootInstance(app);
4502
4518
  if (rootInstance) {
4503
4519
  appRecordInfo.id++;
@@ -4506,6 +4522,7 @@ function createAppRecord(app) {
4506
4522
  const record = {
4507
4523
  id,
4508
4524
  name,
4525
+ types,
4509
4526
  instanceMap: /* @__PURE__ */ new Map(),
4510
4527
  perfGroupIds: /* @__PURE__ */ new Map(),
4511
4528
  rootInstance
@@ -4537,12 +4554,13 @@ function initDevTools() {
4537
4554
  }
4538
4555
  }
4539
4556
  import_devtools_shared21.target.__VUE_DEVTOOLS_GLOBAL_HOOK__.once("init", (Vue) => {
4540
- console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 700; font-size: 20px;");
4541
- console.log("%cVue DevTools v7 detected in your Vue2 project. v7 only supports Vue3 and will not work.", "font-bold: 700; font-size: 16px;");
4557
+ import_devtools_shared21.target.__VUE_DEVTOOLS_VUE2_APP_DETECTED__ = true;
4558
+ console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 600; font-size: 16px;");
4559
+ console.log("%cVue DevTools v7 detected in your Vue2 project. v7 only supports Vue3 and will not work.", "font-bold: 500; font-size: 14px;");
4542
4560
  const url = "https://chromewebstore.google.com/detail/vuejs-devtools/iaajmlceplecbljialhhkmedjlpdblhp";
4543
- console.log(`%cThe legacy version that supports both Vue 2 and Vue 3 has been moved to %c ${url}`, "font-size: 16px;", "text-decoration: underline; cursor: pointer;font-size: 16px;");
4544
- console.log("%cPlease install and enable only the legacy version for your Vue2 app.", "font-bold: 700; font-size: 16px;");
4545
- console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 700; font-size: 20px;");
4561
+ console.log(`%cThe legacy version that supports both Vue 2 and Vue 3 has been moved to %c ${url}`, "font-size: 14px;", "text-decoration: underline; cursor: pointer;font-size: 14px;");
4562
+ console.log("%cPlease install and enable only the legacy version for your Vue2 app.", "font-bold: 500; font-size: 14px;");
4563
+ console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 600; font-size: 16px;");
4546
4564
  });
4547
4565
  hook.on.setupDevtoolsPlugin((pluginDescriptor, setupFn) => {
4548
4566
  var _a26;
@@ -4561,8 +4579,8 @@ function initDevTools() {
4561
4579
  import_devtools_shared21.target.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn, { target: "legacy" });
4562
4580
  });
4563
4581
  });
4564
- hook.on.vueAppInit(async (app, version) => {
4565
- const appRecord = createAppRecord(app);
4582
+ hook.on.vueAppInit(async (app, version, types) => {
4583
+ const appRecord = createAppRecord(app, types);
4566
4584
  const normalizedAppRecord = {
4567
4585
  ...appRecord,
4568
4586
  app,
package/dist/index.d.cts CHANGED
@@ -624,6 +624,7 @@ declare class DevToolsV6PluginAPI {
624
624
  sendInspectorTree(inspectorId: string): void;
625
625
  sendInspectorState(inspectorId: string): void;
626
626
  selectInspectorNode(inspectorId: string, nodeId: string): void;
627
+ visitComponentTree(payload: DevToolsV6PluginAPIHookPayloads[DevToolsV6PluginAPIHookKeys.VISIT_COMPONENT_TREE]): Promise<any>;
627
628
  now(): number;
628
629
  addTimelineLayer(options: TimelineLayerOptions): void;
629
630
  addTimelineEvent(options: TimelineEventOptions): void;
@@ -696,7 +697,7 @@ declare enum DevToolsHooks {
696
697
  SETUP_DEVTOOLS_PLUGIN = "devtools-plugin:setup"
697
698
  }
698
699
  interface DevToolsEvent {
699
- [DevToolsHooks.APP_INIT]: (app: VueAppInstance['appContext']['app'], version: string) => void | Promise<void>;
700
+ [DevToolsHooks.APP_INIT]: (app: VueAppInstance['appContext']['app'], version: string, types: Record<string, string | symbol>) => void | Promise<void>;
700
701
  [DevToolsHooks.APP_CONNECTED]: () => void;
701
702
  [DevToolsHooks.APP_UNMOUNT]: (app: VueAppInstance['appContext']['app']) => void | Promise<void>;
702
703
  [DevToolsHooks.COMPONENT_ADDED]: (app: HookAppInstance, uid: number, parentUid: number, component: VueAppInstance) => void | Promise<void>;
package/dist/index.d.ts CHANGED
@@ -624,6 +624,7 @@ declare class DevToolsV6PluginAPI {
624
624
  sendInspectorTree(inspectorId: string): void;
625
625
  sendInspectorState(inspectorId: string): void;
626
626
  selectInspectorNode(inspectorId: string, nodeId: string): void;
627
+ visitComponentTree(payload: DevToolsV6PluginAPIHookPayloads[DevToolsV6PluginAPIHookKeys.VISIT_COMPONENT_TREE]): Promise<any>;
627
628
  now(): number;
628
629
  addTimelineLayer(options: TimelineLayerOptions): void;
629
630
  addTimelineEvent(options: TimelineEventOptions): void;
@@ -696,7 +697,7 @@ declare enum DevToolsHooks {
696
697
  SETUP_DEVTOOLS_PLUGIN = "devtools-plugin:setup"
697
698
  }
698
699
  interface DevToolsEvent {
699
- [DevToolsHooks.APP_INIT]: (app: VueAppInstance['appContext']['app'], version: string) => void | Promise<void>;
700
+ [DevToolsHooks.APP_INIT]: (app: VueAppInstance['appContext']['app'], version: string, types: Record<string, string | symbol>) => void | Promise<void>;
700
701
  [DevToolsHooks.APP_CONNECTED]: () => void;
701
702
  [DevToolsHooks.APP_UNMOUNT]: (app: VueAppInstance['appContext']['app']) => void | Promise<void>;
702
703
  [DevToolsHooks.COMPONENT_ADDED]: (app: HookAppInstance, uid: number, parentUid: number, component: VueAppInstance) => void | Promise<void>;
package/dist/index.js CHANGED
@@ -1673,9 +1673,13 @@ async function getComponentId(options) {
1673
1673
  }
1674
1674
  }
1675
1675
  function isFragment(instance) {
1676
- var _a25;
1676
+ var _a25, _b25;
1677
1677
  const subTreeType = (_a25 = instance.subTree) == null ? void 0 : _a25.type;
1678
- return subTreeType === Fragment;
1678
+ const appRecord = getAppRecord(instance);
1679
+ if (appRecord) {
1680
+ return ((_b25 = appRecord == null ? void 0 : appRecord.types) == null ? void 0 : _b25.Fragment) === subTreeType;
1681
+ }
1682
+ return false;
1679
1683
  }
1680
1684
  function isBeingDestroyed(instance) {
1681
1685
  return instance._isBeingDestroyed || instance.isUnmounted;
@@ -2492,7 +2496,8 @@ function createDevToolsCtxHooks() {
2492
2496
  });
2493
2497
  hooks2.hook("timelineEventAdded" /* TIMELINE_EVENT_ADDED */, ({ options, plugin }) => {
2494
2498
  var _a25;
2495
- if (devtoolsState.highPerfModeEnabled || !((_a25 = devtoolsState.timelineLayersState) == null ? void 0 : _a25[plugin.descriptor.id]))
2499
+ const internalLayerIds = ["performance", "component-event", "keyboard", "mouse"];
2500
+ if (devtoolsState.highPerfModeEnabled || !((_a25 = devtoolsState.timelineLayersState) == null ? void 0 : _a25[plugin.descriptor.id]) && !internalLayerIds.includes(options.layerId))
2496
2501
  return;
2497
2502
  hooks2.callHookWith(async (callbacks) => {
2498
2503
  await Promise.all(callbacks.map((cb) => cb(options)));
@@ -2923,11 +2928,11 @@ function createDevToolsHook() {
2923
2928
  }
2924
2929
  function subscribeDevToolsHook() {
2925
2930
  const hook2 = target7.__VUE_DEVTOOLS_GLOBAL_HOOK__;
2926
- hook2.on("app:init" /* APP_INIT */, (app, version) => {
2931
+ hook2.on("app:init" /* APP_INIT */, (app, version, types) => {
2927
2932
  var _a25, _b25, _c;
2928
2933
  if ((_c = (_b25 = (_a25 = app == null ? void 0 : app._instance) == null ? void 0 : _a25.type) == null ? void 0 : _b25.devtools) == null ? void 0 : _c.hide)
2929
2934
  return;
2930
- devtoolsHooks.callHook("app:init" /* APP_INIT */, app, version);
2935
+ devtoolsHooks.callHook("app:init" /* APP_INIT */, app, version, types);
2931
2936
  });
2932
2937
  hook2.on("app:unmount" /* APP_UNMOUNT */, (app) => {
2933
2938
  devtoolsHooks.callHook("app:unmount" /* APP_UNMOUNT */, app);
@@ -3054,6 +3059,9 @@ var DevToolsV6PluginAPI = class {
3054
3059
  selectInspectorNode(inspectorId, nodeId) {
3055
3060
  this.hooks.callHook("customInspectorSelectNode" /* CUSTOM_INSPECTOR_SELECT_NODE */, { inspectorId, nodeId, plugin: this.plugin });
3056
3061
  }
3062
+ visitComponentTree(payload) {
3063
+ return this.hooks.callHook("visitComponentTree" /* VISIT_COMPONENT_TREE */, payload);
3064
+ }
3057
3065
  // timeline
3058
3066
  now() {
3059
3067
  return Date.now();
@@ -3541,10 +3549,11 @@ var ComponentWalker = class {
3541
3549
  constructor(options) {
3542
3550
  // Dedupe instances (Some instances may be both on a component and on a child abstract/functional component)
3543
3551
  this.captureIds = /* @__PURE__ */ new Map();
3544
- const { filterText = "", maxDepth, recursively } = options;
3552
+ const { filterText = "", maxDepth, recursively, api } = options;
3545
3553
  this.componentFilter = createComponentFilter(filterText);
3546
3554
  this.maxDepth = maxDepth;
3547
3555
  this.recursively = recursively;
3556
+ this.api = api;
3548
3557
  }
3549
3558
  getComponentTree(instance) {
3550
3559
  this.captureIds = /* @__PURE__ */ new Map();
@@ -3643,6 +3652,12 @@ var ComponentWalker = class {
3643
3652
  });
3644
3653
  this.mark(instance, true);
3645
3654
  }
3655
+ this.api.visitComponentTree({
3656
+ treeNode,
3657
+ componentInstance: instance,
3658
+ app: instance.appContext.app,
3659
+ filter: this.componentFilter.filter
3660
+ });
3646
3661
  return treeNode;
3647
3662
  }
3648
3663
  /**
@@ -3972,7 +3987,8 @@ function createComponentsDevToolsPlugin(app) {
3972
3987
  filterText: payload.filter,
3973
3988
  // @TODO: should make this configurable?
3974
3989
  maxDepth: 100,
3975
- recursively: false
3990
+ recursively: false,
3991
+ api
3976
3992
  });
3977
3993
  payload.rootNodes = await walker2.getComponentTree(instance);
3978
3994
  }
@@ -4406,7 +4422,7 @@ function getAppRecordId(app, defaultId) {
4406
4422
  app.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ = id;
4407
4423
  return id;
4408
4424
  }
4409
- function createAppRecord(app) {
4425
+ function createAppRecord(app, types) {
4410
4426
  const rootInstance = getAppRootInstance(app);
4411
4427
  if (rootInstance) {
4412
4428
  appRecordInfo.id++;
@@ -4415,6 +4431,7 @@ function createAppRecord(app) {
4415
4431
  const record = {
4416
4432
  id,
4417
4433
  name,
4434
+ types,
4418
4435
  instanceMap: /* @__PURE__ */ new Map(),
4419
4436
  perfGroupIds: /* @__PURE__ */ new Map(),
4420
4437
  rootInstance
@@ -4446,12 +4463,13 @@ function initDevTools() {
4446
4463
  }
4447
4464
  }
4448
4465
  target13.__VUE_DEVTOOLS_GLOBAL_HOOK__.once("init", (Vue) => {
4449
- console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 700; font-size: 20px;");
4450
- console.log("%cVue DevTools v7 detected in your Vue2 project. v7 only supports Vue3 and will not work.", "font-bold: 700; font-size: 16px;");
4466
+ target13.__VUE_DEVTOOLS_VUE2_APP_DETECTED__ = true;
4467
+ console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 600; font-size: 16px;");
4468
+ console.log("%cVue DevTools v7 detected in your Vue2 project. v7 only supports Vue3 and will not work.", "font-bold: 500; font-size: 14px;");
4451
4469
  const url = "https://chromewebstore.google.com/detail/vuejs-devtools/iaajmlceplecbljialhhkmedjlpdblhp";
4452
- console.log(`%cThe legacy version that supports both Vue 2 and Vue 3 has been moved to %c ${url}`, "font-size: 16px;", "text-decoration: underline; cursor: pointer;font-size: 16px;");
4453
- console.log("%cPlease install and enable only the legacy version for your Vue2 app.", "font-bold: 700; font-size: 16px;");
4454
- console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 700; font-size: 20px;");
4470
+ console.log(`%cThe legacy version that supports both Vue 2 and Vue 3 has been moved to %c ${url}`, "font-size: 14px;", "text-decoration: underline; cursor: pointer;font-size: 14px;");
4471
+ console.log("%cPlease install and enable only the legacy version for your Vue2 app.", "font-bold: 500; font-size: 14px;");
4472
+ console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 600; font-size: 16px;");
4455
4473
  });
4456
4474
  hook.on.setupDevtoolsPlugin((pluginDescriptor, setupFn) => {
4457
4475
  var _a26;
@@ -4470,8 +4488,8 @@ function initDevTools() {
4470
4488
  target13.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn, { target: "legacy" });
4471
4489
  });
4472
4490
  });
4473
- hook.on.vueAppInit(async (app, version) => {
4474
- const appRecord = createAppRecord(app);
4491
+ hook.on.vueAppInit(async (app, version, types) => {
4492
+ const appRecord = createAppRecord(app, types);
4475
4493
  const normalizedAppRecord = {
4476
4494
  ...appRecord,
4477
4495
  app,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue/devtools-kit",
3
3
  "type": "module",
4
- "version": "7.5.5",
4
+ "version": "7.6.0",
5
5
  "author": "webfansplz",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "perfect-debounce": "^1.0.0",
30
30
  "speakingurl": "^14.0.1",
31
31
  "superjson": "^2.2.1",
32
- "@vue/devtools-shared": "^7.5.5"
32
+ "@vue/devtools-shared": "^7.6.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/speakingurl": "^13.0.6",