ember-inspector 4.13.1-alpha.2025.7.3 → 4.13.1-alpha.2025.7.31

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.
Files changed (234) hide show
  1. package/app/index.html +1 -1
  2. package/app/styles/app.scss +1 -0
  3. package/dist/bookmarklet/load_inspector.js +1 -0
  4. package/dist/bookmarklet/panes-3-16-0/assets/{chunk.524.12f8b1dc0628d8e548c0.js → chunk.524.82b1a00177fbae2e57fa.js} +4 -4
  5. package/dist/{firefox/panes-3-16-0/assets/chunk.582.8a5f06f7065ffe209555.js → bookmarklet/panes-3-16-0/assets/chunk.582.ee98fc581dcf04269114.js} +5 -5
  6. package/dist/bookmarklet/panes-3-16-0/assets/ember-inspector.css +835 -0
  7. package/dist/bookmarklet/panes-3-16-0/assets/ember-inspector.js +42 -4
  8. package/dist/bookmarklet/panes-3-16-0/assets/vendor.css +0 -836
  9. package/dist/bookmarklet/panes-3-16-0/assets/vendor.js +3967 -4019
  10. package/dist/bookmarklet/panes-3-16-0/base-object-HAEdWjmg.js +59 -0
  11. package/dist/bookmarklet/panes-3-16-0/basic-DfbgtngO.js +144 -0
  12. package/dist/bookmarklet/panes-3-16-0/basic-debug.js +6 -0
  13. package/dist/bookmarklet/panes-3-16-0/bookmarklet-debug.js +34 -0
  14. package/dist/bookmarklet/panes-3-16-0/chrome-debug.js +12 -0
  15. package/dist/bookmarklet/panes-3-16-0/ember.js +108 -0
  16. package/dist/bookmarklet/panes-3-16-0/ember_debug.js +22 -10646
  17. package/dist/bookmarklet/panes-3-16-0/evented-BCTya3yE.js +62 -0
  18. package/dist/bookmarklet/panes-3-16-0/firefox-debug.js +32 -0
  19. package/dist/bookmarklet/panes-3-16-0/index.html +3 -3
  20. package/dist/bookmarklet/panes-3-16-0/internals-CRmXMEzb.js +12 -0
  21. package/dist/bookmarklet/panes-3-16-0/main.js +7642 -0
  22. package/dist/bookmarklet/panes-3-16-0/port.js +108 -0
  23. package/dist/bookmarklet/panes-3-16-0/profile-node.js +60 -0
  24. package/dist/bookmarklet/panes-3-16-0/promise-assembler.js +218 -0
  25. package/dist/bookmarklet/panes-3-16-0/runloop-CF-Qpqgy.js +1138 -0
  26. package/dist/bookmarklet/panes-3-16-0/start-inspector-BPAW_WLv.js +376 -0
  27. package/dist/bookmarklet/panes-3-16-0/type-check.js +119 -0
  28. package/dist/bookmarklet/panes-3-16-0/version.js +90 -0
  29. package/dist/bookmarklet/panes-3-16-0/versions.js +4 -0
  30. package/dist/bookmarklet/panes-3-16-0/web-extension-C3pMNVSY.js +144 -0
  31. package/dist/bookmarklet/panes-3-16-0/websocket-debug.js +60 -0
  32. package/dist/chrome/content-script.js +1 -0
  33. package/dist/chrome/manifest.json +3 -3
  34. package/dist/{firefox/panes-3-16-0/assets/chunk.524.12f8b1dc0628d8e548c0.js → chrome/panes-3-16-0/assets/chunk.524.82b1a00177fbae2e57fa.js} +4 -4
  35. package/dist/{bookmarklet/panes-3-16-0/assets/chunk.582.8a5f06f7065ffe209555.js → chrome/panes-3-16-0/assets/chunk.582.ee98fc581dcf04269114.js} +5 -5
  36. package/dist/chrome/panes-3-16-0/assets/ember-inspector.css +835 -0
  37. package/dist/chrome/panes-3-16-0/assets/ember-inspector.js +42 -4
  38. package/dist/chrome/panes-3-16-0/assets/vendor.css +0 -836
  39. package/dist/chrome/panes-3-16-0/assets/vendor.js +3967 -4019
  40. package/dist/chrome/panes-3-16-0/base-object-HAEdWjmg.js +59 -0
  41. package/dist/chrome/panes-3-16-0/basic-DfbgtngO.js +144 -0
  42. package/dist/chrome/panes-3-16-0/basic-debug.js +6 -0
  43. package/dist/chrome/panes-3-16-0/bookmarklet-debug.js +34 -0
  44. package/dist/chrome/panes-3-16-0/chrome-debug.js +12 -0
  45. package/dist/chrome/panes-3-16-0/ember.js +108 -0
  46. package/dist/chrome/panes-3-16-0/ember_debug.js +12 -10658
  47. package/dist/chrome/panes-3-16-0/evented-BCTya3yE.js +62 -0
  48. package/dist/chrome/panes-3-16-0/firefox-debug.js +32 -0
  49. package/dist/chrome/panes-3-16-0/index.html +3 -3
  50. package/dist/chrome/panes-3-16-0/internals-CRmXMEzb.js +12 -0
  51. package/dist/chrome/panes-3-16-0/main.js +7642 -0
  52. package/dist/chrome/panes-3-16-0/port.js +108 -0
  53. package/dist/chrome/panes-3-16-0/profile-node.js +60 -0
  54. package/dist/chrome/panes-3-16-0/promise-assembler.js +218 -0
  55. package/dist/chrome/panes-3-16-0/runloop-CF-Qpqgy.js +1138 -0
  56. package/dist/chrome/panes-3-16-0/start-inspector-BPAW_WLv.js +376 -0
  57. package/dist/chrome/panes-3-16-0/type-check.js +119 -0
  58. package/dist/chrome/panes-3-16-0/version.js +90 -0
  59. package/dist/chrome/panes-3-16-0/versions.js +4 -0
  60. package/dist/chrome/panes-3-16-0/web-extension-C3pMNVSY.js +144 -0
  61. package/dist/chrome/panes-3-16-0/websocket-debug.js +60 -0
  62. package/dist/firefox/content-script.js +1 -0
  63. package/dist/firefox/manifest.json +3 -3
  64. package/dist/{chrome/panes-3-16-0/assets/chunk.524.12f8b1dc0628d8e548c0.js → firefox/panes-3-16-0/assets/chunk.524.82b1a00177fbae2e57fa.js} +4 -4
  65. package/dist/{websocket/assets/chunk.582.8a5f06f7065ffe209555.js → firefox/panes-3-16-0/assets/chunk.582.ee98fc581dcf04269114.js} +5 -5
  66. package/dist/firefox/panes-3-16-0/assets/ember-inspector.css +835 -0
  67. package/dist/firefox/panes-3-16-0/assets/ember-inspector.js +42 -4
  68. package/dist/firefox/panes-3-16-0/assets/vendor.css +0 -836
  69. package/dist/firefox/panes-3-16-0/assets/vendor.js +3967 -4019
  70. package/dist/firefox/panes-3-16-0/base-object-HAEdWjmg.js +59 -0
  71. package/dist/firefox/panes-3-16-0/basic-DfbgtngO.js +144 -0
  72. package/dist/firefox/panes-3-16-0/basic-debug.js +6 -0
  73. package/dist/firefox/panes-3-16-0/bookmarklet-debug.js +34 -0
  74. package/dist/firefox/panes-3-16-0/chrome-debug.js +12 -0
  75. package/dist/firefox/panes-3-16-0/ember.js +108 -0
  76. package/dist/firefox/panes-3-16-0/ember_debug.js +28 -10654
  77. package/dist/firefox/panes-3-16-0/evented-BCTya3yE.js +62 -0
  78. package/dist/firefox/panes-3-16-0/firefox-debug.js +32 -0
  79. package/dist/firefox/panes-3-16-0/index.html +3 -3
  80. package/dist/firefox/panes-3-16-0/internals-CRmXMEzb.js +12 -0
  81. package/dist/firefox/panes-3-16-0/main.js +7642 -0
  82. package/dist/firefox/panes-3-16-0/port.js +108 -0
  83. package/dist/firefox/panes-3-16-0/profile-node.js +60 -0
  84. package/dist/firefox/panes-3-16-0/promise-assembler.js +218 -0
  85. package/dist/firefox/panes-3-16-0/runloop-CF-Qpqgy.js +1138 -0
  86. package/dist/firefox/panes-3-16-0/start-inspector-BPAW_WLv.js +376 -0
  87. package/dist/firefox/panes-3-16-0/type-check.js +119 -0
  88. package/dist/firefox/panes-3-16-0/version.js +90 -0
  89. package/dist/firefox/panes-3-16-0/versions.js +4 -0
  90. package/dist/firefox/panes-3-16-0/web-extension-C3pMNVSY.js +144 -0
  91. package/dist/firefox/panes-3-16-0/websocket-debug.js +60 -0
  92. package/dist/websocket/assets/{chunk.524.12f8b1dc0628d8e548c0.js → chunk.524.82b1a00177fbae2e57fa.js} +4 -4
  93. package/dist/{chrome/panes-3-16-0/assets/chunk.582.8a5f06f7065ffe209555.js → websocket/assets/chunk.582.ee98fc581dcf04269114.js} +5 -5
  94. package/dist/websocket/assets/ember-inspector.css +835 -0
  95. package/dist/websocket/assets/ember-inspector.js +42 -4
  96. package/dist/websocket/assets/vendor.css +0 -836
  97. package/dist/websocket/assets/vendor.js +3967 -4019
  98. package/dist/websocket/base-object-HAEdWjmg.js +59 -0
  99. package/dist/websocket/basic-DfbgtngO.js +144 -0
  100. package/dist/websocket/basic-debug.js +6 -0
  101. package/dist/websocket/bookmarklet-debug.js +34 -0
  102. package/dist/websocket/chrome-debug.js +12 -0
  103. package/dist/websocket/ember.js +108 -0
  104. package/dist/websocket/ember_debug.js +36 -10634
  105. package/dist/websocket/evented-BCTya3yE.js +62 -0
  106. package/dist/websocket/firefox-debug.js +32 -0
  107. package/dist/websocket/index.html +3 -3
  108. package/dist/websocket/internals-CRmXMEzb.js +12 -0
  109. package/dist/websocket/main.js +7642 -0
  110. package/dist/websocket/port.js +108 -0
  111. package/dist/websocket/profile-node.js +60 -0
  112. package/dist/websocket/promise-assembler.js +218 -0
  113. package/dist/websocket/runloop-CF-Qpqgy.js +1138 -0
  114. package/dist/websocket/start-inspector-BPAW_WLv.js +376 -0
  115. package/dist/websocket/type-check.js +119 -0
  116. package/dist/websocket/version.js +90 -0
  117. package/dist/websocket/versions.js +4 -0
  118. package/dist/websocket/web-extension-C3pMNVSY.js +144 -0
  119. package/dist/websocket/websocket-debug.js +60 -0
  120. package/ember-cli-build.js +28 -91
  121. package/ember_debug/adapters/basic.js +9 -29
  122. package/ember_debug/adapters/web-extension.js +4 -4
  123. package/ember_debug/adapters/websocket.js +2 -2
  124. package/ember_debug/container-debug.js +1 -1
  125. package/ember_debug/data-debug.js +2 -2
  126. package/ember_debug/debug-port.js +1 -1
  127. package/ember_debug/deprecation-debug.js +6 -6
  128. package/ember_debug/entrypoints/basic-debug.js +6 -0
  129. package/ember_debug/entrypoints/bookmarklet-debug.js +6 -0
  130. package/ember_debug/entrypoints/chrome-debug.js +6 -0
  131. package/ember_debug/entrypoints/firefox-debug.js +6 -0
  132. package/ember_debug/entrypoints/websocket-debug.js +6 -0
  133. package/ember_debug/general-debug.js +3 -3
  134. package/ember_debug/lib/boot-ember-inspector.js +9 -0
  135. package/ember_debug/lib/get-applications.js +27 -0
  136. package/ember_debug/lib/load-ember-debug-in-webpage.js +30 -0
  137. package/ember_debug/lib/send-apps.js +14 -0
  138. package/ember_debug/lib/send-version-miss.js +39 -0
  139. package/ember_debug/lib/setup-instance-initializer.js +16 -0
  140. package/ember_debug/lib/start-inspector.js +211 -0
  141. package/ember_debug/lib/version-test.js +73 -0
  142. package/ember_debug/lib/versions.js +3 -0
  143. package/ember_debug/libs/capture-render-tree.js +1 -1
  144. package/ember_debug/libs/promise-assembler.js +4 -4
  145. package/ember_debug/libs/render-tree.js +5 -5
  146. package/ember_debug/libs/source-map.js +1 -1
  147. package/ember_debug/libs/view-inspection.js +3 -3
  148. package/ember_debug/main.js +17 -20
  149. package/ember_debug/models/profile-manager.js +5 -6
  150. package/ember_debug/models/profile-node.js +1 -1
  151. package/ember_debug/models/promise.js +2 -2
  152. package/ember_debug/object-inspector.js +9 -9
  153. package/ember_debug/package.json +3 -1
  154. package/ember_debug/port.js +4 -4
  155. package/ember_debug/promise-debug.js +4 -4
  156. package/ember_debug/render-debug.js +5 -5
  157. package/ember_debug/rollup.config.js +5 -29
  158. package/ember_debug/route-debug.js +7 -7
  159. package/ember_debug/services/session.js +1 -1
  160. package/ember_debug/utils/ember/object/internals.js +1 -6
  161. package/ember_debug/utils/ember/runloop.js +2 -7
  162. package/ember_debug/utils/ember-object-names.js +2 -2
  163. package/ember_debug/utils/ember.js +72 -28
  164. package/ember_debug/utils/get-object-name.js +1 -1
  165. package/ember_debug/utils/type-check.js +2 -2
  166. package/ember_debug/view-debug.js +4 -4
  167. package/package.json +6 -9
  168. package/skeletons/bookmarklet/load_inspector.js +1 -0
  169. package/skeletons/web-extension/content-script.js +1 -0
  170. package/skeletons/web-extension/manifest.json +3 -3
  171. package/tests/ember_debug/profile-manager-test.js +1 -3
  172. package/tests/index.html +1 -2
  173. package/tests/integration/injection-test.js +3 -3
  174. package/tests/test-helper.js +0 -3
  175. package/ember_debug/utils/ember/debug.js +0 -21
  176. package/ember_debug/utils/ember/instrumentation.js +0 -11
  177. package/ember_debug/utils/rsvp.js +0 -14
  178. package/ember_debug/vendor/loader.js +0 -54
  179. package/ember_debug/vendor/startup-wrapper.js +0 -402
  180. package/lib/ui/app/components/ui/disclosure-triangle.js +0 -1
  181. package/lib/ui/app/components/ui/disclosure.js +0 -1
  182. package/lib/ui/app/components/ui/drag-handle.js +0 -1
  183. package/lib/ui/app/components/ui/draggable-column.js +0 -1
  184. package/lib/ui/app/components/ui/empty-message.js +0 -1
  185. package/lib/ui/app/components/ui/error-page.js +0 -1
  186. package/lib/ui/app/components/ui/open-links-in-new-window.js +0 -1
  187. package/lib/ui/app/components/ui/resizable-column.js +0 -1
  188. package/lib/ui/app/components/ui/send-to-console.js +0 -1
  189. package/lib/ui/app/components/ui/toolbar-clear-button.js +0 -1
  190. package/lib/ui/app/components/ui/toolbar-divider.js +0 -1
  191. package/lib/ui/app/components/ui/toolbar-reload-button.js +0 -1
  192. package/lib/ui/app/components/ui/toolbar-search-field.js +0 -1
  193. package/lib/ui/app/components/ui/warning-message.js +0 -1
  194. package/lib/ui/index.js +0 -34
  195. package/lib/ui/package.json +0 -13
  196. /package/{lib/ui/addon/components → app/components/ui}/disclosure-triangle.hbs +0 -0
  197. /package/{lib/ui/addon/components → app/components/ui}/disclosure.hbs +0 -0
  198. /package/{lib/ui/addon/components → app/components/ui}/disclosure.js +0 -0
  199. /package/{lib/ui/addon/components → app/components/ui}/drag-handle.hbs +0 -0
  200. /package/{lib/ui/addon/components → app/components/ui}/drag-handle.js +0 -0
  201. /package/{lib/ui/addon/components → app/components/ui}/draggable-column.hbs +0 -0
  202. /package/{lib/ui/addon/components → app/components/ui}/draggable-column.js +0 -0
  203. /package/{lib/ui/addon/components → app/components/ui}/empty-message.hbs +0 -0
  204. /package/{lib/ui/addon/components → app/components/ui}/error-page.hbs +0 -0
  205. /package/{lib/ui/addon/components → app/components/ui}/open-links-in-new-window.hbs +0 -0
  206. /package/{lib/ui/addon/components → app/components/ui}/open-links-in-new-window.js +0 -0
  207. /package/{lib/ui/addon/components → app/components/ui}/resizable-column.hbs +0 -0
  208. /package/{lib/ui/addon/components → app/components/ui}/resizable-column.js +0 -0
  209. /package/{lib/ui/addon/components → app/components/ui}/send-to-console.hbs +0 -0
  210. /package/{lib/ui/addon/components → app/components/ui}/toolbar-clear-button.hbs +0 -0
  211. /package/{lib/ui/addon/components → app/components/ui}/toolbar-divider.hbs +0 -0
  212. /package/{lib/ui/addon/components → app/components/ui}/toolbar-reload-button.hbs +0 -0
  213. /package/{lib/ui/addon/components → app/components/ui}/toolbar-search-field.hbs +0 -0
  214. /package/{lib/ui/addon/components → app/components/ui}/toolbar-search-field.js +0 -0
  215. /package/{lib/ui/addon/components → app/components/ui}/warning-message.hbs +0 -0
  216. /package/{lib/ui/addon/styles → app/styles/ui}/_disclosure-triangle.scss +0 -0
  217. /package/{lib/ui/addon/styles → app/styles/ui}/_drag-handle.scss +0 -0
  218. /package/{lib/ui/addon/styles → app/styles/ui}/_empty-message.scss +0 -0
  219. /package/{lib/ui/addon/styles → app/styles/ui}/_error-page.scss +0 -0
  220. /package/{lib/ui/addon/styles → app/styles/ui}/_goto-source.scss +0 -0
  221. /package/{lib/ui/addon/styles → app/styles/ui}/_list.scss +0 -0
  222. /package/{lib/ui/addon/styles → app/styles/ui}/_nav.scss +0 -0
  223. /package/{lib/ui/addon/styles → app/styles/ui}/_object-inspector-toggle.scss +0 -0
  224. /package/{lib/ui/addon/styles → app/styles/ui}/_pill.scss +0 -0
  225. /package/{lib/ui/addon/styles → app/styles/ui}/_send-to-console.scss +0 -0
  226. /package/{lib/ui/addon/styles → app/styles/ui}/_split.scss +0 -0
  227. /package/{lib/ui/addon/styles/addon.scss → app/styles/ui/_ui.scss} +0 -0
  228. /package/{lib/ui/addon/styles → app/styles/ui}/_warning.scss +0 -0
  229. /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_checkbox.scss +0 -0
  230. /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_divider.scss +0 -0
  231. /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_icon-button.scss +0 -0
  232. /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_index.scss +0 -0
  233. /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_radio.scss +0 -0
  234. /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_search.scss +0 -0
