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

[Quest] Provide TS and Glint types #425

Open
50 of 53 tasks
Windvis opened this issue Sep 12, 2023 · 1 comment
Open
50 of 53 tasks

[Quest] Provide TS and Glint types #425

Windvis opened this issue Sep 12, 2023 · 1 comment
Labels
enhancement Used when the PR adds a new feature or enhancement.

Comments

@Windvis
Copy link
Contributor

Windvis commented Sep 12, 2023

Official support for this in Ember is starting to get better and better so it would be nice if we can support it as a first-class citizen as well.

Some options:

  • keep writing js and write .d.ts files ourselves
  • keep writing js and use js doc + a build step to extract the d.ts files
  • convert to typescript and build the d.ts files that way

I think converting to .gts/.ts makes the most sense.

We might need to use this tool to strip some reference comments when publishing, since those cause issues in consuming apps.

Files we need to convert:

Components
  • <AuAccordion>
  • <AuAlert>
  • <AuApp>
  • <AuBadge>
  • <AuBodyContainer>
  • <AuBrand>
  • <AuButtonGroup>
  • <AuButton>
  • <AuCard>
  • <AuCheckboxGroup>
  • <AuCheckbox>
  • <AuContentHeader>
  • <AuContent>
  • <AuDataTable> ? This one might be tricky since it extends an addon
  • <AuDateInput>
  • <AuDatePicker>
  • <AuDropdown> (requires ember-focus-trap types) We have local types for that now
  • <AuFieldset>
  • <AuFileCard>
  • <AuFileUpload>
  • <AuFormRow>
  • <AuHeading>
  • <AuHelpText>
  • <AuHr>
  • <AuIcon>
  • <AuInput>
  • <AuLabel>
  • <AuLinkExternal>
  • <AuLink>
  • <AuList>
  • <AuLoader>
  • <AuMainContainer>
  • <AuMainFooter>
  • <AuMainHeader>
  • <AuModalContainer>
  • <AuModal> (requires ember-focus-trap types) We have local types for that now
  • <AuNavigationLink>
  • <AuPanel>
  • <AuPill>
  • <AuRadioGroup>
  • <AuRadio>
  • <AuTable>
  • <AuTabs>
  • <AuTextarea>
  • <AuTimePicker>
  • <AuToaster>
  • <AuToggleSwitch>
  • <AuToolbar>
Helpers (Done)
  • {{link-to-models}} (private, but we still need types internally)
Modifiers (Done)
  • {{au-date-input}}
  • {{au-inputmask}}
  • {{floating-ui}} (private, but we still need types internally)
Services

Conversion guide

Reading the Glint documentation is a good place to get familiar with everything.

Components

  1. Choose a component that has no (untyped) dependencies
  2. Change the extension to .gts
  3. Add glint types
  4. Convert the test file to .gts
  5. Add an entry to the template-registry.ts file, this allows glint to type check the loose-mode version
  6. Add a test to the loose-mode-test.ts file. This verifies that the component is registered in the template registry.
  7. run npm run lint:types to validate the types

Helpers & Modifiers

  1. Choose a file that has no (untyped) dependencies
  2. Change the extension to .ts
  3. Add glint types
  4. Convert the test file to .gts
  5. Add an entry to the template-registry.ts file (if the helper isn't private), this allows glint to type check the loose-mode version
  6. Add a test to the loose-mode-test.ts file (if the helper isn't private). This verifies that the helper/modifier is registered in the template registry.
  7. run npm run lint:types to validate the types

Services

  1. Choose a file that has no (untyped) dependencies
  2. Change the extension to .ts
  3. Add types
  4. Convert the test file to .ts
  5. run npm run lint:types to validate the types
@Windvis Windvis added the enhancement Used when the PR adds a new feature or enhancement. label Sep 12, 2023
@Windvis Windvis changed the title Provide TS and Glint types [Quest] Provide TS and Glint types Feb 2, 2024
@Windvis
Copy link
Contributor Author

Windvis commented Jul 10, 2024

I think we should probably just inline the ember-data-table components here, and convert them to .gts. The way we're extending the base addon components is a bad practise anyways, and this will give us more control. It would also allow us to drop the dependency.

We should take a look at all the exposed data table components and deprecate the ones that we don't want to be used as a standalone thing. We can then remove the app-reexports in the next major.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Used when the PR adds a new feature or enhancement.
Projects
None yet
Development

No branches or pull requests

1 participant