Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid unnecessary dependencies on @glimmer types #1304

Merged
merged 2 commits into from
Dec 21, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@ import {
importSync,
dependencySatisfies,
} from '@embroider/macros';
import type { InternalComponentManager } from '@glimmer/interfaces';

let getComponentManager: (
definition: object,
owner: object
) => InternalComponentManager | null;
let getComponentManager: (definition: object, owner: object) => unknown;

if (macroCondition(dependencySatisfies('ember-source', '>=3.27.0-alpha.1'))) {
let _getComponentManager =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
getContext,
} from './setup-context';
import settled from './settled';
import { hbs, TemplateFactory } from 'ember-cli-htmlbars';
import { hbs } from 'ember-cli-htmlbars';
import getRootElement from './dom/get-root-element';
import { Owner } from './build-owner';
import getTestMetadata from './test-metadata';
Expand All @@ -20,7 +20,6 @@ import isComponent from './-internal/is-component';
import { macroCondition, dependencySatisfies } from '@embroider/macros';
import { ComponentRenderMap, SetUsage } from './setup-context';
import { ensureSafeComponent } from '@embroider/util';
import type { ComponentInstance } from '@glimmer/interfaces';

const OUTLET_TEMPLATE = hbs`{{outlet}}`;
const EMPTY_TEMPLATE = hbs``;
Expand Down Expand Up @@ -102,7 +101,7 @@ export interface RenderOptions {
await render(hbs`<div class="container"></div>`);
*/
export function render(
templateOrComponent: TemplateFactory | ComponentInstance,
templateOrComponent: object,
options?: RenderOptions
): Promise<void> {
let context = getContext();
Expand Down
5 changes: 1 addition & 4 deletions type-tests/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,7 @@ expectTypeOf(currentURL).toEqualTypeOf<() => string>();

// Rendering Helpers
expectTypeOf(render).toMatchTypeOf<
(
templateOrComponent: TemplateFactory | ComponentInstance,
options?: { owner?: Owner }
) => Promise<void>
(templateOrComponent: object, options?: { owner?: Owner }) => Promise<void>
>();
expectTypeOf(rerender).toMatchTypeOf<() => Promise<void>>();
expectTypeOf(clearRender).toEqualTypeOf<() => Promise<void>>();
Expand Down