TemplateFactory type incompatible with setComponentTemplate type from @types/ember__component
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, typescript
- Domain
- tooling
Research direction
Start with the provided TypeScript example and inspect the TemplateFactory declarations in ember-cli-htmlbars and @types/ember__component, including the definition referenced by index.d.ts. Review ember-cli-htmlbars PR 764 for the branding-property change, then verify that the example type-checks with compatible declarations.
Written by the indexing model from the issue text.
Description
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`
<button>{{yield}}</button>`,
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
- Dominant language
- JavaScript
- Stars
- 77
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ember-cli/ember-cli-htmlbars
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
ember-cli/ember-cli-htmlbars#792 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
ember-cli/ember-cli-htmlbars#781 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
ember-cli/ember-cli-htmlbars#779 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ember-cli/ember-cli-htmlbars#774 · 2 comments ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 30/100
ember-cli/ember-cli-htmlbars#753 · 1 comment · 1 reaction ·
All issues in ember-cli/ember-cli-htmlbars
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
Browser Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
getsentry/sentry-javascript#24577 · 1 comment ·
-
curation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
amponce/archive-movie-browser#186 ·
-
light
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
aemdemos/patients-stryker#253 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
clerk/javascript#9852 ·