ember-inspector 4.13.1-alpha.2025.7.9 → 4.13.1-alpha.2025.8.1
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/app/index.html +1 -1
- package/app/styles/app.scss +1 -0
- package/dist/bookmarklet/load_inspector.js +1 -0
- package/dist/bookmarklet/panes-3-16-0/assets/{chunk.524.f09748f2f97c650a11d4.js → chunk.524.659d83812026e721dfd0.js} +4 -4
- package/dist/{firefox/panes-3-16-0/assets/chunk.582.745520fa87699e11d9c5.js → bookmarklet/panes-3-16-0/assets/chunk.582.5b4008f88fe48ebd8416.js} +5 -5
- package/dist/bookmarklet/panes-3-16-0/assets/ember-inspector.css +835 -0
- package/dist/bookmarklet/panes-3-16-0/assets/ember-inspector.js +42 -4
- package/dist/bookmarklet/panes-3-16-0/assets/vendor.css +0 -836
- package/dist/bookmarklet/panes-3-16-0/assets/vendor.js +3967 -4019
- package/dist/bookmarklet/panes-3-16-0/base-object-HAEdWjmg.js +59 -0
- package/dist/bookmarklet/panes-3-16-0/basic-DfbgtngO.js +144 -0
- package/dist/bookmarklet/panes-3-16-0/basic-debug.js +6 -0
- package/dist/bookmarklet/panes-3-16-0/bookmarklet-debug.js +34 -0
- package/dist/bookmarklet/panes-3-16-0/chrome-debug.js +12 -0
- package/dist/bookmarklet/panes-3-16-0/ember.js +108 -0
- package/dist/bookmarklet/panes-3-16-0/ember_debug.js +22 -10646
- package/dist/bookmarklet/panes-3-16-0/evented-BCTya3yE.js +62 -0
- package/dist/bookmarklet/panes-3-16-0/firefox-debug.js +32 -0
- package/dist/bookmarklet/panes-3-16-0/index.html +3 -3
- package/dist/bookmarklet/panes-3-16-0/internals-CRmXMEzb.js +12 -0
- package/dist/bookmarklet/panes-3-16-0/main.js +7642 -0
- package/dist/bookmarklet/panes-3-16-0/port.js +108 -0
- package/dist/bookmarklet/panes-3-16-0/profile-node.js +60 -0
- package/dist/bookmarklet/panes-3-16-0/promise-assembler.js +218 -0
- package/dist/bookmarklet/panes-3-16-0/runloop-CF-Qpqgy.js +1138 -0
- package/dist/bookmarklet/panes-3-16-0/start-inspector-BPAW_WLv.js +376 -0
- package/dist/bookmarklet/panes-3-16-0/type-check.js +119 -0
- package/dist/bookmarklet/panes-3-16-0/version.js +90 -0
- package/dist/bookmarklet/panes-3-16-0/versions.js +4 -0
- package/dist/bookmarklet/panes-3-16-0/web-extension-C3pMNVSY.js +144 -0
- package/dist/bookmarklet/panes-3-16-0/websocket-debug.js +60 -0
- package/dist/chrome/content-script.js +1 -0
- package/dist/chrome/manifest.json +3 -3
- package/dist/{firefox/panes-3-16-0/assets/chunk.524.f09748f2f97c650a11d4.js → chrome/panes-3-16-0/assets/chunk.524.659d83812026e721dfd0.js} +4 -4
- package/dist/{bookmarklet/panes-3-16-0/assets/chunk.582.745520fa87699e11d9c5.js → chrome/panes-3-16-0/assets/chunk.582.5b4008f88fe48ebd8416.js} +5 -5
- package/dist/chrome/panes-3-16-0/assets/ember-inspector.css +835 -0
- package/dist/chrome/panes-3-16-0/assets/ember-inspector.js +42 -4
- package/dist/chrome/panes-3-16-0/assets/vendor.css +0 -836
- package/dist/chrome/panes-3-16-0/assets/vendor.js +3967 -4019
- package/dist/chrome/panes-3-16-0/base-object-HAEdWjmg.js +59 -0
- package/dist/chrome/panes-3-16-0/basic-DfbgtngO.js +144 -0
- package/dist/chrome/panes-3-16-0/basic-debug.js +6 -0
- package/dist/chrome/panes-3-16-0/bookmarklet-debug.js +34 -0
- package/dist/chrome/panes-3-16-0/chrome-debug.js +12 -0
- package/dist/chrome/panes-3-16-0/ember.js +108 -0
- package/dist/chrome/panes-3-16-0/ember_debug.js +12 -10658
- package/dist/chrome/panes-3-16-0/evented-BCTya3yE.js +62 -0
- package/dist/chrome/panes-3-16-0/firefox-debug.js +32 -0
- package/dist/chrome/panes-3-16-0/index.html +3 -3
- package/dist/chrome/panes-3-16-0/internals-CRmXMEzb.js +12 -0
- package/dist/chrome/panes-3-16-0/main.js +7642 -0
- package/dist/chrome/panes-3-16-0/port.js +108 -0
- package/dist/chrome/panes-3-16-0/profile-node.js +60 -0
- package/dist/chrome/panes-3-16-0/promise-assembler.js +218 -0
- package/dist/chrome/panes-3-16-0/runloop-CF-Qpqgy.js +1138 -0
- package/dist/chrome/panes-3-16-0/start-inspector-BPAW_WLv.js +376 -0
- package/dist/chrome/panes-3-16-0/type-check.js +119 -0
- package/dist/chrome/panes-3-16-0/version.js +90 -0
- package/dist/chrome/panes-3-16-0/versions.js +4 -0
- package/dist/chrome/panes-3-16-0/web-extension-C3pMNVSY.js +144 -0
- package/dist/chrome/panes-3-16-0/websocket-debug.js +60 -0
- package/dist/firefox/content-script.js +1 -0
- package/dist/firefox/manifest.json +3 -3
- package/dist/{chrome/panes-3-16-0/assets/chunk.524.f09748f2f97c650a11d4.js → firefox/panes-3-16-0/assets/chunk.524.659d83812026e721dfd0.js} +4 -4
- package/dist/{websocket/assets/chunk.582.745520fa87699e11d9c5.js → firefox/panes-3-16-0/assets/chunk.582.5b4008f88fe48ebd8416.js} +5 -5
- package/dist/firefox/panes-3-16-0/assets/ember-inspector.css +835 -0
- package/dist/firefox/panes-3-16-0/assets/ember-inspector.js +42 -4
- package/dist/firefox/panes-3-16-0/assets/vendor.css +0 -836
- package/dist/firefox/panes-3-16-0/assets/vendor.js +3967 -4019
- package/dist/firefox/panes-3-16-0/base-object-HAEdWjmg.js +59 -0
- package/dist/firefox/panes-3-16-0/basic-DfbgtngO.js +144 -0
- package/dist/firefox/panes-3-16-0/basic-debug.js +6 -0
- package/dist/firefox/panes-3-16-0/bookmarklet-debug.js +34 -0
- package/dist/firefox/panes-3-16-0/chrome-debug.js +12 -0
- package/dist/firefox/panes-3-16-0/ember.js +108 -0
- package/dist/firefox/panes-3-16-0/ember_debug.js +28 -10654
- package/dist/firefox/panes-3-16-0/evented-BCTya3yE.js +62 -0
- package/dist/firefox/panes-3-16-0/firefox-debug.js +32 -0
- package/dist/firefox/panes-3-16-0/index.html +3 -3
- package/dist/firefox/panes-3-16-0/internals-CRmXMEzb.js +12 -0
- package/dist/firefox/panes-3-16-0/main.js +7642 -0
- package/dist/firefox/panes-3-16-0/port.js +108 -0
- package/dist/firefox/panes-3-16-0/profile-node.js +60 -0
- package/dist/firefox/panes-3-16-0/promise-assembler.js +218 -0
- package/dist/firefox/panes-3-16-0/runloop-CF-Qpqgy.js +1138 -0
- package/dist/firefox/panes-3-16-0/start-inspector-BPAW_WLv.js +376 -0
- package/dist/firefox/panes-3-16-0/type-check.js +119 -0
- package/dist/firefox/panes-3-16-0/version.js +90 -0
- package/dist/firefox/panes-3-16-0/versions.js +4 -0
- package/dist/firefox/panes-3-16-0/web-extension-C3pMNVSY.js +144 -0
- package/dist/firefox/panes-3-16-0/websocket-debug.js +60 -0
- package/dist/websocket/assets/{chunk.524.f09748f2f97c650a11d4.js → chunk.524.659d83812026e721dfd0.js} +4 -4
- package/dist/{chrome/panes-3-16-0/assets/chunk.582.745520fa87699e11d9c5.js → websocket/assets/chunk.582.5b4008f88fe48ebd8416.js} +5 -5
- package/dist/websocket/assets/ember-inspector.css +835 -0
- package/dist/websocket/assets/ember-inspector.js +42 -4
- package/dist/websocket/assets/vendor.css +0 -836
- package/dist/websocket/assets/vendor.js +3967 -4019
- package/dist/websocket/base-object-HAEdWjmg.js +59 -0
- package/dist/websocket/basic-DfbgtngO.js +144 -0
- package/dist/websocket/basic-debug.js +6 -0
- package/dist/websocket/bookmarklet-debug.js +34 -0
- package/dist/websocket/chrome-debug.js +12 -0
- package/dist/websocket/ember.js +108 -0
- package/dist/websocket/ember_debug.js +36 -10634
- package/dist/websocket/evented-BCTya3yE.js +62 -0
- package/dist/websocket/firefox-debug.js +32 -0
- package/dist/websocket/index.html +3 -3
- package/dist/websocket/internals-CRmXMEzb.js +12 -0
- package/dist/websocket/main.js +7642 -0
- package/dist/websocket/port.js +108 -0
- package/dist/websocket/profile-node.js +60 -0
- package/dist/websocket/promise-assembler.js +218 -0
- package/dist/websocket/runloop-CF-Qpqgy.js +1138 -0
- package/dist/websocket/start-inspector-BPAW_WLv.js +376 -0
- package/dist/websocket/type-check.js +119 -0
- package/dist/websocket/version.js +90 -0
- package/dist/websocket/versions.js +4 -0
- package/dist/websocket/web-extension-C3pMNVSY.js +144 -0
- package/dist/websocket/websocket-debug.js +60 -0
- package/ember-cli-build.js +28 -91
- package/ember_debug/adapters/basic.js +9 -29
- package/ember_debug/adapters/web-extension.js +4 -4
- package/ember_debug/adapters/websocket.js +2 -2
- package/ember_debug/container-debug.js +1 -1
- package/ember_debug/data-debug.js +2 -2
- package/ember_debug/debug-port.js +1 -1
- package/ember_debug/deprecation-debug.js +6 -6
- package/ember_debug/entrypoints/basic-debug.js +6 -0
- package/ember_debug/entrypoints/bookmarklet-debug.js +6 -0
- package/ember_debug/entrypoints/chrome-debug.js +6 -0
- package/ember_debug/entrypoints/firefox-debug.js +6 -0
- package/ember_debug/entrypoints/websocket-debug.js +6 -0
- package/ember_debug/general-debug.js +3 -3
- package/ember_debug/lib/boot-ember-inspector.js +9 -0
- package/ember_debug/lib/get-applications.js +27 -0
- package/ember_debug/lib/load-ember-debug-in-webpage.js +30 -0
- package/ember_debug/lib/send-apps.js +14 -0
- package/ember_debug/lib/send-version-miss.js +39 -0
- package/ember_debug/lib/setup-instance-initializer.js +16 -0
- package/ember_debug/lib/start-inspector.js +211 -0
- package/ember_debug/lib/version-test.js +73 -0
- package/ember_debug/lib/versions.js +3 -0
- package/ember_debug/libs/capture-render-tree.js +1 -1
- package/ember_debug/libs/promise-assembler.js +4 -4
- package/ember_debug/libs/render-tree.js +5 -5
- package/ember_debug/libs/source-map.js +1 -1
- package/ember_debug/libs/view-inspection.js +3 -3
- package/ember_debug/main.js +17 -20
- package/ember_debug/models/profile-manager.js +5 -6
- package/ember_debug/models/profile-node.js +1 -1
- package/ember_debug/models/promise.js +2 -2
- package/ember_debug/object-inspector.js +9 -9
- package/ember_debug/package.json +3 -1
- package/ember_debug/port.js +4 -4
- package/ember_debug/promise-debug.js +4 -4
- package/ember_debug/render-debug.js +5 -5
- package/ember_debug/rollup.config.js +5 -29
- package/ember_debug/route-debug.js +7 -7
- package/ember_debug/services/session.js +1 -1
- package/ember_debug/utils/ember/object/internals.js +1 -6
- package/ember_debug/utils/ember/runloop.js +2 -7
- package/ember_debug/utils/ember-object-names.js +2 -2
- package/ember_debug/utils/ember.js +72 -28
- package/ember_debug/utils/get-object-name.js +1 -1
- package/ember_debug/utils/type-check.js +2 -2
- package/ember_debug/view-debug.js +4 -4
- package/package.json +6 -9
- package/skeletons/bookmarklet/load_inspector.js +1 -0
- package/skeletons/web-extension/content-script.js +1 -0
- package/skeletons/web-extension/manifest.json +3 -3
- package/tests/ember_debug/profile-manager-test.js +1 -3
- package/tests/index.html +1 -2
- package/tests/integration/injection-test.js +3 -3
- package/tests/test-helper.js +0 -3
- package/ember_debug/utils/ember/debug.js +0 -21
- package/ember_debug/utils/ember/instrumentation.js +0 -11
- package/ember_debug/utils/rsvp.js +0 -14
- package/ember_debug/vendor/loader.js +0 -54
- package/ember_debug/vendor/startup-wrapper.js +0 -402
- package/lib/ui/app/components/ui/disclosure-triangle.js +0 -1
- package/lib/ui/app/components/ui/disclosure.js +0 -1
- package/lib/ui/app/components/ui/drag-handle.js +0 -1
- package/lib/ui/app/components/ui/draggable-column.js +0 -1
- package/lib/ui/app/components/ui/empty-message.js +0 -1
- package/lib/ui/app/components/ui/error-page.js +0 -1
- package/lib/ui/app/components/ui/open-links-in-new-window.js +0 -1
- package/lib/ui/app/components/ui/resizable-column.js +0 -1
- package/lib/ui/app/components/ui/send-to-console.js +0 -1
- package/lib/ui/app/components/ui/toolbar-clear-button.js +0 -1
- package/lib/ui/app/components/ui/toolbar-divider.js +0 -1
- package/lib/ui/app/components/ui/toolbar-reload-button.js +0 -1
- package/lib/ui/app/components/ui/toolbar-search-field.js +0 -1
- package/lib/ui/app/components/ui/warning-message.js +0 -1
- package/lib/ui/index.js +0 -34
- package/lib/ui/package.json +0 -13
- /package/{lib/ui/addon/components → app/components/ui}/disclosure-triangle.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/disclosure.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/disclosure.js +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/drag-handle.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/drag-handle.js +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/draggable-column.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/draggable-column.js +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/empty-message.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/error-page.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/open-links-in-new-window.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/open-links-in-new-window.js +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/resizable-column.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/resizable-column.js +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/send-to-console.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/toolbar-clear-button.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/toolbar-divider.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/toolbar-reload-button.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/toolbar-search-field.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/toolbar-search-field.js +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/warning-message.hbs +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_disclosure-triangle.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_drag-handle.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_empty-message.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_error-page.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_goto-source.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_list.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_nav.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_object-inspector-toggle.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_pill.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_send-to-console.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_split.scss +0 -0
- /package/{lib/ui/addon/styles/addon.scss → app/styles/ui/_ui.scss} +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_warning.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_checkbox.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_divider.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_icon-button.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_index.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_radio.scss +0 -0
- /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 };
|