-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Typescript: Improve @storybook/ui types #9820
Conversation
@tmeasday @shilman @kroeder @gaetanmaisse Would really love your input & review. |
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. Small q's
@@ -44,13 +44,11 @@ export interface Addon { | |||
disabled?: boolean; | |||
hidden?: boolean; | |||
} | |||
export interface Collection { | |||
[key: string]: Addon; | |||
export interface Collection<T = Addon> { |
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.
Maybe to rename? Because Collection makes more think to an array/list than to a map/dictionary
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.
It's exported. If we want to change the name, I'd like to do that in a separate PR.
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.
Great job!!!! 💯💯💯
Issue: in prep for #9210 I needed to clean up the code in lib/ui
What I did
I did a bunch of refactoring to make the lib/ui code simpler to reason about.
Functionality wise, there should be 0 change