@vue/devtools-kit 8.0.2 → 8.0.3

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
@@ -111,9 +111,7 @@ function getInstanceName(instance) {
111
111
  * @param {Vue} instance
112
112
  */
113
113
  function getUniqueComponentId(instance) {
114
- const appId = instance?.appContext?.app?.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ ?? 0;
115
- const instanceId = instance === instance?.root ? "root" : instance.uid;
116
- return `${appId}:${instanceId}`;
114
+ return `${instance?.appContext?.app?.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ ?? 0}:${instance === instance?.root ? "root" : instance.uid}`;
117
115
  }
118
116
  function getRenderKey(value) {
119
117
  if (value == null) return "";
@@ -356,10 +354,7 @@ function inspectFn(e) {
356
354
  function selectComponentFn(e, cb) {
357
355
  e.preventDefault();
358
356
  e.stopPropagation();
359
- if (inspectInstance) {
360
- const uniqueComponentId = getUniqueComponentId(inspectInstance);
361
- cb(uniqueComponentId);
362
- }
357
+ if (inspectInstance) cb(getUniqueComponentId(inspectInstance));
363
358
  }
364
359
  let inspectComponentHighLighterSelectFn = null;
365
360
  function cancelInspectComponentHighLighter() {
@@ -640,7 +635,7 @@ function getTimelineLayersStateFromStorage() {
640
635
  performanceEventEnabled: false,
641
636
  selected: ""
642
637
  };
643
- const state = localStorage.getItem(TIMELINE_LAYERS_STATE_STORAGE_ID);
638
+ const state = typeof localStorage.getItem !== "undefined" ? localStorage.getItem(TIMELINE_LAYERS_STATE_STORAGE_ID) : null;
644
639
  return state ? JSON.parse(state) : {
645
640
  recordingState: false,
646
641
  mouseEventEnabled: false,
@@ -1079,10 +1074,7 @@ function getPluginSettings(pluginId, fallbackValue) {
1079
1074
  const localSettings = localStorage.getItem(localKey);
1080
1075
  if (localSettings) return JSON.parse(localSettings);
1081
1076
  }
1082
- if (pluginId) {
1083
- const item = devtoolsPluginBuffer.find((item$1) => item$1[0].id === pluginId)?.[0] ?? null;
1084
- return _getSettings(item?.settings ?? {});
1085
- }
1077
+ if (pluginId) return _getSettings((devtoolsPluginBuffer.find((item) => item[0].id === pluginId)?.[0] ?? null)?.settings ?? {});
1086
1078
  return _getSettings(fallbackValue);
1087
1079
  }
1088
1080
  function initPluginSettings(pluginId, settings) {
@@ -1616,10 +1608,9 @@ function processState(instance) {
1616
1608
  }
1617
1609
  function getStateTypeAndName(info) {
1618
1610
  const stateType = info.computed ? "computed" : info.ref ? "ref" : info.reactive ? "reactive" : null;
1619
- const stateTypeName = stateType ? `${stateType.charAt(0).toUpperCase()}${stateType.slice(1)}` : null;
1620
1611
  return {
1621
1612
  stateType,
1622
- stateTypeName
1613
+ stateTypeName: stateType ? `${stateType.charAt(0).toUpperCase()}${stateType.slice(1)}` : null
1623
1614
  };
1624
1615
  }
1625
1616
  function processSetupState(instance) {
@@ -1753,15 +1744,11 @@ function processInstanceState(instance) {
1753
1744
  //#region src/core/component/state/index.ts
1754
1745
  function getInstanceState(params) {
1755
1746
  const instance = getComponentInstance(activeAppRecord.value, params.instanceId);
1756
- const id = getUniqueComponentId(instance);
1757
- const name = getInstanceName(instance);
1758
- const file = instance?.type?.__file;
1759
- const state = processInstanceState(instance);
1760
1747
  return {
1761
- id,
1762
- name,
1763
- file,
1764
- state,
1748
+ id: getUniqueComponentId(instance),
1749
+ name: getInstanceName(instance),
1750
+ file: instance?.type?.__file,
1751
+ state: processInstanceState(instance),
1765
1752
  instance
1766
1753
  };
1767
1754
  }
@@ -2008,8 +1995,7 @@ function performanceMarkEnd(api, app, uid, vm, type, time) {
2008
1995
  const groupInfo = appRecord.perfGroupIds.get(groupKey);
2009
1996
  if (groupInfo) {
2010
1997
  const groupId = groupInfo.groupId;
2011
- const startTime = groupInfo.time;
2012
- const duration = time - startTime;
1998
+ const duration = time - groupInfo.time;
2013
1999
  api.addTimelineEvent({
2014
2000
  layerId: PERFORMANCE_EVENT_LAYER_ID,
2015
2001
  event: {
@@ -2196,10 +2182,9 @@ function createComponentsDevToolsPlugin(app) {
2196
2182
  if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
2197
2183
  const result = getInstanceState({ instanceId: payload.nodeId });
2198
2184
  const componentInstance = result.instance;
2199
- const app$1 = result.instance?.appContext.app;
2200
2185
  const _payload = {
2201
2186
  componentInstance,
2202
- app: app$1,
2187
+ app: result.instance?.appContext.app,
2203
2188
  instanceData: result
2204
2189
  };
2205
2190
  devtoolsContext.hooks.callHookWith((callbacks) => {
@@ -4343,8 +4328,7 @@ function updateDevToolsClientDetected(params) {
4343
4328
  ...devtoolsState.devtoolsClientDetected,
4344
4329
  ...params
4345
4330
  };
4346
- const devtoolsClientVisible = Object.values(devtoolsState.devtoolsClientDetected).some(Boolean);
4347
- toggleHighPerfMode(!devtoolsClientVisible);
4331
+ toggleHighPerfMode(!Object.values(devtoolsState.devtoolsClientDetected).some(Boolean));
4348
4332
  }
4349
4333
  __vue_devtools_shared.target.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__ ??= updateDevToolsClientDetected;
4350
4334
 
@@ -4906,8 +4890,7 @@ function copy(target$21, options = {}) {
4906
4890
  return [...props, ...symbols].reduce((carry, key) => {
4907
4891
  if (isArray$1(options.props) && !options.props.includes(key)) return carry;
4908
4892
  const val = target$21[key];
4909
- const newVal = copy(val, options);
4910
- assignProp(carry, key, newVal, target$21, options.nonenumerable);
4893
+ assignProp(carry, key, copy(val, options), target$21, options.nonenumerable);
4911
4894
  return carry;
4912
4895
  }, {});
4913
4896
  }
@@ -5414,10 +5397,9 @@ function getFunctionDetails(func) {
5414
5397
  } catch (e) {}
5415
5398
  const match = matches && matches[0];
5416
5399
  const args = typeof match === "string" ? match : "(?)";
5417
- const name = typeof func.name === "string" ? func.name : "";
5418
5400
  return { _custom: {
5419
5401
  type: "function",
5420
- displayText: `<span style="opacity:.8;margin-right:5px;">function</span> <span style="white-space:nowrap;">${escape(name)}${args}</span>`,
5402
+ displayText: `<span style="opacity:.8;margin-right:5px;">function</span> <span style="white-space:nowrap;">${escape(typeof func.name === "string" ? func.name : "")}${args}</span>`,
5421
5403
  tooltipText: string.trim() ? `<pre>${string}</pre>` : null
5422
5404
  } };
5423
5405
  }
package/dist/index.js CHANGED
@@ -107,9 +107,7 @@ function getInstanceName(instance) {
107
107
  * @param {Vue} instance
108
108
  */
109
109
  function getUniqueComponentId(instance) {
110
- const appId = instance?.appContext?.app?.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ ?? 0;
111
- const instanceId = instance === instance?.root ? "root" : instance.uid;
112
- return `${appId}:${instanceId}`;
110
+ return `${instance?.appContext?.app?.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ ?? 0}:${instance === instance?.root ? "root" : instance.uid}`;
113
111
  }
114
112
  function getRenderKey(value) {
115
113
  if (value == null) return "";
@@ -352,10 +350,7 @@ function inspectFn(e) {
352
350
  function selectComponentFn(e, cb) {
353
351
  e.preventDefault();
354
352
  e.stopPropagation();
355
- if (inspectInstance) {
356
- const uniqueComponentId = getUniqueComponentId(inspectInstance);
357
- cb(uniqueComponentId);
358
- }
353
+ if (inspectInstance) cb(getUniqueComponentId(inspectInstance));
359
354
  }
360
355
  let inspectComponentHighLighterSelectFn = null;
361
356
  function cancelInspectComponentHighLighter() {
@@ -636,7 +631,7 @@ function getTimelineLayersStateFromStorage() {
636
631
  performanceEventEnabled: false,
637
632
  selected: ""
638
633
  };
639
- const state = localStorage.getItem(TIMELINE_LAYERS_STATE_STORAGE_ID);
634
+ const state = typeof localStorage.getItem !== "undefined" ? localStorage.getItem(TIMELINE_LAYERS_STATE_STORAGE_ID) : null;
640
635
  return state ? JSON.parse(state) : {
641
636
  recordingState: false,
642
637
  mouseEventEnabled: false,
@@ -1075,10 +1070,7 @@ function getPluginSettings(pluginId, fallbackValue) {
1075
1070
  const localSettings = localStorage.getItem(localKey);
1076
1071
  if (localSettings) return JSON.parse(localSettings);
1077
1072
  }
1078
- if (pluginId) {
1079
- const item = devtoolsPluginBuffer.find((item$1) => item$1[0].id === pluginId)?.[0] ?? null;
1080
- return _getSettings(item?.settings ?? {});
1081
- }
1073
+ if (pluginId) return _getSettings((devtoolsPluginBuffer.find((item) => item[0].id === pluginId)?.[0] ?? null)?.settings ?? {});
1082
1074
  return _getSettings(fallbackValue);
1083
1075
  }
1084
1076
  function initPluginSettings(pluginId, settings) {
@@ -1612,10 +1604,9 @@ function processState(instance) {
1612
1604
  }
1613
1605
  function getStateTypeAndName(info) {
1614
1606
  const stateType = info.computed ? "computed" : info.ref ? "ref" : info.reactive ? "reactive" : null;
1615
- const stateTypeName = stateType ? `${stateType.charAt(0).toUpperCase()}${stateType.slice(1)}` : null;
1616
1607
  return {
1617
1608
  stateType,
1618
- stateTypeName
1609
+ stateTypeName: stateType ? `${stateType.charAt(0).toUpperCase()}${stateType.slice(1)}` : null
1619
1610
  };
1620
1611
  }
1621
1612
  function processSetupState(instance) {
@@ -1749,15 +1740,11 @@ function processInstanceState(instance) {
1749
1740
  //#region src/core/component/state/index.ts
1750
1741
  function getInstanceState(params) {
1751
1742
  const instance = getComponentInstance(activeAppRecord.value, params.instanceId);
1752
- const id = getUniqueComponentId(instance);
1753
- const name = getInstanceName(instance);
1754
- const file = instance?.type?.__file;
1755
- const state = processInstanceState(instance);
1756
1743
  return {
1757
- id,
1758
- name,
1759
- file,
1760
- state,
1744
+ id: getUniqueComponentId(instance),
1745
+ name: getInstanceName(instance),
1746
+ file: instance?.type?.__file,
1747
+ state: processInstanceState(instance),
1761
1748
  instance
1762
1749
  };
1763
1750
  }
@@ -2004,8 +1991,7 @@ function performanceMarkEnd(api, app, uid, vm, type, time) {
2004
1991
  const groupInfo = appRecord.perfGroupIds.get(groupKey);
2005
1992
  if (groupInfo) {
2006
1993
  const groupId = groupInfo.groupId;
2007
- const startTime = groupInfo.time;
2008
- const duration = time - startTime;
1994
+ const duration = time - groupInfo.time;
2009
1995
  api.addTimelineEvent({
2010
1996
  layerId: PERFORMANCE_EVENT_LAYER_ID,
2011
1997
  event: {
@@ -2192,10 +2178,9 @@ function createComponentsDevToolsPlugin(app) {
2192
2178
  if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
2193
2179
  const result = getInstanceState({ instanceId: payload.nodeId });
2194
2180
  const componentInstance = result.instance;
2195
- const app$1 = result.instance?.appContext.app;
2196
2181
  const _payload = {
2197
2182
  componentInstance,
2198
- app: app$1,
2183
+ app: result.instance?.appContext.app,
2199
2184
  instanceData: result
2200
2185
  };
2201
2186
  devtoolsContext.hooks.callHookWith((callbacks) => {
@@ -4339,8 +4324,7 @@ function updateDevToolsClientDetected(params) {
4339
4324
  ...devtoolsState.devtoolsClientDetected,
4340
4325
  ...params
4341
4326
  };
4342
- const devtoolsClientVisible = Object.values(devtoolsState.devtoolsClientDetected).some(Boolean);
4343
- toggleHighPerfMode(!devtoolsClientVisible);
4327
+ toggleHighPerfMode(!Object.values(devtoolsState.devtoolsClientDetected).some(Boolean));
4344
4328
  }
4345
4329
  target.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__ ??= updateDevToolsClientDetected;
4346
4330
 
@@ -4902,8 +4886,7 @@ function copy(target$1, options = {}) {
4902
4886
  return [...props, ...symbols].reduce((carry, key) => {
4903
4887
  if (isArray$1(options.props) && !options.props.includes(key)) return carry;
4904
4888
  const val = target$1[key];
4905
- const newVal = copy(val, options);
4906
- assignProp(carry, key, newVal, target$1, options.nonenumerable);
4889
+ assignProp(carry, key, copy(val, options), target$1, options.nonenumerable);
4907
4890
  return carry;
4908
4891
  }, {});
4909
4892
  }
@@ -5410,10 +5393,9 @@ function getFunctionDetails(func) {
5410
5393
  } catch (e) {}
5411
5394
  const match = matches && matches[0];
5412
5395
  const args = typeof match === "string" ? match : "(?)";
5413
- const name = typeof func.name === "string" ? func.name : "";
5414
5396
  return { _custom: {
5415
5397
  type: "function",
5416
- displayText: `<span style="opacity:.8;margin-right:5px;">function</span> <span style="white-space:nowrap;">${escape(name)}${args}</span>`,
5398
+ displayText: `<span style="opacity:.8;margin-right:5px;">function</span> <span style="white-space:nowrap;">${escape(typeof func.name === "string" ? func.name : "")}${args}</span>`,
5417
5399
  tooltipText: string.trim() ? `<pre>${string}</pre>` : null
5418
5400
  } };
5419
5401
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue/devtools-kit",
3
3
  "type": "module",
4
- "version": "8.0.2",
4
+ "version": "8.0.3",
5
5
  "author": "webfansplz",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -23,18 +23,18 @@
23
23
  "dist"
24
24
  ],
25
25
  "dependencies": {
26
- "birpc": "^2.5.0",
26
+ "birpc": "^2.6.1",
27
27
  "hookable": "^5.5.3",
28
28
  "mitt": "^3.0.1",
29
29
  "perfect-debounce": "^2.0.0",
30
30
  "speakingurl": "^14.0.1",
31
31
  "superjson": "^2.2.2",
32
- "@vue/devtools-shared": "^8.0.2"
32
+ "@vue/devtools-shared": "^8.0.3"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/speakingurl": "^13.0.6",
36
- "vue": "^3.5.21",
37
- "vue-router": "^4.5.1"
36
+ "vue": "^3.5.22",
37
+ "vue-router": "^4.6.0"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "tsdown --clean",