-
Notifications
You must be signed in to change notification settings - Fork 153
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
chore: update Storybook version #4407
Conversation
Storybook staging is available at https://kiwicom-orbit-domi-update-storybook.surge.sh |
Size Change: 0 B Total Size: 445 kB ℹ️ View Unchanged
|
Deploying orbit with Cloudflare Pages
|
b3df8e7
to
458ad29
Compare
458ad29
to
9dd0820
Compare
d59655c
to
8fa9de6
Compare
0b656fe
to
8ef806d
Compare
99d7128
to
c06b2d7
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.
Just two suggestions. I feel some stories could be deleted or rewritten, but I agree with moving forward with this and tackling them later. So, for now, I'd just consider the two comments. Good work on this!
}; | ||
export const Default: Story = { | ||
render: () => { | ||
const [expandedSection, setExpandedSection] = React.useState("0X1"); |
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 triggering linter warnings
While I understand this is more Storybook's fault, we should avoid it. We have two options:
- We ignore this rule for stories files
- We transform this arrow function into a proper function:
render: function Render() {…
I don't particularly like any, but I think I debatably prefer the second.
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.
What arrow function do you mean? Was this fixed already?
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.
Yes, it's fixed. It used to be
render: () => {…}
but if it had hooks inside (like React.useState
) it would trigger that warning. Therefore, it needs to be
render: function Render() {…}
</Accordion> | ||
); | ||
}; | ||
export const Default: Story = { |
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.
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.
Agree, it indeed looks better. I will add it to control-less stories 👍
c06b2d7
to
670e48d
Compare
670e48d
to
9c1d46a
Compare
chore: update Storybook version
Update Storybook to latest version using the recommended
npx storybook@latest upgrade
. This guide also addedgetAbsolutePath
tomain.ts
, which is now part of standard SB installation in a monorepo. Also followed migration guide and did further changes, e.g. replaced@storybook/addons
with@storybook/manager-api
which is now required.Since
Source
doc blocks is now not to be used in stories, I recreated the source component withprism-react-renderer
with copy to clipboard functionality.chore: replace deprecated addon-knobs with addon-controls
@storybook/addon-knobs
is deprecated and being replaced with@storybook/addon-controls
. I followed migration guide and refactored all stories to useargs
. There were some cases when controlls weren't properly generated andargTypes
annotations needed to be added. This was case for e.g.select
orrange
.chore: replace deprecated addon-styling with addon-styling-webpack
@storybook/addon-styling
is also deprecated and replaced with two addons,@storybook/addon-styling-webpack
and@storybook/addon-themes
. I again followed migration guide to replace it.Rest of the commits is refactoring individual stories from CSF 2 to CSF 3 to add type validation to the props https://storybook.js.org/docs/api/csf#upgrading-from-csf-2-to-csf-3
Closes https://kiwicom.atlassian.net/browse/FEPLT-2048