ember-table
ember-table copied to clipboard
Typescript Support
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
@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.
@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
@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.
I just opened a PR to add the Glint types I've been using internally as a public experiment:
- https://github.com/Addepar/ember-table/pull/968
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!
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.