Closed chriskrycho closed 9 months ago
If converting to TS, is there a setup that people are using in embroider addons? Would love an example. cc @NullVoxPopuli
My* TS v2 addons:
https://github.com/CrowdStrike/ember-aria/tree/main/ember-aria-utilities
probably others, I've lost track
Is there a consistent TS setup among them?
mostly, ya
I ran into the lack of page-title types when trying to use the new ember 5.1 ember-source types:
app/templates/application.hbs:1:3 - error TS7053: Unknown name 'page-title'. If this isn't a typo, you may be missing a registry entry for this value; see the Template Registry page in the Glint documentation for more details.
Element implicitly has an 'any' type because expression of type '"page-title"' can't be used to index type 'Globals'.
Property 'page-title' does not exist on type 'Globals'.
To fix, I added types to types/ember-page-title/index.d.ts
:
import { HelperLike } from '@glint/template';
export type PageTitle = abstract new <T>() => InstanceType<
HelperLike<{
Args: {
Positional: [value: T];
};
Return: '';
}>
>;
declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
'page-title': PageTitle;
}
}
@leepfrog any help in getting https://github.com/ember-cli/ember-page-title/pull/246 across the finish line is appreciated 👍🏼
@knownasilya opened up #256 that might help?
@NullVoxPopuli This should be fixed by https://github.com/ember-cli/ember-page-title/pull/275 ?
yup! thanks!
As part of Ember.js RFC #0800, this package needs to supply type definitions. Preferably, this would happen by converting to TS and generating from the source; as an alternative, it can publish ambient types (presumably starting with the ones on DefinitelyTyped).
All the members of the Typed Ember team are happy to advise on how to do this; feel free to reach out in #dev-typescript on Discord if you have questions!