-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
[core] Replace storybook knobs for args #601
Conversation
|
||
const env = process.env.NODE_ENV || 'development'; | ||
/* eslint-disable */ | ||
const __DEV__ = env === 'development'; | ||
const __PROD__ = env === 'production'; | ||
const isDevelopment = env === 'development'; |
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.
DEV is already defined somewhere globally, typescript complains
@@ -1,3 +1,4 @@ | |||
// @ts-ignore |
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.
To find out why and remove
checkboxSelection: true, | ||
disableSelectionOnClick: false, | ||
disableMultipleColumnsSorting: false, | ||
sortingOrder: ['asc', 'desc', 'null' as SortDirection], |
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.
null is not displayed as a string, small trick here...
Thanks Tooppaaa it looks great. |
@dtassone What's the next step on this pull request? |
</div> | ||
); | ||
} | ||
export const Loading = Template.bind({}); |
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.
Could we wrap that to make it more understandable on what we do here?
Maybe
const getStoryTemplate = ()=> Template.bind({});
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 following is a storybook pattern:
export const Foo = Bar.bind({});
Foo.args = { ... }
We recommend everybody use this pattern if they are using Args stories, since we have some tooling in mind that will look for this pattern in static analysis...
It's actually ready, beside conflicts and my little comment... I originally thought that there was more work to do on controls but it seems ready |
I'll handle everything tonight / this weekend ! |
@dtassone everything should be up do date and with the same functionality as before. |
Storybook knobs are being shut down in favor of args.
https://storybook.js.org/docs/react/writing-stories/args
This is using react docgen behind the scene to generate the right controls and actions.
I tried to only change what was necessary to remove knobs without loosing any functionality in place.
While there's still work to do on this like
cleanup remaining defined actions
arrange stories to capitalize on args
Regarding performances, enabling reactDocgen only adds 0.3 secs