ember-inspector 4.4.1 → 4.5.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/.eslintignore +1 -0
- package/.eslintrc.js +20 -12
- package/.github/workflows/build.yml +1 -0
- package/.tool-versions +1 -0
- package/CHANGELOG.md +31 -2
- package/app/{templates → components}/component-tree-toolbar.hbs +5 -5
- package/app/{templates → components}/container-type-toolbar.hbs +3 -3
- package/app/{templates/container-types/index-toolbar.hbs → components/container-types-toolbar.hbs} +2 -2
- package/app/components/date-property-field.js +4 -10
- package/app/{templates → components}/deprecations-toolbar.hbs +4 -4
- package/app/{templates → components}/libraries-toolbar.hbs +0 -0
- package/app/{templates → components}/model-types-toolbar.hbs +4 -4
- package/app/{templates → components}/promise-tree-toolbar.hbs +13 -13
- package/app/components/records-toolbar.hbs +26 -0
- package/app/components/render-tree-toolbar.hbs +33 -0
- package/app/components/route-cell-name.js +1 -1
- package/app/{templates → components}/route-tree-toolbar.hbs +3 -3
- package/app/components/scroll-container.js +3 -1
- package/app/computed/debounce.js +1 -3
- package/app/controllers/deprecations.js +1 -0
- package/app/controllers/render-tree.js +19 -4
- package/app/controllers/route-tree.js +51 -44
- package/app/initializers/setup.js +7 -18
- package/app/models/promise.js +3 -4
- package/app/routes/application.js +2 -14
- package/app/routes/component-tree.js +3 -0
- package/app/routes/deprecations.js +4 -0
- package/app/routes/launch.js +1 -0
- package/app/routes/libraries.js +1 -0
- package/app/routes/promise-tree.js +6 -0
- package/app/routes/render-tree.js +27 -10
- package/app/routes/route-tree.js +3 -2
- package/app/routes/tab.js +9 -9
- package/app/routes/whats-new.js +2 -0
- package/app/{adapters → services/adapters}/basic.js +3 -3
- package/app/{adapters → services/adapters}/bookmarklet.js +0 -0
- package/app/{adapters → services/adapters}/chrome.js +0 -0
- package/app/{adapters → services/adapters}/firefox.js +0 -0
- package/app/{adapters → services/adapters}/web-extension.js +0 -0
- package/app/{adapters → services/adapters}/websocket.js +0 -0
- package/app/services/port.js +3 -2
- package/app/templates/application.hbs +1 -1
- package/app/templates/component-tree.hbs +20 -4
- package/app/templates/container-type.hbs +10 -0
- package/app/templates/container-types/index.hbs +10 -0
- package/app/templates/deprecations.hbs +13 -10
- package/app/templates/libraries.hbs +12 -11
- package/app/templates/model-types.hbs +15 -2
- package/app/templates/promise-tree.hbs +22 -7
- package/app/templates/records.hbs +15 -7
- package/app/templates/render-tree.hbs +32 -9
- package/app/templates/route-tree.hbs +23 -14
- package/app/templates/whats-new.hbs +8 -4
- package/config/ember-cli-update.json +1 -1
- package/config/ember-try.js +8 -0
- package/config/targets.js +14 -6
- package/dist/bookmarklet/panes-3-4-0/assets/chunk.143.701794df61367d9c0beb.js +146 -0
- package/dist/bookmarklet/panes-3-4-0/assets/chunk.178.1fa501a69a8888639ff4.js +20 -0
- package/dist/bookmarklet/panes-3-4-0/assets/chunk.916.cfdae71ef87e943d7ad0.js +505 -0
- package/dist/bookmarklet/panes-3-4-0/assets/chunk.916.cfdae71ef87e943d7ad0.js.LICENSE.txt +8 -0
- package/dist/bookmarklet/panes-3-4-0/assets/ember-inspector.js +617 -1512
- package/dist/bookmarklet/panes-3-4-0/assets/vendor.css +9 -2
- package/dist/bookmarklet/panes-3-4-0/assets/vendor.js +6132 -7501
- package/dist/bookmarklet/panes-3-4-0/ember_debug.js +731 -416
- package/dist/bookmarklet/panes-3-4-0/index.html +2 -1
- package/dist/chrome/manifest.json +1 -1
- package/dist/chrome/panes-3-4-0/assets/chunk.143.701794df61367d9c0beb.js +146 -0
- package/dist/chrome/panes-3-4-0/assets/chunk.178.1fa501a69a8888639ff4.js +20 -0
- package/dist/chrome/panes-3-4-0/assets/chunk.916.cfdae71ef87e943d7ad0.js +505 -0
- package/dist/chrome/panes-3-4-0/assets/chunk.916.cfdae71ef87e943d7ad0.js.LICENSE.txt +8 -0
- package/dist/chrome/panes-3-4-0/assets/ember-inspector.js +617 -1512
- package/dist/chrome/panes-3-4-0/assets/vendor.css +9 -2
- package/dist/chrome/panes-3-4-0/assets/vendor.js +6132 -7501
- package/dist/chrome/panes-3-4-0/ember_debug.js +731 -416
- package/dist/chrome/panes-3-4-0/index.html +2 -1
- package/dist/firefox/manifest.json +1 -1
- package/dist/firefox/panes-3-4-0/assets/chunk.143.701794df61367d9c0beb.js +146 -0
- package/dist/firefox/panes-3-4-0/assets/chunk.178.1fa501a69a8888639ff4.js +20 -0
- package/dist/firefox/panes-3-4-0/assets/chunk.916.cfdae71ef87e943d7ad0.js +505 -0
- package/dist/firefox/panes-3-4-0/assets/chunk.916.cfdae71ef87e943d7ad0.js.LICENSE.txt +8 -0
- package/dist/firefox/panes-3-4-0/assets/ember-inspector.js +617 -1512
- package/dist/firefox/panes-3-4-0/assets/vendor.css +9 -2
- package/dist/firefox/panes-3-4-0/assets/vendor.js +6132 -7501
- package/dist/firefox/panes-3-4-0/ember_debug.js +731 -416
- package/dist/firefox/panes-3-4-0/index.html +2 -1
- package/dist/websocket/assets/chunk.143.701794df61367d9c0beb.js +146 -0
- package/dist/websocket/assets/chunk.178.1fa501a69a8888639ff4.js +20 -0
- package/dist/websocket/assets/chunk.916.cfdae71ef87e943d7ad0.js +505 -0
- package/dist/websocket/assets/chunk.916.cfdae71ef87e943d7ad0.js.LICENSE.txt +8 -0
- package/dist/websocket/assets/ember-inspector.js +617 -1512
- package/dist/websocket/assets/vendor.css +9 -2
- package/dist/websocket/assets/vendor.js +6132 -7501
- package/dist/websocket/ember_debug.js +731 -416
- package/dist/websocket/index.html +2 -1
- package/ember_debug/adapters/basic.js +4 -3
- package/ember_debug/adapters/web-extension.js +2 -1
- package/ember_debug/adapters/websocket.js +4 -7
- package/ember_debug/container-debug.js +2 -3
- package/ember_debug/data-debug.js +4 -3
- package/ember_debug/deprecation-debug.js +12 -15
- package/ember_debug/general-debug.js +3 -4
- package/ember_debug/libs/promise-assembler.js +12 -14
- package/ember_debug/libs/source-map.js +3 -8
- package/ember_debug/main.js +11 -11
- package/ember_debug/mixins/port-mixin.js +1 -3
- package/ember_debug/models/profile-manager.js +135 -3
- package/ember_debug/models/profile-node.js +2 -4
- package/ember_debug/models/promise.js +3 -4
- package/ember_debug/object-inspector.js +15 -19
- package/ember_debug/port.js +7 -5
- package/ember_debug/promise-debug.js +16 -17
- package/ember_debug/render-debug.js +11 -4
- package/ember_debug/route-debug.js +5 -10
- package/ember_debug/services/session.js +1 -3
- package/ember_debug/utils/ember/application.js +11 -0
- package/ember_debug/utils/ember/array/index.js +11 -0
- package/ember_debug/utils/ember/array/mutable.js +11 -0
- package/ember_debug/utils/ember/array/proxy.js +11 -0
- package/ember_debug/utils/ember/component.js +11 -0
- package/ember_debug/utils/ember/debug.js +15 -0
- package/ember_debug/utils/{ember.js → ember/index.js} +1 -0
- package/ember_debug/utils/ember/instrumentation.js +11 -0
- package/ember_debug/utils/ember/object/computed.js +11 -0
- package/ember_debug/utils/ember/object/evented.js +11 -0
- package/ember_debug/utils/ember/object/index.js +15 -0
- package/ember_debug/utils/ember/object/internals.js +11 -0
- package/ember_debug/utils/ember/object/mixin.js +11 -0
- package/ember_debug/utils/ember/object/observable.js +11 -0
- package/ember_debug/utils/ember/object/promise-proxy-mixin.js +13 -0
- package/ember_debug/utils/ember/runloop.js +17 -0
- package/ember_debug/utils/ember/utils.js +11 -0
- package/ember_debug/utils/rsvp.js +14 -0
- package/ember_debug/vendor/startup-wrapper.js +21 -12
- package/ember_debug/view-debug.js +2 -3
- package/package.json +43 -37
- package/tests/acceptance/app-picker-test.js +3 -3
- package/tests/acceptance/component-tree-test.js +17 -3
- package/tests/acceptance/container-test.js +8 -6
- package/tests/acceptance/data-test.js +2 -0
- package/tests/acceptance/deprecation-test.js +4 -0
- package/tests/acceptance/object-inspector-test.js +29 -1
- package/tests/acceptance/promise-test.js +11 -1
- package/tests/acceptance/route-tree-test.js +10 -0
- package/tests/acceptance/whats-new-test.js +1 -1
- package/tests/ember_debug/ember-debug-test.js +2 -0
- package/tests/ember_debug/object-inspector-test.js +54 -22
- package/tests/ember_debug/profile-manager-test.js +563 -6
- package/tests/ember_debug/profile-node-test.js +5 -5
- package/tests/ember_debug/promise-assembler-test.js +2 -0
- package/tests/ember_debug/promise-debug-test.js +7 -5
- package/tests/ember_debug/render-debug-test.js +1 -1
- package/tests/ember_debug/view-debug-test.js +8 -8
- package/tests/helpers/setup-ember-debug-test.js +11 -6
- package/tests/index.html +8 -1
- package/tests/integration/components/component-tree-arg-test.js +1 -1
- package/tests/test-adapter.js +1 -1
- package/tests/test-helper.js +5 -1
- package/tests/unit/check-current-route-test.js +4 -0
- package/tests/unit/is-route-substate-test.js +8 -8
- package/tests/unit/match-test.js +2 -2
- package/app/templates/records-toolbar.hbs +0 -26
- package/app/templates/render-tree-toolbar.hbs +0 -20
- package/tests/.eslintrc.js +0 -8
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
<meta name="ember-inspector/config/environment" content="%7B%22modulePrefix%22%3A%22ember-inspector%22%2C%22environment%22%3A%22production%22%2C%22rootURL%22%3A%22%22%2C%22locationType%22%3A%22hash%22%2C%22version%22%3A%224.
|
|
13
|
+
<meta name="ember-inspector/config/environment" content="%7B%22modulePrefix%22%3A%22ember-inspector%22%2C%22environment%22%3A%22production%22%2C%22rootURL%22%3A%22%22%2C%22locationType%22%3A%22hash%22%2C%22version%22%3A%224.5.0%22%2C%22emberVersionsSupported%22%3A%5B%223.4.0%22%2C%22%22%5D%2C%22previousEmberVersionsSupported%22%3A%5B%220.0.0%22%2C%222.7.0%22%5D%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%22EMBER_METAL_TRACKED_PROPERTIES%22%3Atrue%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%7D%2C%22_APPLICATION_TEMPLATE_WRAPPER%22%3Afalse%2C%22_DEFAULT_ASYNC_OBSERVERS%22%3Atrue%2C%22_JQUERY_INTEGRATION%22%3Afalse%2C%22_TEMPLATE_ONLY_GLIMMER_COMPONENTS%22%3Atrue%7D%2C%22APP%22%3A%7B%22name%22%3A%22ember-inspector%22%2C%22version%22%3A%224.5.0%2B16161d49%22%7D%2C%22exportApplicationGlobal%22%3Afalse%7D" />
|
|
14
14
|
|
|
15
15
|
<style type="text/css">
|
|
16
16
|
@font-face {
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
<script src="assets/vendor.js"></script>
|
|
42
|
+
<script src="/assets/chunk.143.701794df61367d9c0beb.js"></script>
|
|
42
43
|
<script src="assets/ember-inspector.js"></script>
|
|
43
44
|
|
|
44
45
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/* eslint no-console: 0 */
|
|
2
|
-
import Ember from '../utils/ember';
|
|
3
|
-
const { A, computed, RSVP, Object: EmberObject } = Ember;
|
|
4
|
-
const { Promise, resolve } = RSVP;
|
|
5
2
|
import { onReady } from '../utils/on-ready';
|
|
6
3
|
|
|
4
|
+
import { A } from '../utils/ember/array';
|
|
5
|
+
import EmberObject, { computed } from '../utils/ember/object';
|
|
6
|
+
import { Promise, resolve } from '../utils/rsvp';
|
|
7
|
+
|
|
7
8
|
export default EmberObject.extend({
|
|
8
9
|
init() {
|
|
9
10
|
resolve(this.connect(), 'ember-inspector').then(
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import BasicAdapter from './basic';
|
|
2
|
-
import Ember from '../utils/ember';
|
|
3
|
-
|
|
4
|
-
const {
|
|
5
|
-
computed,
|
|
6
|
-
run,
|
|
7
|
-
RSVP: { Promise },
|
|
8
|
-
} = Ember;
|
|
9
2
|
import { onReady } from '../utils/on-ready';
|
|
10
3
|
|
|
4
|
+
import { computed } from '../utils/ember/object';
|
|
5
|
+
import { run } from '../utils/ember/runloop';
|
|
6
|
+
import { Promise } from '../utils/rsvp';
|
|
7
|
+
|
|
11
8
|
export default BasicAdapter.extend({
|
|
12
9
|
sendMessage(options = {}) {
|
|
13
10
|
this.socket.emit('emberInspectorMessage', options);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// eslint-disable-next-line ember/no-mixins
|
|
2
2
|
import PortMixin from 'ember-debug/mixins/port-mixin';
|
|
3
|
-
import Ember from './utils/ember';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import EmberObject, { computed } from './utils/ember/object';
|
|
5
|
+
import { reads, readOnly } from './utils/ember/object/computed';
|
|
7
6
|
|
|
8
7
|
export default EmberObject.extend(PortMixin, {
|
|
9
8
|
namespace: null,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// eslint-disable-next-line ember/no-mixins
|
|
2
2
|
import PortMixin from 'ember-debug/mixins/port-mixin';
|
|
3
|
-
import Ember from './utils/ember';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { A } from './utils/ember/array';
|
|
5
|
+
import EmberObject, { computed, set } from './utils/ember/object';
|
|
6
|
+
import { alias } from './utils/ember/object/computed';
|
|
7
|
+
import { guidFor } from './utils/ember/object/internals';
|
|
7
8
|
|
|
8
9
|
export default EmberObject.extend(PortMixin, {
|
|
9
10
|
init() {
|
|
@@ -2,21 +2,13 @@
|
|
|
2
2
|
import PortMixin from 'ember-debug/mixins/port-mixin';
|
|
3
3
|
import SourceMap from 'ember-debug/libs/source-map';
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
let run;
|
|
13
|
-
try {
|
|
14
|
-
run = requireModule('@ember/runloop')['default'];
|
|
15
|
-
} catch {
|
|
16
|
-
run = Ember.run;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const { cancel, debounce } = run;
|
|
5
|
+
import { A } from './utils/ember/array';
|
|
6
|
+
import { registerDeprecationHandler } from './utils/ember/debug';
|
|
7
|
+
import EmberObject, { computed } from './utils/ember/object';
|
|
8
|
+
import { readOnly } from './utils/ember/object/computed';
|
|
9
|
+
import { guidFor } from './utils/ember/object/internals';
|
|
10
|
+
import { cancel, debounce } from './utils/ember/runloop';
|
|
11
|
+
import { all, resolve } from './utils/rsvp';
|
|
20
12
|
|
|
21
13
|
export default EmberObject.extend(PortMixin, {
|
|
22
14
|
portNamespace: 'deprecation',
|
|
@@ -207,6 +199,11 @@ export default EmberObject.extend(PortMixin, {
|
|
|
207
199
|
|
|
208
200
|
handleDeprecations() {
|
|
209
201
|
registerDeprecationHandler((message, options, next) => {
|
|
202
|
+
if (!this.adapter) {
|
|
203
|
+
next(message, options);
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
|
|
210
207
|
/* global __fail__*/
|
|
211
208
|
|
|
212
209
|
let error;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/* eslint no-empty:0 */
|
|
2
2
|
// eslint-disable-next-line ember/no-mixins
|
|
3
3
|
import PortMixin from 'ember-debug/mixins/port-mixin';
|
|
4
|
-
import Ember from './utils/ember';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import Ember from './utils/ember';
|
|
6
|
+
import EmberObject from './utils/ember/object';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Class that handles gathering general information of the inspected app.
|
|
@@ -93,7 +92,7 @@ export default EmberObject.extend(PortMixin, {
|
|
|
93
92
|
* the info tab.
|
|
94
93
|
*/
|
|
95
94
|
getLibraries() {
|
|
96
|
-
this.sendMessage('libraries', { libraries: libraries._registry });
|
|
95
|
+
this.sendMessage('libraries', { libraries: Ember.libraries._registry });
|
|
97
96
|
},
|
|
98
97
|
|
|
99
98
|
getEmberCliConfig() {
|
|
@@ -6,9 +6,12 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import Promise from 'ember-debug/models/promise';
|
|
9
|
-
import Ember from '../utils/ember';
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
import { A } from '../utils/ember/array';
|
|
11
|
+
import EmberObject from '../utils/ember/object';
|
|
12
|
+
import Evented from '../utils/ember/object/evented';
|
|
13
|
+
import { isNone } from '../utils/ember/utils';
|
|
14
|
+
import RSVP from '../utils/rsvp';
|
|
12
15
|
|
|
13
16
|
let PromiseAssembler = EmberObject.extend(Evented, {
|
|
14
17
|
// RSVP lib to debug
|
|
@@ -16,16 +19,11 @@ let PromiseAssembler = EmberObject.extend(Evented, {
|
|
|
16
19
|
|
|
17
20
|
isStarted: false,
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return {};
|
|
25
|
-
}),
|
|
26
|
-
|
|
27
|
-
// injected on creation
|
|
28
|
-
promiseDebug: null,
|
|
22
|
+
init() {
|
|
23
|
+
this._super(...arguments);
|
|
24
|
+
this.all = A();
|
|
25
|
+
this.promiseIndex = {};
|
|
26
|
+
},
|
|
29
27
|
|
|
30
28
|
start() {
|
|
31
29
|
this.RSVP.configure('instrument', true);
|
|
@@ -62,9 +60,9 @@ let PromiseAssembler = EmberObject.extend(Evented, {
|
|
|
62
60
|
this.all.forEach((item) => {
|
|
63
61
|
item.destroy();
|
|
64
62
|
});
|
|
65
|
-
this.set('all', A());
|
|
66
|
-
this.set('promiseIndex', {});
|
|
67
63
|
|
|
64
|
+
this.all = A();
|
|
65
|
+
this.promiseIndex = {};
|
|
68
66
|
this.promiseChained = null;
|
|
69
67
|
this.promiseRejected = null;
|
|
70
68
|
this.promiseFulfilled = null;
|
|
@@ -3,14 +3,9 @@
|
|
|
3
3
|
* A lot of the code is inspired by/taken from
|
|
4
4
|
* https://github.com/evanw/node-source-map-support
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Object: EmberObject,
|
|
10
|
-
A,
|
|
11
|
-
computed,
|
|
12
|
-
RSVP: { resolve, Promise },
|
|
13
|
-
} = Ember;
|
|
6
|
+
import { A } from '../utils/ember/array';
|
|
7
|
+
import EmberObject, { computed } from '../utils/ember/object';
|
|
8
|
+
import { Promise, resolve } from '../utils/rsvp';
|
|
14
9
|
|
|
15
10
|
const notFoundError = new Error('Source map url not found');
|
|
16
11
|
|
package/ember_debug/main.js
CHANGED
|
@@ -10,16 +10,15 @@ import PromiseDebug from 'ember-debug/promise-debug';
|
|
|
10
10
|
import ContainerDebug from 'ember-debug/container-debug';
|
|
11
11
|
import DeprecationDebug from 'ember-debug/deprecation-debug';
|
|
12
12
|
import Session from 'ember-debug/services/session';
|
|
13
|
+
|
|
13
14
|
import Ember from './utils/ember';
|
|
15
|
+
import Application from './utils/ember/application';
|
|
16
|
+
import EmberObject, { computed } from './utils/ember/object';
|
|
17
|
+
import { or } from './utils/ember/object/computed';
|
|
18
|
+
import { guidFor } from './utils/ember/object/internals';
|
|
19
|
+
import { run } from './utils/ember/runloop';
|
|
14
20
|
|
|
15
|
-
const {
|
|
16
|
-
Object: EmberObject,
|
|
17
|
-
run,
|
|
18
|
-
Application,
|
|
19
|
-
Namespace,
|
|
20
|
-
guidFor,
|
|
21
|
-
computed,
|
|
22
|
-
} = Ember;
|
|
21
|
+
const { Namespace } = Ember;
|
|
23
22
|
|
|
24
23
|
const EmberDebug = EmberObject.extend({
|
|
25
24
|
/**
|
|
@@ -40,9 +39,10 @@ const EmberDebug = EmberObject.extend({
|
|
|
40
39
|
owner: null,
|
|
41
40
|
started: false,
|
|
42
41
|
|
|
43
|
-
applicationName:
|
|
44
|
-
|
|
45
|
-
.
|
|
42
|
+
applicationName: or(
|
|
43
|
+
'_application.name',
|
|
44
|
+
'_application.modulePrefix'
|
|
45
|
+
).readOnly(),
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* We use the application's id instead of the owner's id so that we use the same inspector
|
|
@@ -1,9 +1,65 @@
|
|
|
1
1
|
import ProfileNode from './profile-node';
|
|
2
2
|
import Ember from '../utils/ember';
|
|
3
|
+
import { compareVersion } from 'ember-debug/utils/version';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { later, scheduleOnce, cancel } from '../utils/ember/runloop';
|
|
6
|
+
|
|
7
|
+
function getEdges(first, last, closest) {
|
|
8
|
+
let start = null;
|
|
9
|
+
let end = null;
|
|
10
|
+
for (let i = 0; i < closest.length; i++) {
|
|
11
|
+
if (closest.item(i) === first.node) start = i;
|
|
12
|
+
else if (closest.item(i) === last.node) end = i;
|
|
13
|
+
}
|
|
14
|
+
return [start, end];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function getUnfilteredRoots(first, last, closest) {
|
|
18
|
+
if (first.node === last.node) return [first.node];
|
|
19
|
+
|
|
20
|
+
const roots = [];
|
|
21
|
+
|
|
22
|
+
const [start, end] = getEdges(first, last, closest);
|
|
23
|
+
|
|
24
|
+
if (start === null || end === null) return [];
|
|
25
|
+
|
|
26
|
+
for (let i = start; i <= end; i++) roots.push(closest.item(i));
|
|
27
|
+
|
|
28
|
+
return roots;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function findRoots({ first, last, parent }) {
|
|
32
|
+
const closest = parent.childNodes;
|
|
33
|
+
|
|
34
|
+
const roots = getUnfilteredRoots(first, last, closest);
|
|
35
|
+
|
|
36
|
+
return roots.filter((el) => el?.nodeType === 1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function makeHighlight() {
|
|
40
|
+
const node = document.createElement('div');
|
|
41
|
+
node.setAttribute('role', 'presentation');
|
|
42
|
+
node.setAttribute('class', 'ember-inspector-render-highlight');
|
|
43
|
+
return node;
|
|
44
|
+
}
|
|
45
|
+
function insertHTML(node) {
|
|
46
|
+
document.body.appendChild(node);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function insertStylesheet() {
|
|
50
|
+
const content = `
|
|
51
|
+
.ember-inspector-render-highlight {
|
|
52
|
+
border: 2px solid rgba(255,0,0,0.2);
|
|
53
|
+
box-shadow: 0px 0px 1px rgba(255,0,0,0.2);
|
|
54
|
+
z-index: 1000000;
|
|
55
|
+
pointer-events: none;
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
const style = document.createElement('style');
|
|
59
|
+
style.appendChild(document.createTextNode(content));
|
|
60
|
+
document.head.appendChild(style);
|
|
61
|
+
return style;
|
|
62
|
+
}
|
|
7
63
|
|
|
8
64
|
/**
|
|
9
65
|
* A class for keeping track of active rendering profiles as a list.
|
|
@@ -15,11 +71,20 @@ export default class ProfileManager {
|
|
|
15
71
|
this.currentSet = [];
|
|
16
72
|
this._profilesAddedCallbacks = [];
|
|
17
73
|
this.queue = [];
|
|
74
|
+
this.shouldHighlightRender = false;
|
|
75
|
+
this.stylesheet = insertStylesheet();
|
|
76
|
+
// keep track of all the active highlights
|
|
77
|
+
this.highlights = [];
|
|
78
|
+
this.isHighlightEnabled = compareVersion(Ember?.VERSION, '3.20.0') !== -1;
|
|
18
79
|
}
|
|
19
80
|
|
|
20
81
|
began(timestamp, payload, now) {
|
|
21
82
|
return this.wrapForErrors(this, function () {
|
|
22
83
|
this.current = new ProfileNode(timestamp, payload, this.current, now);
|
|
84
|
+
if (this.shouldHighlightRender && payload.view) {
|
|
85
|
+
this._highLightView(payload.view);
|
|
86
|
+
}
|
|
87
|
+
this.current.isHighlightEnabled = this.isHighlightEnabled;
|
|
23
88
|
return this.current;
|
|
24
89
|
});
|
|
25
90
|
}
|
|
@@ -45,6 +110,18 @@ export default class ProfileManager {
|
|
|
45
110
|
return callback.call(context);
|
|
46
111
|
}
|
|
47
112
|
|
|
113
|
+
_highLightView(view) {
|
|
114
|
+
const symbols = Object.getOwnPropertySymbols(view);
|
|
115
|
+
const bounds = view[symbols.find((sym) => sym.description === 'BOUNDS')];
|
|
116
|
+
if (!bounds) return;
|
|
117
|
+
|
|
118
|
+
const elements = findRoots(bounds);
|
|
119
|
+
|
|
120
|
+
elements.forEach((node) => {
|
|
121
|
+
this._renderHighlight(node);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
48
125
|
/**
|
|
49
126
|
* Push a new profile into the queue
|
|
50
127
|
* @param info
|
|
@@ -80,6 +157,61 @@ export default class ProfileManager {
|
|
|
80
157
|
}
|
|
81
158
|
}
|
|
82
159
|
|
|
160
|
+
teardown() {
|
|
161
|
+
this.stylesheet?.remove();
|
|
162
|
+
// remove all the active highlighted components
|
|
163
|
+
this._removeAllHighlights();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
_removeAllHighlights() {
|
|
167
|
+
const els = this.highlights.slice(0);
|
|
168
|
+
els.forEach((el) => {
|
|
169
|
+
this._removeHighlight(el);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
_removeHighlight(highlight) {
|
|
174
|
+
this.highlights = this.highlights.filter((item) => item !== highlight);
|
|
175
|
+
cancel(highlight.timeout);
|
|
176
|
+
highlight.el.remove();
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
_addHighlight(highlight) {
|
|
180
|
+
insertHTML(highlight.el);
|
|
181
|
+
this.highlights.push(highlight);
|
|
182
|
+
|
|
183
|
+
highlight.timeout = later(() => {
|
|
184
|
+
this._removeHighlight(highlight);
|
|
185
|
+
}, 500);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
_constructHighlight(renderedNode) {
|
|
189
|
+
const rect = renderedNode.getBoundingClientRect();
|
|
190
|
+
const highlight = makeHighlight();
|
|
191
|
+
|
|
192
|
+
const { top, left, width, height } = rect;
|
|
193
|
+
const { scrollX, scrollY } = window;
|
|
194
|
+
const { style } = highlight;
|
|
195
|
+
if (style) {
|
|
196
|
+
style.position = 'absolute';
|
|
197
|
+
style.top = `${top + scrollY}px`;
|
|
198
|
+
style.left = `${left + scrollX}px`;
|
|
199
|
+
style.width = `${width}px`;
|
|
200
|
+
style.height = `${height}px`;
|
|
201
|
+
}
|
|
202
|
+
return highlight;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
_renderHighlight(renderedNode) {
|
|
206
|
+
if (!renderedNode?.getBoundingClientRect) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const highlight = this._constructHighlight(renderedNode);
|
|
211
|
+
|
|
212
|
+
this._addHighlight({ el: highlight });
|
|
213
|
+
}
|
|
214
|
+
|
|
83
215
|
_flush() {
|
|
84
216
|
let entry, i;
|
|
85
217
|
for (i = 0; i < this.queue.length; i++) {
|
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
@class ProfileNode
|
|
5
5
|
**/
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
const { get, guidFor } = Ember;
|
|
9
|
-
|
|
6
|
+
import { get } from '../utils/ember/object';
|
|
7
|
+
import { guidFor } from '../utils/ember/object/internals';
|
|
10
8
|
const ProfileNode = function (start, payload, parent, now) {
|
|
11
9
|
let name;
|
|
12
10
|
this.start = start;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { typeOf } from '../utils/type-check';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const { equal, or } = computed;
|
|
3
|
+
import { A } from '../utils/ember/array';
|
|
4
|
+
import EmberObject, { computed } from '../utils/ember/object';
|
|
5
|
+
import { equal, or } from '../utils/ember/object/computed';
|
|
7
6
|
|
|
8
7
|
const dateComputed = function () {
|
|
9
8
|
return computed({
|
|
@@ -9,36 +9,32 @@ import {
|
|
|
9
9
|
} from 'ember-debug/utils/type-check';
|
|
10
10
|
import { compareVersion } from 'ember-debug/utils/version';
|
|
11
11
|
import { typeOf } from './utils/type-check';
|
|
12
|
+
|
|
12
13
|
import Ember from './utils/ember';
|
|
14
|
+
import MutableArray from './utils/ember/array/mutable';
|
|
15
|
+
import ArrayProxy from './utils/ember/array/proxy';
|
|
16
|
+
import Component from './utils/ember/component';
|
|
17
|
+
import { inspect as emberInspect } from './utils/ember/debug';
|
|
18
|
+
import EmberObject, { computed, get, set } from './utils/ember/object';
|
|
19
|
+
import { oneWay } from './utils/ember/object/computed';
|
|
20
|
+
import Observable from './utils/ember/object/observable';
|
|
21
|
+
import Evented from './utils/ember/object/evented';
|
|
22
|
+
import { cacheFor, guidFor } from './utils/ember/object/internals';
|
|
23
|
+
import PromiseProxyMixin from './utils/ember/object/promise-proxy-mixin';
|
|
24
|
+
import { _backburner, join } from './utils/ember/runloop';
|
|
25
|
+
import { isNone } from './utils/ember/utils';
|
|
13
26
|
|
|
14
27
|
const {
|
|
15
|
-
Object: EmberObject,
|
|
16
|
-
inspect: emberInspect,
|
|
17
28
|
meta: emberMeta,
|
|
18
|
-
computed,
|
|
19
|
-
get,
|
|
20
|
-
set,
|
|
21
|
-
guidFor,
|
|
22
|
-
isNone,
|
|
23
|
-
cacheFor,
|
|
24
29
|
VERSION,
|
|
25
|
-
run,
|
|
26
30
|
ActionHandler,
|
|
27
|
-
ArrayProxy,
|
|
28
|
-
Component,
|
|
29
31
|
ControllerMixin,
|
|
30
32
|
CoreObject,
|
|
31
|
-
Evented,
|
|
32
|
-
MutableArray,
|
|
33
33
|
MutableEnumerable,
|
|
34
34
|
NativeArray,
|
|
35
35
|
ObjectProxy,
|
|
36
|
-
Observable,
|
|
37
|
-
PromiseProxyMixin,
|
|
38
36
|
TargetActionSupport,
|
|
39
37
|
} = Ember;
|
|
40
|
-
const { oneWay } = computed;
|
|
41
|
-
const { backburner, join } = run;
|
|
42
38
|
|
|
43
39
|
const GlimmerComponent = (() => {
|
|
44
40
|
try {
|
|
@@ -343,7 +339,7 @@ export default EmberObject.extend(PortMixin, {
|
|
|
343
339
|
init() {
|
|
344
340
|
this._super();
|
|
345
341
|
this.set('sentObjects', {});
|
|
346
|
-
|
|
342
|
+
_backburner.on('end', bound(this, this.updateCurrentObject));
|
|
347
343
|
},
|
|
348
344
|
|
|
349
345
|
willDestroy() {
|
|
@@ -351,7 +347,7 @@ export default EmberObject.extend(PortMixin, {
|
|
|
351
347
|
for (let objectId in this.sentObjects) {
|
|
352
348
|
this.releaseObject(objectId);
|
|
353
349
|
}
|
|
354
|
-
|
|
350
|
+
_backburner.off('end', bound(this, this.updateCurrentObject));
|
|
355
351
|
},
|
|
356
352
|
|
|
357
353
|
sentObjects: {},
|
package/ember_debug/port.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import EmberObject, { computed } from './utils/ember/object';
|
|
2
|
+
import { or, readOnly } from './utils/ember/object/computed';
|
|
3
|
+
import Evented from './utils/ember/object/evented';
|
|
4
|
+
import { guidFor } from './utils/ember/object/internals';
|
|
5
|
+
import { run } from './utils/ember/runloop';
|
|
4
6
|
|
|
5
|
-
export default EmberObject.extend(
|
|
7
|
+
export default EmberObject.extend(Evented, {
|
|
6
8
|
adapter: readOnly('namespace.adapter'),
|
|
7
9
|
applicationId: readOnly('namespace.applicationId'),
|
|
8
10
|
applicationName: or(
|
|
@@ -19,7 +21,7 @@ export default EmberObject.extend(Ember.Evented, {
|
|
|
19
21
|
* @type {String}
|
|
20
22
|
*/
|
|
21
23
|
uniqueId: computed('namespace._application', function () {
|
|
22
|
-
return
|
|
24
|
+
return guidFor(this.get('namespace._application'));
|
|
23
25
|
}),
|
|
24
26
|
|
|
25
27
|
init() {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// eslint-disable-next-line ember/no-mixins
|
|
2
2
|
import PortMixin from 'ember-debug/mixins/port-mixin';
|
|
3
3
|
import PromiseAssembler from 'ember-debug/libs/promise-assembler';
|
|
4
|
-
import Ember from './utils/ember';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { A } from './utils/ember/array';
|
|
6
|
+
import EmberObject, { computed } from './utils/ember/object';
|
|
7
|
+
import { readOnly } from './utils/ember/object/computed';
|
|
8
|
+
import { debounce } from './utils/ember/runloop';
|
|
9
|
+
import RSVP from './utils/rsvp';
|
|
8
10
|
|
|
9
11
|
export default EmberObject.extend(PortMixin, {
|
|
10
12
|
namespace: null,
|
|
@@ -15,15 +17,14 @@ export default EmberObject.extend(PortMixin, {
|
|
|
15
17
|
|
|
16
18
|
// created on init
|
|
17
19
|
promiseAssembler: null,
|
|
18
|
-
|
|
19
|
-
releaseMethods:
|
|
20
|
-
return A();
|
|
21
|
-
}),
|
|
20
|
+
updatedPromises: null,
|
|
21
|
+
releaseMethods: null,
|
|
22
22
|
|
|
23
23
|
init() {
|
|
24
24
|
this._super();
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
25
|
+
this.promiseAssembler = PromiseAssembler.create();
|
|
26
|
+
this.updatedPromises = A();
|
|
27
|
+
this.releaseMethods = A();
|
|
27
28
|
this.setInstrumentWithStack();
|
|
28
29
|
this.sendInstrumentWithStack();
|
|
29
30
|
this.promiseAssembler.start();
|
|
@@ -36,7 +37,7 @@ export default EmberObject.extend(PortMixin, {
|
|
|
36
37
|
if (this.promiseAssembler) {
|
|
37
38
|
this.promiseAssembler.destroy();
|
|
38
39
|
}
|
|
39
|
-
this.
|
|
40
|
+
this.promiseAssembler = null;
|
|
40
41
|
this._super();
|
|
41
42
|
},
|
|
42
43
|
|
|
@@ -109,7 +110,7 @@ export default EmberObject.extend(PortMixin, {
|
|
|
109
110
|
this.releaseMethods.forEach((fn) => {
|
|
110
111
|
fn();
|
|
111
112
|
});
|
|
112
|
-
this.
|
|
113
|
+
this.releaseMethods.clear();
|
|
113
114
|
},
|
|
114
115
|
|
|
115
116
|
getAndObservePromises() {
|
|
@@ -128,10 +129,6 @@ export default EmberObject.extend(PortMixin, {
|
|
|
128
129
|
this.promisesUpdated(this.promiseAssembler.find());
|
|
129
130
|
},
|
|
130
131
|
|
|
131
|
-
updatedPromises: computed(function () {
|
|
132
|
-
return A();
|
|
133
|
-
}),
|
|
134
|
-
|
|
135
132
|
promisesUpdated(uniquePromises) {
|
|
136
133
|
if (!uniquePromises) {
|
|
137
134
|
uniquePromises = A();
|
|
@@ -152,13 +149,13 @@ export default EmberObject.extend(PortMixin, {
|
|
|
152
149
|
|
|
153
150
|
promiseUpdated(event) {
|
|
154
151
|
this.updatedPromises.pushObject(event.promise);
|
|
155
|
-
|
|
152
|
+
debounce(this, 'promisesUpdated', this.delay);
|
|
156
153
|
},
|
|
157
154
|
|
|
158
155
|
promiseChained(event) {
|
|
159
156
|
this.updatedPromises.pushObject(event.promise);
|
|
160
157
|
this.updatedPromises.pushObject(event.child);
|
|
161
|
-
|
|
158
|
+
debounce(this, 'promisesUpdated', this.delay);
|
|
162
159
|
},
|
|
163
160
|
|
|
164
161
|
serializeArray(promises) {
|
|
@@ -204,6 +201,8 @@ export default EmberObject.extend(PortMixin, {
|
|
|
204
201
|
inspected.type === 'type-ember-object' ||
|
|
205
202
|
inspected.type === 'type-array'
|
|
206
203
|
) {
|
|
204
|
+
console.count('inspectValue');
|
|
205
|
+
|
|
207
206
|
inspected.objectId = objectInspector.retainObject(promise.get(key));
|
|
208
207
|
this.releaseMethods.pushObject(function () {
|
|
209
208
|
objectInspector.releaseObject(inspected.objectId);
|