Skip to content
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

Merged
merged 26 commits into from
Feb 13, 2020
Merged

Typescript: Improve @storybook/ui types #9820

merged 26 commits into from
Feb 13, 2020

Conversation

ndelangen
Copy link
Member

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

@ndelangen ndelangen added ui maintenance User-facing maintenance tasks labels Feb 11, 2020
@ndelangen ndelangen added this to the 6.0.0 milestone Feb 11, 2020
@ndelangen ndelangen self-assigned this Feb 11, 2020
@ndelangen ndelangen requested a review from alterx as a code owner February 11, 2020 23:59
@ndelangen
Copy link
Member Author

@tmeasday @shilman @kroeder @gaetanmaisse

Would really love your input & review.

Copy link
Member

@shilman shilman left a 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

lib/ui/src/containers/sidebar.tsx Outdated Show resolved Hide resolved
lib/ui/src/containers/sidebar.tsx Outdated Show resolved Hide resolved
addons/storysource/src/StoryPanel.tsx Show resolved Hide resolved
lib/api/src/lib/stories.ts Outdated Show resolved Hide resolved
@@ -44,13 +44,11 @@ export interface Addon {
disabled?: boolean;
hidden?: boolean;
}
export interface Collection {
[key: string]: Addon;
export interface Collection<T = Addon> {
Copy link
Member

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

Copy link
Member Author

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.

lib/api/src/modules/addons.ts Outdated Show resolved Hide resolved
lib/ui/src/components/layout/desktop.stories.tsx Outdated Show resolved Hide resolved
lib/ui/src/components/sidebar/treeview/utils.ts Outdated Show resolved Hide resolved
lib/ui/src/components/sidebar/treeview/utils.ts Outdated Show resolved Hide resolved
lib/ui/src/containers/preview.tsx Outdated Show resolved Hide resolved
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!!!! 💯💯💯

@shilman shilman changed the title Core/ui cleanup Typescript: Migrate @storybook/ui Feb 13, 2020
@shilman shilman changed the title Typescript: Migrate @storybook/ui Typescript: Improve @storybook/ui types Feb 13, 2020
@shilman shilman merged commit f7fdd76 into next Feb 13, 2020
@shilman shilman deleted the core/ui-cleanup branch February 13, 2020 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance User-facing maintenance tasks ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants