-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provide debug utlities for inspector via event communication
- Loading branch information
Showing
5 changed files
with
137 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,47 @@ export { default as inspect } from './lib/inspect'; | |
export { isTesting, setTesting } from './lib/testing'; | ||
export { default as captureRenderTree } from './lib/capture-render-tree'; | ||
|
||
// required for inspector | ||
import { _backburner, cancel, debounce, join, later, scheduleOnce } from '@ember/runloop'; | ||
import { cacheFor, guidFor } from '@ember/object/internals'; | ||
import { default as MutableArray } from '@ember/array/mutable'; | ||
import { default as Namespace } from '@ember/application/namespace'; | ||
import { default as MutableEnumerable } from'@ember/enumerable/mutable'; | ||
import { NativeArray } from '@ember/array'; | ||
import { ControllerMixin } from '@ember/controller'; | ||
import { default as CoreObject } from '@ember/object/core'; | ||
import { default as Application } from '@ember/application'; | ||
import { default as EmberComponent } from '@ember/component'; | ||
import { default as Observable } from '@ember/object/observable'; | ||
import { default as Evented } from '@ember/object/evented'; | ||
import { default as PromiseProxyMixin } from '@ember/object/promise-proxy-mixin'; | ||
import { default as EmberObject } from '@ember/object'; | ||
import { default as VERSION } from 'ember/version'; | ||
import { ComputedProperty, isComputed, descriptorForProperty, descriptorForDecorator, tagForProperty } from '@ember/-internals/metal'; | ||
Check failure on line 32 in packages/@ember/debug/index.ts GitHub Actions / Linting
|
||
import { isMandatorySetter } from '@ember/-internals/utils' | ||
import { meta } from '@ember/-internals/meta'; | ||
import { TargetActionSupport } from '@ember/-internals/runtime'; | ||
import { | ||
ViewStateSupport, | ||
ViewMixin, | ||
ActionSupport, | ||
ClassNamesSupport, | ||
ChildViewsSupport, | ||
CoreView | ||
} from '@ember/-internals/views'; | ||
import { set, get } from '@ember/object'; | ||
import { isTrackedProperty } from '@ember/-internals/metal/lib/tracked'; | ||
import { isCachedProperty } from '@ember/-internals/metal/lib/cached'; | ||
import { default as inspect } from './lib/inspect'; | ||
import { subscribe } from '../instrumentation'; | ||
import { default as captureRenderTree } from './lib/capture-render-tree'; | ||
import { registerHandler as registerDeprecationHandler } from './lib/deprecate'; | ||
import * as GlimmerValidator from '@glimmer/validator'; | ||
import * as GlimmerRuntime from '@glimmer/runtime'; | ||
import { getOwner } from '@glimmer/owner'; | ||
import RSVP from 'rsvp'; | ||
|
||
|
||
export type DebugFunctionType = | ||
| 'assert' | ||
| 'info' | ||
|
@@ -342,6 +383,78 @@ if (DEBUG && !isTesting()) { | |
}, | ||
false | ||
); | ||
window.addEventListener( | ||
'ember-inspector-debug-request', | ||
() => { | ||
const event = new CustomEvent("ember-inspector-debug-response", { detail: { | ||
runloop: { | ||
_backburner, | ||
cancel, | ||
debounce, | ||
join, | ||
later, | ||
scheduleOnce, | ||
}, | ||
object: { | ||
cacheFor, | ||
guidFor, | ||
getOwner, | ||
set, | ||
get, | ||
meta | ||
}, | ||
debug: { | ||
isComputed, | ||
isTrackedProperty, | ||
isCachedProperty, | ||
descriptorForProperty, | ||
descriptorForDecorator, | ||
isMandatorySetter, | ||
meta, | ||
captureRenderTree, | ||
isTesting, | ||
inspect, | ||
registerDeprecationHandler, | ||
tagForProperty, | ||
ComputedProperty, | ||
infoForTag: GlimmerValidator.infoForTag | ||
Check failure on line 420 in packages/@ember/debug/index.ts GitHub Actions / Debug and Prebuilt (All Tests by Package + Canary Features)
Check failure on line 420 in packages/@ember/debug/index.ts GitHub Actions / Type Checking (current version)
|
||
}, | ||
classes: { | ||
EmberObject, | ||
MutableArray, | ||
Namespace, | ||
MutableEnumerable, | ||
NativeArray, | ||
TargetActionSupport, | ||
ControllerMixin, | ||
CoreObject, | ||
Application, | ||
EmberComponent, | ||
Observable, | ||
Evented, | ||
PromiseProxyMixin, | ||
}, | ||
VERSION, | ||
instrumentation: { | ||
subscribe | ||
}, | ||
Views: { | ||
ViewStateSupport, | ||
ViewMixin, | ||
ActionSupport, | ||
ClassNamesSupport, | ||
ChildViewsSupport, | ||
CoreView | ||
}, | ||
GlimmerValidator, | ||
GlimmerRuntime, | ||
RSVP | ||
} | ||
}); | ||
window.dispatchEvent(event); | ||
}, | ||
false | ||
); | ||
} | ||
} | ||
|
||
|