@@ -0,0 +1,108 @@
1
+ import { g as guidFor } from './internals-CRmXMEzb.js';
2
+ import { r as run } from './runloop-CF-Qpqgy.js';
3
+ import { B as BaseObject } from './base-object-HAEdWjmg.js';
4
+ import { E as Evented } from './evented-BCTya3yE.js';
5
+ import './ember.js';
6
+
7
+ class Port extends BaseObject {
8
+ constructor(data) {
9
+ super(data);
10
+ Evented.applyTo(this);
11
+ }
12
+ get adapter() {
13
+ return this.namespace?.adapter;
14
+ }
15
+ get applicationId() {
16
+ return this.namespace?.applicationId;
17
+ }
18
+ get applicationName() {
19
+ return this.namespace?._application?.name || this.namespace?._application?.modulePrefix;
20
+ }
21
+
22
+ /**
23
+ * Unique id per application (not application instance). It's very important
24
+ * that this id doesn't change when the app is reset otherwise the inspector
25
+ * will no longer recognize the app.
26
+ *
27
+ * @property uniqueId
28
+ * @type {String}
29
+ */
30
+ get uniqueId() {
31
+ return guidFor(this.namespace?._application, 'ember');
32
+ }
33
+
34
+ // eslint-disable-next-line ember/classic-decorator-hooks
35
+ init() {
36
+ /**
37
+ * Stores the timestamp when it was first accessed.
38
+ *
39
+ * @property now
40
+ * @type {Number}
41
+ */
42
+ this.now = Date.now();
43
+ this.adapter.onMessageReceived(message => {
44
+ if (this.uniqueId === message.applicationId || !message.applicationId) {
45
+ this.messageReceived(message.type, message);
46
+ }
47
+ });
48
+ }
49
+ messageReceived(name, message) {
50
+ // We should generally not be run-wrapping here. Starting a runloop in
51
+ // ember-debug will cause the inspected app to revalidate/rerender. We
52
+ // are generally not intending to cause changes to the rendered output
53
+ // of the app, so this is generally unnecessary, and in big apps this
54
+ // could be quite slow. There is nothing special about the `view:*`
55
+ // messages – I (GC) just happened to have reviewed all of them recently
56
+ // and can be quite sure that they don't need the runloop. We should
57
+ // audit the rest of them and see if we can remove the else branch. I
58
+ // think we most likely can. In the limited cases (if any) where the
59
+ // runloop is needed, the callback code should just do the wrapping
60
+ // themselves.
61
+ if (name.startsWith('view:')) {
62
+ try {
63
+ this.trigger(name, message);
64
+ } catch (error) {
65
+ this.adapter.handleError(error);
66
+ }
67
+ } else {
68
+ this.wrap(() => {
69
+ this.trigger(name, message);
70
+ });
71
+ }
72
+ }
73
+ send(messageType, options = {}) {
74
+ options.type = messageType;
75
+ options.from = 'inspectedWindow';
76
+ options.applicationId = this.uniqueId;
77
+ options.applicationName = this.applicationName;
78
+ this.adapter.send(options);
79
+ }
80
+
81
+ /**
82
+ * Wrap all code triggered from outside of
83
+ * EmberDebug with this method.
84
+ *
85
+ * `wrap` is called by default
86
+ * on all callbacks triggered by `port`,
87
+ * so no need to call it in this case.
88
+ *
89
+ * - Wraps a callback in `Ember.run`.
90
+ * - Catches all errors during production
91
+ * and displays them in a user friendly manner.
92
+ *
93
+ * @method wrap
94
+ * @param {Function} fn
95
+ * @return {Mixed} The return value of the passed function
96
+ */
97
+ wrap(fn) {
98
+ return run(this, function () {
99
+ try {
100
+ return fn();
101
+ } catch (error) {
102
+ this.adapter.handleError(error);
103
+ }
104
+ });
105
+ }
106
+ }
107
+
108
+ export { Port as default };
@@ -0,0 +1,60 @@
1
+ import { g as guidFor } from './internals-CRmXMEzb.js';
2
+ import './ember.js';
3
+
4
+ /**
5
+ A tree structure for assembling a list of render calls so they can be grouped and displayed nicely afterwards.
6
+
7
+ @class ProfileNode
8
+ **/
9
+ function get(obj, key) {
10
+ return obj.get ? obj.get(key) : obj[key];
11
+ }
12
+ const ProfileNode = function (start, payload, parent, now) {
13
+ let name;
14
+ this.start = start;
15
+ this.timestamp = now || Date.now();
16
+ if (payload) {
17
+ if (payload.template) {
18
+ name = payload.template;
19
+ } else if (payload.view) {
20
+ const view = payload.view;
21
+ name = get(view, 'instrumentDisplay') || get(view, '_debugContainerKey');
22
+ if (name) {
23
+ name = name.replace(/^view:/, '');
24
+ }
25
+ this.viewGuid = guidFor(view);
26
+ }
27
+ if (!name && payload.object) {
28
+ name = payload.object.toString().replace(/:?:ember\d+>$/, '').replace(/^</, '');
29
+ if (!this.viewGuid) {
30
+ const match = name.match(/:(ember\d+)>$/);
31
+ if (match && match.length > 1) {
32
+ this.viewGuid = match[1];
33
+ }
34
+ }
35
+ }
36
+ }
37
+ this.name = name || 'Unknown view';
38
+ if (parent) {
39
+ this.parent = parent;
40
+ }
41
+ this.children = [];
42
+ };
43
+ ProfileNode.prototype = {
44
+ finish(timestamp) {
45
+ this.time = timestamp - this.start;
46
+ this.calcDuration();
47
+
48
+ // Once we attach to our parent, we remove that reference
49
+ // to avoid a graph cycle when serializing:
50
+ if (this.parent) {
51
+ this.parent.children.push(this);
52
+ this.parent = null;
53
+ }
54
+ },
55
+ calcDuration() {
56
+ this.duration = Math.round(this.time * 100) / 100;
57
+ }
58
+ };
59
+
60
+ export { ProfileNode as default };
@@ -0,0 +1,218 @@
1
+ import { a as _applyDecoratedDescriptor, B as BaseObject, b as _initializerDefineProperty, _ as _defineProperty } from './base-object-HAEdWjmg.js';
2
+ import { typeOf } from './type-check.js';
3
+ import { RSVP } from './ember.js';
4
+ import { E as Evented } from './evented-BCTya3yE.js';
5
+
6
+ var _dec, _dec2, _dec3, _class2, _descriptor, _descriptor2, _descriptor3;
7
+ const dateComputed = function () {
8
+ return function (target, propertyKey) {
9
+ return {
10
+ get() {
11
+ return this[`__${propertyKey}__`];
12
+ },
13
+ set(date) {
14
+ if (typeOf(date) === 'date') {
15
+ this[`__${propertyKey}__`] = date;
16
+ return;
17
+ } else if (typeof date === 'number' || typeof date === 'string') {
18
+ this[`__${propertyKey}__`] = new Date(date);
19
+ return;
20
+ }
21
+ this[`__${propertyKey}__`] = null;
22
+ }
23
+ };
24
+ };
25
+ };
26
+ let _class = (_dec = dateComputed(), _dec2 = dateComputed(), _dec3 = dateComputed(), _class2 = class _class2 extends BaseObject {
27
+ constructor(...args) {
28
+ super(...args);
29
+ _initializerDefineProperty(this, "createdAt", _descriptor, this);
30
+ _initializerDefineProperty(this, "settledAt", _descriptor2, this);
31
+ _initializerDefineProperty(this, "chainedAt", _descriptor3, this);
32
+ _defineProperty(this, "parent", null);
33
+ _defineProperty(this, "children", []);
34
+ }
35
+ get level() {
36
+ const parent = this.parent;
37
+ if (!parent) {
38
+ return 0;
39
+ }
40
+ return parent.level + 1;
41
+ }
42
+ get isSettled() {
43
+ return this.isFulfilled || this.isRejected;
44
+ }
45
+ get isFulfilled() {
46
+ return this.state === 'fulfilled';
47
+ }
48
+ get isRejected() {
49
+ return this.state === 'rejected';
50
+ }
51
+ }, _descriptor = _applyDecoratedDescriptor(_class2.prototype, "createdAt", [_dec], {
52
+ configurable: true,
53
+ enumerable: true,
54
+ writable: true,
55
+ initializer: null
56
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "settledAt", [_dec2], {
57
+ configurable: true,
58
+ enumerable: true,
59
+ writable: true,
60
+ initializer: null
61
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "chainedAt", [_dec3], {
62
+ configurable: true,
63
+ enumerable: true,
64
+ writable: true,
65
+ initializer: null
66
+ }), _class2);
67
+
68
+ var _PromiseAssembler;
69
+ class PromiseAssembler extends BaseObject {
70
+ constructor(data) {
71
+ super(data);
72
+ // RSVP lib to debug
73
+ _defineProperty(this, "isStarted", false);
74
+ Evented.applyTo(this);
75
+ }
76
+
77
+ // eslint-disable-next-line ember/classic-decorator-hooks
78
+ init() {
79
+ super.init();
80
+ this.all = [];
81
+ this.promiseIndex = {};
82
+ }
83
+ start() {
84
+ this.RSVP.configure('instrument', true);
85
+ this.promiseChained = e => {
86
+ chain.call(this, e);
87
+ };
88
+ this.promiseRejected = e => {
89
+ reject.call(this, e);
90
+ };
91
+ this.promiseFulfilled = e => {
92
+ fulfill.call(this, e);
93
+ };
94
+ this.promiseCreated = e => {
95
+ create.bind(this)(e);
96
+ };
97
+ this.RSVP.on('chained', this.promiseChained);
98
+ this.RSVP.on('rejected', this.promiseRejected);
99
+ this.RSVP.on('fulfilled', this.promiseFulfilled);
100
+ this.RSVP.on('created', this.promiseCreated);
101
+ this.isStarted = true;
102
+ }
103
+ stop() {
104
+ if (this.isStarted) {
105
+ this.RSVP.configure('instrument', false);
106
+ this.RSVP.off('chained', this.promiseChained);
107
+ this.RSVP.off('rejected', this.promiseRejected);
108
+ this.RSVP.off('fulfilled', this.promiseFulfilled);
109
+ this.RSVP.off('created', this.promiseCreated);
110
+ this.all.forEach(item => {
111
+ item.destroy();
112
+ });
113
+ this.all = [];
114
+ this.promiseIndex = {};
115
+ this.promiseChained = null;
116
+ this.promiseRejected = null;
117
+ this.promiseFulfilled = null;
118
+ this.promiseCreated = null;
119
+ this.isStarted = false;
120
+ }
121
+ }
122
+ willDestroy() {
123
+ this.stop();
124
+ super.willDestroy();
125
+ }
126
+ createPromise(props) {
127
+ let promise = new _class(props);
128
+ let index = this.all.length;
129
+ this.all.push(promise);
130
+ this.promiseIndex[promise.guid] = index;
131
+ return promise;
132
+ }
133
+ find(guid) {
134
+ if (guid) {
135
+ const index = this.promiseIndex[guid];
136
+ if (index !== undefined) {
137
+ return this.all[index];
138
+ }
139
+ } else {
140
+ return this.all;
141
+ }
142
+ }
143
+ findOrCreate(guid) {
144
+ return this.find(guid) || this.createPromise({
145
+ guid
146
+ });
147
+ }
148
+ updateOrCreate(guid, properties) {
149
+ let entry = this.find(guid);
150
+ if (entry) {
151
+ Object.assign(entry, properties);
152
+ } else {
153
+ properties = Object.assign({}, properties);
154
+ properties.guid = guid;
155
+ entry = this.createPromise(properties);
156
+ }
157
+ return entry;
158
+ }
159
+ }
160
+ _PromiseAssembler = PromiseAssembler;
161
+ _PromiseAssembler.prototype.RSVP = RSVP;
162
+ function fulfill(event) {
163
+ const guid = event.guid;
164
+ const promise = this.updateOrCreate(guid, {
165
+ label: event.label,
166
+ settledAt: event.timeStamp,
167
+ state: 'fulfilled',
168
+ value: event.detail
169
+ });
170
+ this.trigger('fulfilled', {
171
+ promise
172
+ });
173
+ }
174
+ function reject(event) {
175
+ const guid = event.guid;
176
+ const promise = this.updateOrCreate(guid, {
177
+ label: event.label,
178
+ settledAt: event.timeStamp,
179
+ state: 'rejected',
180
+ reason: event.detail
181
+ });
182
+ this.trigger('rejected', {
183
+ promise
184
+ });
185
+ }
186
+ function chain(event) {
187
+ let guid = event.guid;
188
+ let promise = this.updateOrCreate(guid, {
189
+ label: event.label,
190
+ chainedAt: event.timeStamp
191
+ });
192
+ let children = promise.children;
193
+ let child = this.findOrCreate(event.childGuid);
194
+ child.parent = promise;
195
+ children.push(child);
196
+ this.trigger('chained', {
197
+ promise,
198
+ child
199
+ });
200
+ }
201
+ function create(event) {
202
+ const guid = event.guid;
203
+ const promise = this.updateOrCreate(guid, {
204
+ label: event.label,
205
+ createdAt: event.timeStamp,
206
+ stack: event.stack
207
+ });
208
+
209
+ // todo fix ordering
210
+ if (!promise.state) {
211
+ promise.state = 'created';
212
+ }
213
+ this.trigger('created', {
214
+ promise
215
+ });
216
+ }
217
+
218
+ export { PromiseAssembler as default };