|
| 1 | + |
| 2 | +// required for inspector |
| 3 | +import { isTesting } from './lib/testing'; |
| 4 | +import { _backburner, cancel, debounce, join, later, scheduleOnce } from '@ember/runloop'; |
| 5 | +import { cacheFor, guidFor } from '@ember/object/internals'; |
| 6 | +import { default as MutableArray } from '@ember/array/mutable'; |
| 7 | +import { default as Namespace } from '@ember/application/namespace'; |
| 8 | +import { default as MutableEnumerable } from'@ember/enumerable/mutable'; |
| 9 | +import { NativeArray } from '@ember/array'; |
| 10 | +import { ControllerMixin } from '@ember/controller'; |
| 11 | +import { default as CoreObject } from '@ember/object/core'; |
| 12 | +import { default as Application } from '@ember/application'; |
| 13 | +import { default as EmberComponent } from '@ember/component'; |
| 14 | +import { default as Observable } from '@ember/object/observable'; |
| 15 | +import { default as Evented } from '@ember/object/evented'; |
| 16 | +import { default as PromiseProxyMixin } from '@ember/object/promise-proxy-mixin'; |
| 17 | +import { default as EmberObject } from '@ember/object'; |
| 18 | +import { default as VERSION } from 'ember/version'; |
| 19 | +import { ComputedProperty, isComputed, descriptorForProperty, descriptorForDecorator, tagForProperty } from '@ember/-internals/metal'; |
| 20 | +import { isMandatorySetter } from '@ember/-internals/utils' |
| 21 | +import { meta } from '@ember/-internals/meta'; |
| 22 | +import { TargetActionSupport } from '@ember/-internals/runtime'; |
| 23 | +import { |
| 24 | + ViewStateSupport, |
| 25 | + ViewMixin, |
| 26 | + ActionSupport, |
| 27 | + ClassNamesSupport, |
| 28 | + ChildViewsSupport, |
| 29 | + CoreView |
| 30 | +} from '@ember/-internals/views'; |
| 31 | +import { set, get } from '@ember/object'; |
| 32 | +import { isTrackedProperty } from '@ember/-internals/metal'; |
| 33 | +import { isCachedProperty } from '@ember/-internals/metal'; |
| 34 | +import { default as inspect } from './lib/inspect'; |
| 35 | +import { subscribe } from '../instrumentation'; |
| 36 | +import { default as captureRenderTree } from './lib/capture-render-tree'; |
| 37 | +import { registerHandler as registerDeprecationHandler } from './lib/deprecate'; |
| 38 | +import * as GlimmerValidator from '@glimmer/validator'; |
| 39 | +import * as GlimmerRuntime from '@glimmer/runtime'; |
| 40 | +import { getOwner } from '@ember/owner'; |
| 41 | +import RSVP from 'rsvp'; |
| 42 | + |
| 43 | +export function setupInspectorSupport() { |
| 44 | + if (typeof window !== 'undefined' && window.addEventListener) { |
| 45 | + window.addEventListener( |
| 46 | + 'ember-inspector-debug-request', |
| 47 | + () => { |
| 48 | + const event = new CustomEvent("ember-inspector-debug-response", { detail: { |
| 49 | + runloop: { |
| 50 | + _backburner, |
| 51 | + cancel, |
| 52 | + debounce, |
| 53 | + join, |
| 54 | + later, |
| 55 | + scheduleOnce, |
| 56 | + }, |
| 57 | + object: { |
| 58 | + cacheFor, |
| 59 | + guidFor, |
| 60 | + getOwner, |
| 61 | + set, |
| 62 | + get, |
| 63 | + meta |
| 64 | + }, |
| 65 | + debug: { |
| 66 | + isComputed, |
| 67 | + isTrackedProperty, |
| 68 | + isCachedProperty, |
| 69 | + descriptorForProperty, |
| 70 | + descriptorForDecorator, |
| 71 | + isMandatorySetter, |
| 72 | + meta, |
| 73 | + captureRenderTree, |
| 74 | + isTesting, |
| 75 | + inspect, |
| 76 | + registerDeprecationHandler, |
| 77 | + tagForProperty, |
| 78 | + ComputedProperty, |
| 79 | + }, |
| 80 | + classes: { |
| 81 | + EmberObject, |
| 82 | + MutableArray, |
| 83 | + Namespace, |
| 84 | + MutableEnumerable, |
| 85 | + NativeArray, |
| 86 | + TargetActionSupport, |
| 87 | + ControllerMixin, |
| 88 | + CoreObject, |
| 89 | + Application, |
| 90 | + EmberComponent, |
| 91 | + Observable, |
| 92 | + Evented, |
| 93 | + PromiseProxyMixin, |
| 94 | + }, |
| 95 | + VERSION, |
| 96 | + instrumentation: { |
| 97 | + subscribe |
| 98 | + }, |
| 99 | + Views: { |
| 100 | + ViewStateSupport, |
| 101 | + ViewMixin, |
| 102 | + ActionSupport, |
| 103 | + ClassNamesSupport, |
| 104 | + ChildViewsSupport, |
| 105 | + CoreView |
| 106 | + }, |
| 107 | + GlimmerValidator, |
| 108 | + GlimmerRuntime, |
| 109 | + RSVP |
| 110 | + } |
| 111 | + }); |
| 112 | + globalThis.dispatchEvent(event); |
| 113 | + }, |
| 114 | + false |
| 115 | + ); |
| 116 | + } |
| 117 | +} |
0 commit comments