Skip to content

Commit caef86e

Browse files
authored
Merge pull request #1305 from dfreeman/render-any-object-v2
[backport] Avoid unnecessary dependencies on `@glimmer` types
2 parents e3f1cb8 + 20c6cf9 commit caef86e

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

addon-test-support/@ember/test-helpers/-internal/get-component-manager.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@ import {
44
importSync,
55
dependencySatisfies,
66
} from '@embroider/macros';
7-
import type { InternalComponentManager } from '@glimmer/interfaces';
87

9-
let getComponentManager: (
10-
definition: object,
11-
owner: object
12-
) => InternalComponentManager | null;
8+
let getComponentManager: (definition: object, owner: object) => unknown;
139

1410
if (macroCondition(dependencySatisfies('ember-source', '>=3.27.0-alpha.1'))) {
1511
let _getComponentManager =

addon-test-support/@ember/test-helpers/setup-rendering-context.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
} from './setup-context';
1111
import { Promise } from './-utils';
1212
import settled from './settled';
13-
import { hbs, TemplateFactory } from 'ember-cli-htmlbars';
13+
import { hbs } from 'ember-cli-htmlbars';
1414
import getRootElement from './dom/get-root-element';
1515
import { Owner } from './build-owner';
1616
import getTestMetadata from './test-metadata';
@@ -21,14 +21,13 @@ import isComponent from './-internal/is-component';
2121
import { macroCondition, dependencySatisfies } from '@embroider/macros';
2222
import { ComponentRenderMap, SetUsage } from './setup-context';
2323
import { ensureSafeComponent } from '@embroider/util';
24-
import type { ComponentInstance } from '@glimmer/interfaces';
2524

2625
const OUTLET_TEMPLATE = hbs`{{outlet}}`;
2726
const EMPTY_TEMPLATE = hbs``;
2827
const INVOKE_PROVIDED_COMPONENT = hbs`<this.ProvidedComponent />`;
2928

3029
export interface RenderingTestContext extends TestContext {
31-
render(template: TemplateFactory): Promise<void>;
30+
render(template: object): Promise<void>;
3231
clearRender(): Promise<void>;
3332

3433
element: Element | Document;
@@ -100,7 +99,7 @@ export interface RenderOptions {
10099
await render(hbs`<div class="container"></div>`);
101100
*/
102101
export function render(
103-
templateOrComponent: TemplateFactory | ComponentInstance,
102+
templateOrComponent: object,
104103
options?: RenderOptions
105104
): Promise<void> {
106105
let context = getContext();
@@ -298,7 +297,7 @@ export default function setupRenderingContext(
298297
.then(() => {
299298
let { owner } = context;
300299

301-
let renderDeprecationWrapper = function (template: TemplateFactory) {
300+
let renderDeprecationWrapper = function (template: object) {
302301
deprecate(
303302
'Using this.render has been deprecated, consider using `render` imported from `@ember/test-helpers`.',
304303
false,

type-tests/api.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,7 @@ expectTypeOf(currentURL).toEqualTypeOf<() => string>();
156156

157157
// Rendering Helpers
158158
expectTypeOf(render).toMatchTypeOf<
159-
(
160-
templateOrComponent: TemplateFactory | ComponentInstance,
161-
options?: { owner?: Owner }
162-
) => Promise<void>
159+
(templateOrComponent: object, options?: { owner?: Owner }) => Promise<void>
163160
>();
164161
expectTypeOf(clearRender).toEqualTypeOf<() => Promise<void>>();
165162

0 commit comments

Comments
 (0)