-
Notifications
You must be signed in to change notification settings - Fork 44
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
Fixing Error in Hds::Flyout
& Hds::Modal
subcomponents
#2511
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
8cdaf9d
to
e93a689
Compare
HdsFlyoutHeader
Hds::Flyout
& Hds::Modal
subcomponents
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.
Left a minor suggestion (feel free to ignore or edit as you see fit).
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.
the constructor changes look good. the signature adjustments in flyout/modal subcomponents (the deprecated body, description, footer, header) are not needed. the contextualClass
es are only used on the dialog-primitive
subcomponents
Co-authored-by: Cristiano Rastelli <[email protected]>
@@ -7,15 +7,16 @@ import Component from '@glimmer/component'; | |||
import { deprecate } from '@ember/debug'; | |||
|
|||
export interface HdsFlyoutBodySignature { | |||
Args: never; |
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.
[question] as a pattern, do we prefer to have Args
completely missing (I think I have done something like this, recently), or Args: never
like here? which one is more "correct™"?
/cc @alex-ju
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.
Or is it because below we need to have a HdsFlyoutBodySignature['Args']
?
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.
[question] as a pattern, do we prefer to have Args completely missing (I think I have done something like this, recently), or Args: never like here? which one is more "correct™"?
not having Args
is the established pattern. however, considering the error we encounter in HCP for this subcomponent, I don't see a way of avoiding never
.
we could use never
straight in the constructor, but we have this pattern of using the signature in constructors, so what we have in this PR feels more consistent.
constructor(owner: unknown, args: never) {
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.
not having Args is the established pattern
@alex-ju Good. So nothing to change on my side :)
however, considering the error we encounter in HCP for this subcomponent, I don't see a way of avoiding never.
@alex-ju @zamoore since this is a deviation from the pattern, should we add a comment above these Args: never
are not following the established pattern? (and potentially have also a link to this thread, for future reference)
`Hds::DialogPrimitive` | ||
- Fixed error in `Description` and `Body` subcomponents, by not passing the `args` argument from the constructor to `super` | ||
- Added missing arguments in `Arg` TypeScript signature object | ||
|
||
`Hds::Modal` | ||
- Fixed error in `Body` subcomponent, caused by not passing the `args` argument from the constructor to `super` | ||
- Added missing arguments in `Arg` TypeScript signature object |
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.
The changelog would need to be updated, as we're not making any changes to the DialogPrimitive
and there are no missing arguments anymore.
📌 Summary
Fixes an error in the deprecated
HdsDialogPrimitive::Header/Body/Description/Footer
components as well as theHds::Modal::Body
component. Passesargs
from constructor call tosuper
within constructor.🛠️ Detailed description
I discovered an error caused by the recent TS conversion. When we converted the
Hds::Flyout::Body
component, we incorrectly passed{}
as theargs
argument tosuper
in the constructor, when we should use the argument that is passed from the constructor. To make that clearer, here's an example:Code causing error:
Should be
🔗 External links
Slack discussion
💬 Please consider using conventional comments when reviewing this PR.