ember-cli / ember-cli/ember-cli-htmlbars

TemplateFactory type incompatible with setComponentTemplate type from @types/ember__component

Offen
#787 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
77
Forks
65
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

With ember-cli-htmlbars 6.3.0 and latest version 4.0.22 of `@types/ember__component`, for this type of code...

```
import { hbs } from 'ember-cli-htmlbars';
import { setComponentTemplate } from '@ember/component';

export const Button = setComponentTemplate(
hbs`
{{yield}}`,
templateOnly(),
);
```

I am getting this type error:

```
Argument of type 'import("/[...]/node_modules/ember-cli-htmlbars/lib/index").TemplateFactory' is not assignable to parameter of type 'TemplateFactory'.
Property '__htmlbars_inline_precompile_template_factory' is missing in type 'import("/[...]/node_modules/ember-cli-htmlbars/lib/index").TemplateFactory' but required in type 'TemplateFactory'.ts(2345)
index.d.ts(14, 5): '__htmlbars_inline_precompile_template_factory' is declared here.
```

`@types/ember__component` is still defining `TemplateFactory` like this:

```
interface TemplateFactory {
__htmlbars_inline_precompile_template_factory: any;
}
```

But https://github.com/ember-cli/ember-cli-htmlbars/pull/764 removed that `__htmlbars_inline_precompile_template_factory` property (used as a way of type branding I guess?), so I am indeed wondering how this is supposed to work now? Maybe just working with Ember's native types?

/cc @chriskrycho

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.