Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ jobs:
- ember-lts-5.4
- ember-lts-5.8
- ember-lts-5.12
# - ember-release
# - ember-beta
# - ember-canary
- ember-release
- ember-beta
- ember-canary
- ember-default-no-prototype-extensions

steps:
Expand Down
8 changes: 7 additions & 1 deletion ember_debug/utils/ember.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { emberSafeRequire } from 'ember-debug/utils/ember/loader';
let Ember;

try {
Ember = requireModule('ember').default;
Ember = requireModule('ember/barrel').default;
} catch {
// pass through
}

try {
Ember = Ember || requireModule('ember').default;
} catch {
Ember = window.Ember;
}
Expand Down
5 changes: 4 additions & 1 deletion ember_debug/vendor/startup-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ var EMBER_VERSIONS_SUPPORTED = {{EMBER_VERSIONS_SUPPORTED}};

if (!Ember) {
try {
Ember = requireModule('ember')['default'];
Ember = requireModule('ember/barrel')['default'];
} catch {}
try {
Ember = Ember || requireModule('ember')['default'];
} catch {
Ember = window.Ember;
}
Expand Down
235 changes: 122 additions & 113 deletions tests/ember_debug/profile-manager-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import setupEmberDebugTest from '../helpers/setup-ember-debug-test';
import { run } from '@ember/runloop';
import Ember from 'ember-debug/utils/ember';
import { compareVersion } from 'ember-debug/utils/version';
import { setComponentTemplate } from '@ember/component';

const { VERSION } = Ember;

Expand All @@ -28,119 +29,123 @@ const getRounded = (value) => {
}
return Math.floor(data);
};
class OneRootGlimmer extends GlimmerComponent {
classNames = 'simple-component';
}

