-
Notifications
You must be signed in to change notification settings - Fork 355
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
[EXPERIMENTAL] Provide addon-defined template types for Glint #968
Conversation
Should migrate to the new recommendation for exporting registry entries: typed-ember/glint#446 |
b421280
to
f60c9b0
Compare
f60c9b0
to
d7e607d
Compare
d7e607d
to
4821d84
Compare
2646171
to
8025e09
Compare
@@ -87,7 +87,7 @@ export default Component.extend({ | |||
sorts: defaultTo(() => []), | |||
|
|||
/** | |||
An optional sort. If not specified, defaults to <sortMultiple>, which | |||
An optional sort. If not specified, defaults to `<sortMultiple>`, which |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While typing documented arguments, I noticed that <sortMultiple>
is not rendered in the API docs without the backticks
/** | ||
An action that is sent when sorts is updated | ||
@argument onHeaderAction | ||
@type Action? | ||
*/ | ||
onHeaderAction: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This argument appears to be completely unused - I couldn't find reference to it anywhere else in the codebase (and the comment is obviously inaccurately copied from onUpdateSorts
below).
Released as 5.0.1-0 |
{{! Yielded items (rows, columns) will be typed according to the specified interfaces. }} | ||
{{! Cell values will be typed as a union of all defined row attribute types. }} | ||
</this.emberTableComponent> | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these docs 🙇
Amazing. |
Released as 5.0.1 |
This PR adds Glint template types for Ember Table to be published with the addon package. It enables consumers to define the shape of their table rows and columns and then enforces that the arguments passed in to Ember Table matches those types. All publicly documented arguments are also enforced to be the appropriate type. Yielded values (rows, columns, cell values) are yielded with respective types as well (with cell values yielded as a union of possible types).
These Glint types are isolated to the
/types/
directory in the repo, so they should not affect any of the functional addon code.Documentation - as added to the
README
EXPERIMENTAL: Using Ember Table with Glint
Ember Table provides experimental Glint types defined in the
/types/
directory.These types may change at any time and are NOT covered by Ember Table's semantic versioning.
They are intended to support standard documented usage of Ember Table and do not attempt to type the internals of the Ember Table addon.
If you are using Ember Table in a more advanced way (such as extending Ember Table components), you will still need to define your own types for those use cases.
To use the provided Ember Table types for Glint:
For example: