@vue/devtools-kit 7.5.6 → 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;
@@ -3015,11 +3019,11 @@ function createDevToolsHook() {
3015
3019
  }
3016
3020
  function subscribeDevToolsHook() {
3017
3021
  const hook2 = import_devtools_shared10.target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
3018
- hook2.on("app:init" /* APP_INIT */, (app, version) => {
3022
+ hook2.on("app:init" /* APP_INIT */, (app, version, types) => {
3019
3023
  var _a25, _b25, _c;
3020
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)
3021
3025
  return;
3022
- devtoolsHooks.callHook("app:init" /* APP_INIT */, app, version);
3026
+ devtoolsHooks.callHook("app:init" /* APP_INIT */, app, version, types);
3023
3027
  });
3024
3028
  hook2.on("app:unmount" /* APP_UNMOUNT */, (app) => {
3025
3029
  devtoolsHooks.callHook("app:unmount" /* APP_UNMOUNT */, app);
@@ -3146,6 +3150,9 @@ var DevToolsV6PluginAPI = class {
3146
3150
  selectInspectorNode(inspectorId, nodeId) {
3147
3151
  this.hooks.callHook("customInspectorSelectNode" /* CUSTOM_INSPECTOR_SELECT_NODE */, { inspectorId, nodeId, plugin: this.plugin });
3148
3152
  }
3153
+ visitComponentTree(payload) {
3154
+ return this.hooks.callHook("visitComponentTree" /* VISIT_COMPONENT_TREE */, payload);
3155
+ }
3149
3156
  // timeline
3150
3157
  now() {
3151
3158
  return Date.now();
@@ -3633,10 +3640,11 @@ var ComponentWalker = class {
3633
3640
  constructor(options) {
3634
3641
  // Dedupe instances (Some instances may be both on a component and on a child abstract/functional component)
3635
3642
  this.captureIds = /* @__PURE__ */ new Map();
3636
- const { filterText = "", maxDepth, recursively } = options;
3643
+ const { filterText = "", maxDepth, recursively, api } = options;
3637
3644
  this.componentFilter = createComponentFilter(filterText);
3638
3645
  this.maxDepth = maxDepth;
3639
3646
  this.recursively = recursively;
3647
+ this.api = api;
3640
3648
  }
3641
3649
  getComponentTree(instance) {
3642
3650
  this.captureIds = /* @__PURE__ */ new Map();
@@ -3735,6 +3743,12 @@ var ComponentWalker = class {
3735
3743
  });
3736
3744
  this.mark(instance, true);
3737
3745
  }
3746
+ this.api.visitComponentTree({
3747
+ treeNode,
3748
+ componentInstance: instance,
3749
+ app: instance.appContext.app,
3750
+ filter: this.componentFilter.filter
3751
+ });
3738
3752
  return treeNode;
3739
3753
  }
3740
3754
  /**
@@ -4064,7 +4078,8 @@ function createComponentsDevToolsPlugin(app) {
4064
4078
  filterText: payload.filter,
4065
4079
  // @TODO: should make this configurable?
4066
4080
  maxDepth: 100,
4067
- recursively: false
4081
+ recursively: false,
4082
+ api
4068
4083
  });
4069
4084
  payload.rootNodes = await walker2.getComponentTree(instance);
4070
4085
  }
@@ -4498,7 +4513,7 @@ function getAppRecordId(app, defaultId) {
4498
4513
  app.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ = id;
4499
4514
  return id;
4500
4515
  }
4501
- function createAppRecord(app) {
4516
+ function createAppRecord(app, types) {
4502
4517
  const rootInstance = getAppRootInstance(app);
4503
4518
  if (rootInstance) {
4504
4519
  appRecordInfo.id++;
@@ -4507,6 +4522,7 @@ function createAppRecord(app) {
4507
4522
  const record = {
4508
4523
  id,
4509
4524
  name,
4525
+ types,
4510
4526
  instanceMap: /* @__PURE__ */ new Map(),
4511
4527
  perfGroupIds: /* @__PURE__ */ new Map(),
4512
4528
  rootInstance
@@ -4538,12 +4554,13 @@ function initDevTools() {
4538
4554
  }
4539
4555
  }
4540
4556
  import_devtools_shared21.target.__VUE_DEVTOOLS_GLOBAL_HOOK__.once("init", (Vue) => {
4541
- console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 700; font-size: 20px;");
4542
- 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;");
4543
4560
  const url = "https://chromewebstore.google.com/detail/vuejs-devtools/iaajmlceplecbljialhhkmedjlpdblhp";
4544
- 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;");
4545
- console.log("%cPlease install and enable only the legacy version for your Vue2 app.", "font-bold: 700; font-size: 16px;");
4546
- 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;");
4547
4564
  });
4548
4565
  hook.on.setupDevtoolsPlugin((pluginDescriptor, setupFn) => {
4549
4566
  var _a26;
@@ -4562,8 +4579,8 @@ function initDevTools() {
4562
4579
  import_devtools_shared21.target.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn, { target: "legacy" });
4563
4580
  });
4564
4581
  });
4565
- hook.on.vueAppInit(async (app, version) => {
4566
- const appRecord = createAppRecord(app);
4582
+ hook.on.vueAppInit(async (app, version, types) => {
4583
+ const appRecord = createAppRecord(app, types);
4567
4584
  const normalizedAppRecord = {
4568
4585
  ...appRecord,
4569
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;
@@ -2924,11 +2928,11 @@ function createDevToolsHook() {
2924
2928
  }
2925
2929
  function subscribeDevToolsHook() {
2926
2930
  const hook2 = target7.__VUE_DEVTOOLS_GLOBAL_HOOK__;
2927
- hook2.on("app:init" /* APP_INIT */, (app, version) => {
2931
+ hook2.on("app:init" /* APP_INIT */, (app, version, types) => {
2928
2932
  var _a25, _b25, _c;
2929
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)
2930
2934
  return;
2931
- devtoolsHooks.callHook("app:init" /* APP_INIT */, app, version);
2935
+ devtoolsHooks.callHook("app:init" /* APP_INIT */, app, version, types);
2932
2936
  });
2933
2937
  hook2.on("app:unmount" /* APP_UNMOUNT */, (app) => {
2934
2938
  devtoolsHooks.callHook("app:unmount" /* APP_UNMOUNT */, app);
@@ -3055,6 +3059,9 @@ var DevToolsV6PluginAPI = class {
3055
3059
  selectInspectorNode(inspectorId, nodeId) {
3056
3060
  this.hooks.callHook("customInspectorSelectNode" /* CUSTOM_INSPECTOR_SELECT_NODE */, { inspectorId, nodeId, plugin: this.plugin });
3057
3061
  }
3062
+ visitComponentTree(payload) {
3063
+ return this.hooks.callHook("visitComponentTree" /* VISIT_COMPONENT_TREE */, payload);
3064
+ }
3058
3065
  // timeline
3059
3066
  now() {
3060
3067
  return Date.now();
@@ -3542,10 +3549,11 @@ var ComponentWalker = class {
3542
3549
  constructor(options) {
3543
3550
  // Dedupe instances (Some instances may be both on a component and on a child abstract/functional component)
3544
3551
  this.captureIds = /* @__PURE__ */ new Map();
3545
- const { filterText = "", maxDepth, recursively } = options;
3552
+ const { filterText = "", maxDepth, recursively, api } = options;
3546
3553
  this.componentFilter = createComponentFilter(filterText);
3547
3554
  this.maxDepth = maxDepth;
3548
3555
  this.recursively = recursively;
3556
+ this.api = api;
3549
3557
  }
3550
3558
  getComponentTree(instance) {
3551
3559
  this.captureIds = /* @__PURE__ */ new Map();
@@ -3644,6 +3652,12 @@ var ComponentWalker = class {
3644
3652
  });
3645
3653
  this.mark(instance, true);
3646
3654
  }
3655
+ this.api.visitComponentTree({
3656
+ treeNode,
3657
+ componentInstance: instance,
3658
+ app: instance.appContext.app,
3659
+ filter: this.componentFilter.filter
3660
+ });
3647
3661
  return treeNode;
3648
3662
  }
3649
3663
  /**
@@ -3973,7 +3987,8 @@ function createComponentsDevToolsPlugin(app) {
3973
3987
  filterText: payload.filter,
3974
3988
  // @TODO: should make this configurable?
3975
3989
  maxDepth: 100,
3976
- recursively: false
3990
+ recursively: false,
3991
+ api
3977
3992
  });
3978
3993
  payload.rootNodes = await walker2.getComponentTree(instance);
3979
3994
  }
@@ -4407,7 +4422,7 @@ function getAppRecordId(app, defaultId) {
4407
4422
  app.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ = id;
4408
4423
  return id;
4409
4424
  }
4410
- function createAppRecord(app) {
4425
+ function createAppRecord(app, types) {
4411
4426
  const rootInstance = getAppRootInstance(app);
4412
4427
  if (rootInstance) {
4413
4428
  appRecordInfo.id++;
@@ -4416,6 +4431,7 @@ function createAppRecord(app) {
4416
4431
  const record = {
4417
4432
  id,
4418
4433
  name,
4434
+ types,
4419
4435
  instanceMap: /* @__PURE__ */ new Map(),
4420
4436
  perfGroupIds: /* @__PURE__ */ new Map(),
4421
4437
  rootInstance
@@ -4447,12 +4463,13 @@ function initDevTools() {
4447
4463
  }
4448
4464
  }
4449
4465
  target13.__VUE_DEVTOOLS_GLOBAL_HOOK__.once("init", (Vue) => {
4450
- console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 700; font-size: 20px;");
4451
- 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;");
4452
4469
  const url = "https://chromewebstore.google.com/detail/vuejs-devtools/iaajmlceplecbljialhhkmedjlpdblhp";
4453
- 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;");
4454
- console.log("%cPlease install and enable only the legacy version for your Vue2 app.", "font-bold: 700; font-size: 16px;");
4455
- 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;");
4456
4473
  });
4457
4474
  hook.on.setupDevtoolsPlugin((pluginDescriptor, setupFn) => {
4458
4475
  var _a26;
@@ -4471,8 +4488,8 @@ function initDevTools() {
4471
4488
  target13.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit("devtools-plugin:setup" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn, { target: "legacy" });
4472
4489
  });
4473
4490
  });
4474
- hook.on.vueAppInit(async (app, version) => {
4475
- const appRecord = createAppRecord(app);
4491
+ hook.on.vueAppInit(async (app, version, types) => {
4492
+ const appRecord = createAppRecord(app, types);
4476
4493
  const normalizedAppRecord = {
4477
4494
  ...appRecord,
4478
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.6",
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.6"
32
+ "@vue/devtools-shared": "^7.6.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/speakingurl": "^13.0.6",