-
Notifications
You must be signed in to change notification settings - Fork 9
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
Update GroupingChooser
with local model for transient UI state
#3420
base: develop
Are you sure you want to change the base?
Conversation
@@ -39,6 +40,126 @@ export interface GroupingChooserProps extends ButtonProps<GroupingChooserModel> | |||
styleButtonAsInput?: boolean; | |||
} | |||
|
|||
class GroupingChooserLocalModel extends HoistModel { |
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 is duplicated in the mobile component - didn't want to export this model but not sure how we can share it between the 2 packages ... should we just export and put a comment as "Not for application use"?
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.
you can put it in an /impl directory, and mark it as @internal. We do this all the time!
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 the tip, I knew we must have a pattern for this (and do this all the time in apps). Was hoping for something that would hide the class to app code, doesn't seem like there is any enforcement of @internal
. Looks like there are lots of proposals out there for this kind of thing, hopefully something makes it in eventually.
Looks like there is a way to strip these from d.ts output - https://www.typescriptlang.org/tsconfig#stripInternal - though since we are full typescript I don't think this does anything.
} | ||
|
||
const dimensionList = hoistCmp.factory<DimensionListProps>({ | ||
render({model, emptyText, impl}) { |
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.
same as above
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.
Suggesting to move this into a shared impl directory? Can't really do that unfortunately as it's child components use platform-specific components
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.
discussed with John -- there was a misunderstanding -- just mean that we should be passing the state down to the local components as dimensionList({imodel: impl})
. That way they have typed access to everything.
GroupingChooser
with local model for transient UI state
Fixes #3398
Hoist P/R Checklist
Pull request authors: Review and check off the below. Items that do not apply can also be
checked off to indicate they have been considered. If unclear if a step is relevant, please leave
unchecked and note in comments.
develop
branch as of last change.breaking-change
label + CHANGELOG if so.If your change is still a WIP, please use the "Create draft pull request" option in the split
button below to indicate it is not ready yet for a final review.