-
Notifications
You must be signed in to change notification settings - Fork 54
Conversation
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.
I believe these major bumps have been done in this PR: #3729
Work completed in #3729 |
I've re-opened this PR following @rhenshaw56 's revert #3736 ; I am trying to get the upgrade to Storybook 6.0 to work On This was necessary because Next Steps
|
…ators, remove use of notes addon
…stamp useful-links visually-hidden-text
There are some padding differences introduced in this upgrade. Link to issue describing the bug bbc/simorgh#7917 |
Migrating Storybook from v 5.3.19 to 6.X.X
Resolved issues:
Some minor stuff around:
manager.js
main.js
preview.js
structureaddParameters
frompreview.js
, migrated to the new methodstorybook.css
file to overwrite new padding being applied to the story<body>
tag1. Components aren't re-rendering when navigating around Storybook, or modifying knobs.
[FIXED ✅ ]
6.0.2
&6.0.21
(with or without forcing@storybook/core-events
resolutions).tl;dr: Fixed by migrating from
notes
todocs
and removing thestorybook-readme
package. Note that docs is far more 'sophisticated' than notes and is trying to do a lot of dynamic stuff to our readmes, that doesn't work very well. One for the backlogKnobs and path changes cause an error, and the component does not re-render.
Console error:
It turns out this is being caused by our use of
addon-notes
, which has been deprecated in v6 and replaced by addon-docsA bit of digging showed that we still had an old instance of
@storybook/logger
, which was erroring. This was being used by an old instance of@storybook/components
, which was being used by...storybook-readme: ^5.0.8
Completely nuking
addon-notes
&storybook-readme
has fixed the problem, now to migrate toaddon-docs
! Migration docs.2. Infinite spinner on-load.
[FIXED ✅ ]
6.0.21
tl;dr: This is no longer triggered. 6.0.21 can safely be loaded without an infinite spinner, and without forcing the
"@storybook/core-events": "6.0.2",
resolution.3. Components` required props are undefined
[FIXED ✅ ].
6.0.2
&6.0.21
(with or without forcing@storybook/core-events
resolutions).tl;dr: 'Args' are now the first argument passed into a story, which means our decorators (i.e. withServiceKnob) were not being interpreted correctly as component props. https://github.com/storybookjs/storybook/blob/master/MIGRATION.md#args-passed-as-first-argument-to-story.
There are two potential fixes for this:
Migrate from
to
Or add
passArgsFirst: false,
toconfig.js
(which is what I've done)before:
![Screenshot 2020-09-17 at 16 54 34](https://user-images.githubusercontent.com/9042672/93495879-84b81d00-f906-11ea-979a-3ef4bb237813.png)
after:
![Screenshot 2020-09-22 at 10 19 11](https://user-images.githubusercontent.com/9042672/93864689-29e34480-fcbd-11ea-97f1-6bd2b81ac8c9.png)
4.
|
is no longer a valid story hierarchy separator[FIXED ✅ ]
tl;dr: replaced
|
with/
We use this throughout. It needs to be replaced by
/
.Impact:
5. Arbitrary decorators, and those added after the first story now cause an error
[FIXED ✅ ]
6.0.21
tl;dr: removed any arbitrary
addDecorator
funcs in the middle of componentsi.e. https://github.com/bbc/psammead/blob/2de4871bc90c5be179594b6962ee36037d0f03ff/packages/components/psammead-media-player/src/index.stories.jsx#L130 Although our decoration of stories has tended to be pretty arbitrary, it seems like this component is the only one triggering these errors, so should be a straightforward fix.
Impact:
You cannot add a decorator after the first story for a kind.
Storybook won't renderFuture work:
Testing notes:
dependabot-storybook
branch locally within Psammeadnpm run storybook