@vue/devtools-api 6.0.0-beta.19 → 6.0.0-beta.21

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.
@@ -7,7 +7,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
7
7
  o[k2] = m[k];
8
8
  }));
9
9
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./api"), exports);
package/lib/cjs/index.js CHANGED
@@ -7,7 +7,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
7
7
  o[k2] = m[k];
8
8
  }));
9
9
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.setupDevtoolsPlugin = void 0;
@@ -17,8 +17,8 @@ const proxy_1 = require("./proxy");
17
17
  __exportStar(require("./api"), exports);
18
18
  __exportStar(require("./plugin"), exports);
19
19
  function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
20
- const target = env_1.getTarget();
21
- const hook = env_1.getDevtoolsGlobalHook();
20
+ const target = (0, env_1.getTarget)();
21
+ const hook = (0, env_1.getDevtoolsGlobalHook)();
22
22
  const enableProxy = env_1.isProxyAvailable && pluginDescriptor.enableEarlyProxy;
23
23
  if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
24
24
  hook.emit(const_1.HOOK_SETUP, pluginDescriptor, setupFn);
@@ -29,7 +29,7 @@ function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
29
29
  list.push({
30
30
  pluginDescriptor,
31
31
  setupFn,
32
- proxy
32
+ proxy,
33
33
  });
34
34
  if (proxy)
35
35
  setupFn(proxy.proxiedTarget);
package/lib/cjs/proxy.js CHANGED
@@ -3,6 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ApiProxy = void 0;
4
4
  const const_1 = require("./const");
5
5
  class ApiProxy {
6
+ target;
7
+ targetQueue;
8
+ proxiedTarget;
9
+ onQueue;
10
+ proxiedOn;
11
+ plugin;
12
+ hook;
13
+ fallbacks;
6
14
  constructor(plugin, hook) {
7
15
  this.target = null;
8
16
  this.targetQueue = [];
@@ -17,7 +25,7 @@ class ApiProxy {
17
25
  }
18
26
  }
19
27
  const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
20
- let currentSettings = { ...defaultSettings };
28
+ let currentSettings = Object.assign({}, defaultSettings);
21
29
  try {
22
30
  const raw = localStorage.getItem(localSettingsSaveId);
23
31
  const data = JSON.parse(raw);
@@ -38,13 +46,15 @@ class ApiProxy {
38
46
  // noop
39
47
  }
40
48
  currentSettings = value;
41
- }
49
+ },
42
50
  };
43
- hook.on(const_1.HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
44
- if (pluginId === this.plugin.id) {
45
- this.fallbacks.setSettings(value);
46
- }
47
- });
51
+ if (hook) {
52
+ hook.on(const_1.HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
53
+ if (pluginId === this.plugin.id) {
54
+ this.fallbacks.setSettings(value);
55
+ }
56
+ });
57
+ }
48
58
  this.proxiedOn = new Proxy({}, {
49
59
  get: (_target, prop) => {
50
60
  if (this.target) {
@@ -54,11 +64,11 @@ class ApiProxy {
54
64
  return (...args) => {
55
65
  this.onQueue.push({
56
66
  method: prop,
57
- args
67
+ args,
58
68
  });
59
69
  };
60
70
  }
61
- }
71
+ },
62
72
  });
63
73
  this.proxiedTarget = new Proxy({}, {
64
74
  get: (_target, prop) => {
@@ -73,7 +83,7 @@ class ApiProxy {
73
83
  this.targetQueue.push({
74
84
  method: prop,
75
85
  args,
76
- resolve: () => { }
86
+ resolve: () => { },
77
87
  });
78
88
  return this.fallbacks[prop](...args);
79
89
  };
@@ -84,12 +94,12 @@ class ApiProxy {
84
94
  this.targetQueue.push({
85
95
  method: prop,
86
96
  args,
87
- resolve
97
+ resolve,
88
98
  });
89
99
  });
90
100
  };
91
101
  }
92
- }
102
+ },
93
103
  });
94
104
  }
95
105
  async setRealTarget(target) {
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/lib/esm/index.js CHANGED
@@ -16,7 +16,7 @@ export function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
16
16
  list.push({
17
17
  pluginDescriptor,
18
18
  setupFn,
19
- proxy
19
+ proxy,
20
20
  });
21
21
  if (proxy)
22
22
  setupFn(proxy.proxiedTarget);
package/lib/esm/plugin.js CHANGED
@@ -0,0 +1 @@
1
+ export {};
package/lib/esm/proxy.js CHANGED
@@ -1,5 +1,13 @@
1
1
  import { HOOK_PLUGIN_SETTINGS_SET } from './const';
2
2
  export class ApiProxy {
3
+ target;
4
+ targetQueue;
5
+ proxiedTarget;
6
+ onQueue;
7
+ proxiedOn;
8
+ plugin;
9
+ hook;
10
+ fallbacks;
3
11
  constructor(plugin, hook) {
4
12
  this.target = null;
5
13
  this.targetQueue = [];
@@ -14,7 +22,7 @@ export class ApiProxy {
14
22
  }
15
23
  }
16
24
  const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
17
- let currentSettings = { ...defaultSettings };
25
+ let currentSettings = Object.assign({}, defaultSettings);
18
26
  try {
19
27
  const raw = localStorage.getItem(localSettingsSaveId);
20
28
  const data = JSON.parse(raw);
@@ -35,13 +43,15 @@ export class ApiProxy {
35
43
  // noop
36
44
  }
37
45
  currentSettings = value;
38
- }
46
+ },
39
47
  };
40
- hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
41
- if (pluginId === this.plugin.id) {
42
- this.fallbacks.setSettings(value);
43
- }
44
- });
48
+ if (hook) {
49
+ hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
50
+ if (pluginId === this.plugin.id) {
51
+ this.fallbacks.setSettings(value);
52
+ }
53
+ });
54
+ }
45
55
  this.proxiedOn = new Proxy({}, {
46
56
  get: (_target, prop) => {
47
57
  if (this.target) {
@@ -51,11 +61,11 @@ export class ApiProxy {
51
61
  return (...args) => {
52
62
  this.onQueue.push({
53
63
  method: prop,
54
- args
64
+ args,
55
65
  });
56
66
  };
57
67
  }
58
- }
68
+ },
59
69
  });
60
70
  this.proxiedTarget = new Proxy({}, {
61
71
  get: (_target, prop) => {
@@ -70,7 +80,7 @@ export class ApiProxy {
70
80
  this.targetQueue.push({
71
81
  method: prop,
72
82
  args,
73
- resolve: () => { }
83
+ resolve: () => { },
74
84
  });
75
85
  return this.fallbacks[prop](...args);
76
86
  };
@@ -81,12 +91,12 @@ export class ApiProxy {
81
91
  this.targetQueue.push({
82
92
  method: prop,
83
93
  args,
84
- resolve
94
+ resolve,
85
95
  });
86
96
  });
87
97
  };
88
98
  }
89
- }
99
+ },
90
100
  });
91
101
  }
92
102
  async setRealTarget(target) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/devtools-api",
3
- "version": "6.0.0-beta.19",
3
+ "version": "6.0.0-beta.21",
4
4
  "description": "Interact with the Vue devtools from the page",
5
5
  "main": "lib/cjs/index.js",
6
6
  "browser": "lib/esm/index.js",
@@ -32,6 +32,6 @@
32
32
  "devDependencies": {
33
33
  "@types/node": "^13.9.1",
34
34
  "@types/webpack-env": "^1.15.1",
35
- "typescript": "^3.8.3"
35
+ "typescript": "^4.5.2"
36
36
  }
37
37
  }