Skip to content

Commit

Permalink
no glimmer component
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Oct 14, 2024
1 parent ef36fbc commit 7d48456
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 37 deletions.
45 changes: 43 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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": {
Expand All @@ -373,4 +414,4 @@
"node": "16.20.0",
"pnpm": "8.10.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export default class DataDebug extends DebugPort {
return owner.resolveRegistration(name);
}


get objectInspector() {
return this.namespace?.objectInspector;
}
Expand Down
68 changes: 36 additions & 32 deletions packages/@ember/debug/ember-inspector-support/deprecation-debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 "..."
Expand Down
1 change: 1 addition & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 7d48456

Please sign in to comment.