From 7d4845638ce04c3be6a8c864ec6a21f999e01f4f Mon Sep 17 00:00:00 2001 From: patrick Date: Mon, 14 Oct 2024 11:53:36 +0200 Subject: [PATCH] no glimmer component --- package.json | 45 +++++++++++- .../ember-inspector-support/data-debug.ts | 1 - .../deprecation-debug.ts | 68 ++++++++++--------- .../object-inspector.ts | 3 +- rollup.config.mjs | 1 + 5 files changed, 81 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 048369fc871..693ab69d733 100644 --- a/package.json +++ b/package.json @@ -236,6 +236,46 @@ "@ember/controller/index.js": "ember-source/@ember/controller/index.js", "@ember/debug/container-debug-adapter.js": "ember-source/@ember/debug/container-debug-adapter.js", "@ember/debug/data-adapter.js": "ember-source/@ember/debug/data-adapter.js", + "@ember/debug/ember-inspector-support/adapters/basic.js": "ember-source/@ember/debug/ember-inspector-support/adapters/basic.js", + "@ember/debug/ember-inspector-support/adapters/bookmarklet.js": "ember-source/@ember/debug/ember-inspector-support/adapters/bookmarklet.js", + "@ember/debug/ember-inspector-support/adapters/chrome.js": "ember-source/@ember/debug/ember-inspector-support/adapters/chrome.js", + "@ember/debug/ember-inspector-support/adapters/firefox.js": "ember-source/@ember/debug/ember-inspector-support/adapters/firefox.js", + "@ember/debug/ember-inspector-support/adapters/index.js": "ember-source/@ember/debug/ember-inspector-support/adapters/index.js", + "@ember/debug/ember-inspector-support/adapters/web-extension.js": "ember-source/@ember/debug/ember-inspector-support/adapters/web-extension.js", + "@ember/debug/ember-inspector-support/adapters/websocket.js": "ember-source/@ember/debug/ember-inspector-support/adapters/websocket.js", + "@ember/debug/ember-inspector-support/container-debug.js": "ember-source/@ember/debug/ember-inspector-support/container-debug.js", + "@ember/debug/ember-inspector-support/data-debug.js": "ember-source/@ember/debug/ember-inspector-support/data-debug.js", + "@ember/debug/ember-inspector-support/debug-port.js": "ember-source/@ember/debug/ember-inspector-support/debug-port.js", + "@ember/debug/ember-inspector-support/deprecation-debug.js": "ember-source/@ember/debug/ember-inspector-support/deprecation-debug.js", + "@ember/debug/ember-inspector-support/general-debug.js": "ember-source/@ember/debug/ember-inspector-support/general-debug.js", + "@ember/debug/ember-inspector-support/index.js": "ember-source/@ember/debug/ember-inspector-support/index.js", + "@ember/debug/ember-inspector-support/libs/capture-render-tree.js": "ember-source/@ember/debug/ember-inspector-support/libs/capture-render-tree.js", + "@ember/debug/ember-inspector-support/libs/promise-assembler.js": "ember-source/@ember/debug/ember-inspector-support/libs/promise-assembler.js", + "@ember/debug/ember-inspector-support/libs/render-tree.js": "ember-source/@ember/debug/ember-inspector-support/libs/render-tree.js", + "@ember/debug/ember-inspector-support/libs/source-map.js": "ember-source/@ember/debug/ember-inspector-support/libs/source-map.js", + "@ember/debug/ember-inspector-support/libs/view-inspection.js": "ember-source/@ember/debug/ember-inspector-support/libs/view-inspection.js", + "@ember/debug/ember-inspector-support/main.js": "ember-source/@ember/debug/ember-inspector-support/main.js", + "@ember/debug/ember-inspector-support/models/profile-manager.js": "ember-source/@ember/debug/ember-inspector-support/models/profile-manager.js", + "@ember/debug/ember-inspector-support/models/profile-node.js": "ember-source/@ember/debug/ember-inspector-support/models/profile-node.js", + "@ember/debug/ember-inspector-support/models/promise.js": "ember-source/@ember/debug/ember-inspector-support/models/promise.js", + "@ember/debug/ember-inspector-support/object-inspector.js": "ember-source/@ember/debug/ember-inspector-support/object-inspector.js", + "@ember/debug/ember-inspector-support/port.js": "ember-source/@ember/debug/ember-inspector-support/port.js", + "@ember/debug/ember-inspector-support/promise-debug.js": "ember-source/@ember/debug/ember-inspector-support/promise-debug.js", + "@ember/debug/ember-inspector-support/render-debug.js": "ember-source/@ember/debug/ember-inspector-support/render-debug.js", + "@ember/debug/ember-inspector-support/route-debug.js": "ember-source/@ember/debug/ember-inspector-support/route-debug.js", + "@ember/debug/ember-inspector-support/services/session.js": "ember-source/@ember/debug/ember-inspector-support/services/session.js", + "@ember/debug/ember-inspector-support/utils/base-object.js": "ember-source/@ember/debug/ember-inspector-support/utils/base-object.js", + "@ember/debug/ember-inspector-support/utils/bound-method.js": "ember-source/@ember/debug/ember-inspector-support/utils/bound-method.js", + "@ember/debug/ember-inspector-support/utils/classify.js": "ember-source/@ember/debug/ember-inspector-support/utils/classify.js", + "@ember/debug/ember-inspector-support/utils/dasherize.js": "ember-source/@ember/debug/ember-inspector-support/utils/dasherize.js", + "@ember/debug/ember-inspector-support/utils/ember-object-names.js": "ember-source/@ember/debug/ember-inspector-support/utils/ember-object-names.js", + "@ember/debug/ember-inspector-support/utils/ember/object/internals.js": "ember-source/@ember/debug/ember-inspector-support/utils/ember/object/internals.js", + "@ember/debug/ember-inspector-support/utils/evented.js": "ember-source/@ember/debug/ember-inspector-support/utils/evented.js", + "@ember/debug/ember-inspector-support/utils/get-object-name.js": "ember-source/@ember/debug/ember-inspector-support/utils/get-object-name.js", + "@ember/debug/ember-inspector-support/utils/name-functions.js": "ember-source/@ember/debug/ember-inspector-support/utils/name-functions.js", + "@ember/debug/ember-inspector-support/utils/on-ready.js": "ember-source/@ember/debug/ember-inspector-support/utils/on-ready.js", + "@ember/debug/ember-inspector-support/utils/type-check.js": "ember-source/@ember/debug/ember-inspector-support/utils/type-check.js", + "@ember/debug/ember-inspector-support/view-debug.js": "ember-source/@ember/debug/ember-inspector-support/view-debug.js", "@ember/debug/index.js": "ember-source/@ember/debug/index.js", "@ember/debug/lib/assert.js": "ember-source/@ember/debug/lib/assert.js", "@ember/debug/lib/capture-render-tree.js": "ember-source/@ember/debug/lib/capture-render-tree.js", @@ -356,7 +396,8 @@ "ember/version.js": "ember-source/ember/version.js", "route-recognizer/index.js": "ember-source/route-recognizer/index.js", "router_js/index.js": "ember-source/router_js/index.js", - "rsvp/index.js": "ember-source/rsvp/index.js" + "rsvp/index.js": "ember-source/rsvp/index.js", + "source-map-js/index.js": "ember-source/source-map-js/index.js" } }, "typesVersions": { @@ -373,4 +414,4 @@ "node": "16.20.0", "pnpm": "8.10.0" } -} +} \ No newline at end of file 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 "..." diff --git a/rollup.config.mjs b/rollup.config.mjs index dc8761a1d1f..1e981d2ce63 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -183,6 +183,7 @@ function rolledUpPackages() { export function exposedDependencies() { return { 'backburner.js': require.resolve('backburner.js/dist/es6/backburner.js'), + 'source-map-js': require.resolve('source-map-js'), rsvp: require.resolve('rsvp/lib/rsvp.js'), 'dag-map': require.resolve('dag-map/dag-map.js'), router_js: require.resolve('router_js/dist/modules/index.js'),