-
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
Require routing param for controlled pagination #2400
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
220e625
to
b081bfa
Compare
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.
Looks good! Just a couple nit comments.
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.
Looks good overall. Clearer type abstractions! Aside from the warning I would also update the Component API section stating when route/model/models
is required.
Would this change also apply to replace
or only relevant to route/model/models
?
How to we communicate this required-if behavior to the user in the docs? Is what we have enough?
I believe the warning and flagging this in the component API section is the best we can do for now
The discriminated union types seem to work in TS not with Glint. (IE, if I try to instantiate a pagination component with @onPageChange but omit routing params, I get no TS errors, but if I try to create an object with the same type in the component file, I get the expected errors.
I've been running into this as well. I don't have a solution at the moment, hopefully the documentation will help.
I don't believe that providing the replace argument should be required in any scenario. It should always be optional. |
b081bfa
to
4f2cf29
Compare
📌 Summary
If merged, this PR will require that consumers of our pagination components (
Hds::Pagination::Compact
&Hds::Pagination::Numbered
) provide at least 1 routing argument(
@model
,@models
, or@route
) when routing is controlled externally.🛠️ Detailed description
Questions
required-if
behavior to the user in the docs? Is what we have enough?@onPageChange
but omit routing params, I get no TS errors, but if I try to create an object with the same type in the component file, I get the expected errors.🔗 External links
Jira ticket: HDS-3439
👀 Component checklist
💬 Please consider using conventional comments when reviewing this PR.