From 235ab993fee7cf7a6e8a3de0985b01e275f4b0cb Mon Sep 17 00:00:00 2001 From: patrick Date: Mon, 14 Oct 2024 11:53:36 +0200 Subject: [PATCH] no glimmer component --- .../ember-inspector-support/data-debug.ts | 1 - .../deprecation-debug.ts | 68 ++++++++++--------- .../object-inspector.ts | 3 +- 3 files changed, 37 insertions(+), 35 deletions(-) diff --git a/packages/@ember/debug/ember-inspector-support/data-debug.ts b/packages/@ember/debug/ember-inspector-support/data-debug.ts index 1a9d9723022..dcf56dd49a0 100644 --- a/packages/@ember/debug/ember-inspector-support/data-debug.ts +++ b/packages/@ember/debug/ember-inspector-support/data-debug.ts @@ -34,7 +34,6 @@ export default class DataDebug extends DebugPort { return owner.resolveRegistration(name); } - get objectInspector() { return this.namespace?.objectInspector; } diff --git a/packages/@ember/debug/ember-inspector-support/deprecation-debug.ts b/packages/@ember/debug/ember-inspector-support/deprecation-debug.ts index ab870704002..ab84576c3e2 100644 --- a/packages/@ember/debug/ember-inspector-support/deprecation-debug.ts +++ b/packages/@ember/debug/ember-inspector-support/deprecation-debug.ts @@ -4,14 +4,21 @@ import SourceMap from '@ember/debug/ember-inspector-support/libs/source-map'; import { registerDeprecationHandler } from '@ember/debug'; import { guidFor } from '@ember/debug/ember-inspector-support/utils/ember/object/internals'; import { cancel, debounce } from '@ember/runloop'; -import SourceMapSupport from '@ember/debug/ember-inspector-support/libs/source-map'; +import type SourceMapSupport from '@ember/debug/ember-inspector-support/libs/source-map'; export default class DeprecationDebug extends DebugPort { options: any; private _warned!: boolean; debounce: any; private _watching: any; - deprecationsToSend: { stackStr: string, message: string, url: string, count: number, id: string, sources: any[] }[]; + deprecationsToSend: { + stackStr: string; + message: string; + url: string; + count: number; + id: string; + sources: any[]; + }[]; private sourceMap!: SourceMapSupport; groupedDeprecations: any; deprecations: any; @@ -36,7 +43,10 @@ export default class DeprecationDebug extends DebugPort { this.sendPending(); }, - sendStackTraces(this: DeprecationDebug, message: { deprecation: { message: string; sources: { stackStr: string }[] } }) { + sendStackTraces( + this: DeprecationDebug, + message: { deprecation: { message: string; sources: { stackStr: string }[] } } + ) { let deprecation = message.deprecation; deprecation.sources.forEach((source) => { let stack = source.stackStr; @@ -97,26 +107,23 @@ export default class DeprecationDebug extends DebugPort { */ fetchSourceMap(stackStr: string) { if (this.emberCliConfig && this.emberCliConfig.environment === 'development') { - return this.sourceMap.map(stackStr).then( - (mapped: any[]) => { - if (mapped && mapped.length > 0) { - let source = mapped.find( - (item: any) => - item.source && - Boolean(item.source.match(new RegExp(this.emberCliConfig.modulePrefix))) - ); - - if (source) { - source.found = true; - } else { - source = mapped[0]; - source.found = false; - } - return source; + return this.sourceMap.map(stackStr).then((mapped: any[]) => { + if (mapped && mapped.length > 0) { + let source = mapped.find( + (item: any) => + item.source && + Boolean(item.source.match(new RegExp(this.emberCliConfig.modulePrefix))) + ); + + if (source) { + source.found = true; + } else { + source = mapped[0]; + source.found = false; } - }, - null - ); + return source; + } + }, null); } else { return Promise.resolve(null); } @@ -150,16 +157,13 @@ export default class DeprecationDebug extends DebugPort { let found = obj.sources.find((s: any) => s.stackStr === deprecation.stackStr); if (!found) { let stackStr = deprecation.stackStr; - promise = this.fetchSourceMap(stackStr).then( - (map) => { - obj.sources.push({ map, stackStr }); - if (map) { - obj.hasSourceMap = true; - } - return undefined; - }, - null - ); + promise = this.fetchSourceMap(stackStr).then((map) => { + obj.sources.push({ map, stackStr }); + if (map) { + obj.hasSourceMap = true; + } + return undefined; + }, null); } return promise.then(() => { delete obj.stackStr; diff --git a/packages/@ember/debug/ember-inspector-support/object-inspector.ts b/packages/@ember/debug/ember-inspector-support/object-inspector.ts index f9777d7f840..34cf9754df2 100644 --- a/packages/@ember/debug/ember-inspector-support/object-inspector.ts +++ b/packages/@ember/debug/ember-inspector-support/object-inspector.ts @@ -22,7 +22,6 @@ import type Mixin from '@ember/object/mixin'; import ObjectProxy from '@ember/object/proxy'; import ArrayProxy from '@ember/array/proxy'; import Component from '@ember/component'; -import GlimmerComponent from '@glimmer/component'; const keys = Object.keys; @@ -1228,7 +1227,7 @@ function getDebugInfo(object: any) { 'element', 'targetObject' ); - } else if (GlimmerComponent && object instanceof GlimmerComponent) { + } else if (object.constructor.name === 'GlimmerDebugComponent') { // These properties don't really exist on Glimmer Components, but // reading their values trigger a development mode assertion. The // more correct long term fix is to make getters lazy (shows "..."