const mockedComponents = {
text: {
component: EmberComponent.extend({
tagName: '',
}),
template: hbs('text only', {
moduleName: 'my-app/templates/components/text.hbs',
}),
},
'text-glimmer': {
component: GlimmerComponent,
template: hbs('text only', {
moduleName: 'my-app/templates/components/text-glimmer.hbs',
}),
},
comment: {
component: EmberComponent.extend({
tagName: '',
}),
template: hbs('<!-- comment -->', {
moduleName: 'my-app/templates/components/comment.hbs',
}),
},
'comment-glimmer': {
component: GlimmerComponent,
template: hbs('<!-- comment -->', {
moduleName: 'my-app/templates/components/comment-glimmer.hbs',
}),
},
'one-root': {
component: EmberComponent.extend({
tagName: '',
}),
template: hbs('<div class="simple-component">one root</div>', {
moduleName: 'my-app/templates/components/one-root.hbs',
}),
},
'one-root-glimmer': {
component: OneRootGlimmer,
template: hbs('<div class={{this.classNames}}>one root</div>', {
moduleName: 'my-app/templates/components/one-root-glimmer.hbs',
}),
},
'two-root': {
component: EmberComponent.extend({
tagName: '',
}),
template: hbs(
'<div class="simple-component">one</div><div class="another-component">two</div>',
{ moduleName: 'my-app/templates/components/two-root.hbs' },
),
},
'two-root-glimmer': {
component: GlimmerComponent,
template: hbs(
'<div class="simple-component">one</div><div class="another-component">two</div>',
{ moduleName: 'my-app/templates/components/two-root-glimmer.hbs' },
),
},
'root-comment-root': {
component: EmberComponent.extend({
tagName: '',
}),
template: hbs(
'<div class="simple-component">one</div><!-- comment --><div class="another-component">two</div>',
{ moduleName: 'my-app/templates/components/root-comment-root.hbs' },
),
},
'root-comment-root-glimmer': {
component: GlimmerComponent,
template: hbs(
'<div class="simple-component">one</div><!-- comment --><div class="another-component">two</div>',
{
moduleName: 'my-app/templates/components/root-comment-root-glimmer.hbs',
},
),
},
'comment-root-comment': {
component: EmberComponent.extend({
tagName: '',
}),
template: hbs(
'<!-- comment 1 --><div class="simple-component">one</div><!-- comment 2 -->',
{ moduleName: 'my-app/templates/components/comment-root-comment.hbs' },
),
},
'comment-root-comment-glimmer': {
component: GlimmerComponent,
template: hbs(
'<!-- comment 1 --><div class="simple-component">one</div><!-- comment 2 -->',
{ moduleName: 'my-app/templates/components/comment-root-comment.hbs' },
),
},
'div-tag': {
component: EmberComponent.extend({
classNames: ['simple-component'],
}),
template: hbs('text in div', {
moduleName: 'my-app/templates/components/div-tag.hbs',
}),
},
'div-roots': {
component: EmberComponent.extend({
classNames: ['simple-component'],
}),
template: hbs('<div>one</div><div>two</div>', {
moduleName: 'my-app/templates/components/div-roots.hbs',
}),
},
const mockedComponents = () => {
class OneRootGlimmer extends GlimmerComponent {
classNames = 'simple-component';
}

return {
text: {
component: EmberComponent.extend({
tagName: '',
}),
template: hbs('text only', {
moduleName: 'my-app/templates/components/text.hbs',
}),
},
'text-glimmer': {
component: class extends GlimmerComponent {},
template: hbs('text only', {
moduleName: 'my-app/templates/components/text-glimmer.hbs',
}),
},
comment: {
component: EmberComponent.extend({
tagName: '',
}),
template: hbs('<!-- comment -->', {
moduleName: 'my-app/templates/components/comment.hbs',
}),
},
'comment-glimmer': {
component: class extends GlimmerComponent {},
template: hbs('<!-- comment -->', {
moduleName: 'my-app/templates/components/comment-glimmer.hbs',
}),
},
'one-root': {
component: EmberComponent.extend({
tagName: '',
}),
template: hbs('<div class="simple-component">one root</div>', {
moduleName: 'my-app/templates/components/one-root.hbs',
}),
},
'one-root-glimmer': {
component: OneRootGlimmer,
template: hbs('<div class={{this.classNames}}>one root</div>', {
moduleName: 'my-app/templates/components/one-root-glimmer.hbs',
}),
},
'two-root': {
component: EmberComponent.extend({
tagName: '',
}),
template: hbs(
'<div class="simple-component">one</div><div class="another-component">two</div>',
{ moduleName: 'my-app/templates/components/two-root.hbs' },
),
},
'two-root-glimmer': {
component: class extends GlimmerComponent {},
template: hbs(
'<div class="simple-component">one</div><div class="another-component">two</div>',
{ moduleName: 'my-app/templates/components/two-root-glimmer.hbs' },
),
},
'root-comment-root': {
component: EmberComponent.extend({
tagName: '',
}),
template: hbs(
'<div class="simple-component">one</div><!-- comment --><div class="another-component">two</div>',
{ moduleName: 'my-app/templates/components/root-comment-root.hbs' },
),
},
'root-comment-root-glimmer': {
component: class extends GlimmerComponent {},
template: hbs(
'<div class="simple-component">one</div><!-- comment --><div class="another-component">two</div>',
{
moduleName:
'my-app/templates/components/root-comment-root-glimmer.hbs',
},
),
},
'comment-root-comment': {
component: EmberComponent.extend({
tagName: '',
}),
template: hbs(
'<!-- comment 1 --><div class="simple-component">one</div><!-- comment 2 -->',
{ moduleName: 'my-app/templates/components/comment-root-comment.hbs' },
),
},
'comment-root-comment-glimmer': {
component: class extends GlimmerComponent {},
template: hbs(
'<!-- comment 1 --><div class="simple-component">one</div><!-- comment 2 -->',
{ moduleName: 'my-app/templates/components/comment-root-comment.hbs' },
),
},
'div-tag': {
component: EmberComponent.extend({
classNames: ['simple-component'],
}),
template: hbs('text in div', {
moduleName: 'my-app/templates/components/div-tag.hbs',
}),
},
'div-roots': {
component: EmberComponent.extend({
classNames: ['simple-component'],
}),
template: hbs('<div>one</div><div>two</div>', {
moduleName: 'my-app/templates/components/div-roots.hbs',
}),
},
};
};

const mockedRoutes = {
Expand Down Expand Up @@ -264,6 +269,10 @@ const constructComponents = (owner, componentsMap) => {
`template:components/${componentKey}`,
componentsMap[componentKey].template,
);
setComponentTemplate(
componentsMap[componentKey].template,
componentsMap[componentKey].component,
);
}
}
};
Expand Down Expand Up @@ -398,7 +407,7 @@ module('Ember Debug - profile manager component highlight', function (hooks) {
hooks.beforeEach(async function () {
EmberDebug.IGNORE_DEPRECATIONS = true;
constructBase(this.owner);
constructComponents(this.owner, mockedComponents);
constructComponents(this.owner, mockedComponents());
});

hooks.afterEach(function (assert) {
Expand Down
Loading