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

Typescript Support #967

Open
bakerac4 opened this issue Oct 27, 2022 · 6 comments
Open

Typescript Support #967

bakerac4 opened this issue Oct 27, 2022 · 6 comments

Comments

@bakerac4
Copy link

After talking with Dan on the typescript team, it seems that typing the current api for glint is impossible due to the api being passed around. and not taking the columns and rows on the table object itself.

I'd love such a major addon in the ember community to support typescript/glint, and am willing to contribute some time to help out on the typescript specifics. But such a refactor would require more in depth knowledge of the addon and the addons future direction than I have.

I wanted to create this issue to show that there are people very interested in having types for this addon that work in glint and hopefully gather community support.

https://discord.com/channels/480462759797063690/484421406659182603/1035195005364604958

@kpfefferle
Copy link
Member

@bakerac4 Trust me when I say there's support for this inside of Addepar as well. In fact, I may have something for us to look at sooner than you might expect (there may even be a branch on this repo with recent activity that you might find interesting).

I noticed your recent efforts in this direction in the glint-template-types project - thank you for that!

I'm curious: do you have use cases where interacting with the internal types of the ember-table api is needed in your templates? I personally might consider api to be internal/intimate workings of this addon and not something I'm regularly manipulating from my app. I'd be curious to understand when/why you feel that accessing the internal types of that interface would be necessary.

@bakerac4
Copy link
Author

@kpfefferle that sounds exciting!

I don't really need the interaction of the internal api in a consuming package. But I was trying to glint-ify my addon based on ember-table and in that addon I would need that.

In this file we add a few extra niceties such as different automatic loading indicators and a no results component.
https://github.com/Gavant/gavant-ember-table/blob/master/ember-table/src/components/ember-tbody-override/index.hbs

@kpfefferle
Copy link
Member

@bakerac4 I'm quickly settling on an approach I'm pretty happy with for the app I work on at Addepar. Once I review it with my own team to get some feedback, I look forward to getting your feedback - as well as anyone else using ember-table with glint!

Thanks for opening this issue to register your interest and kick off a place for others to chime in.

@kpfefferle
Copy link
Member

I just opened a PR to add the Glint types I've been using internally as a public experiment:

@kpfefferle
Copy link
Member

Addon-provided Glint template types have been released in version 5.0.1. They are considered experimental, may change at any time, and not subject to our semver commitment. Right now these types are limited to the documented public API and standard usage of Ember Table in app templates.

I've been using these types internally with one of our own apps with much success. We welcome any feedback as others try them out!

@kpfefferle
Copy link
Member

I'll leave this issue open for now as we'd like to also consider migrating the Ember Table internals to TS. This would increase our own confidence in the code while also making it easier for consuming apps to extend the Ember Table components and internals as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants