-
Notifications
You must be signed in to change notification settings - Fork 101
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
INSTUI-2878 Upgrade storybook to 6.1.18 #399
Conversation
|
||
module.exports = { | ||
stories: ['../stories.js'] | ||
} |
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 the new syntax, see https://storybook.js.org/blog/declarative-storybook-configuration/
@@ -48,54 +35,9 @@ addParameters({ | |||
name: 'instructure-ui', | |||
brandUrl: 'https://instructure.design', | |||
brandImage: | |||
'https://instructure.design/icons-bea652a7d0546b99c7cba9d3b4a538ee/favicon-32x32.png' | |||
'https://instructure.design/icons-bea652a7d0546b99c7cba9d3b4a538ee/favicon-32x32.png' // TODO this URL is broken | |||
}), | |||
showPanel: false, | |||
isFullscreen: false | |||
} | |||
}) |
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.
again, the new format, see https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#using-previewjs
* SOFTWARE. | ||
*/ | ||
|
||
import { storiesOf } from '@storybook/react' |
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.
Although storiesOf API is legacy https://github.com/storybookjs/storybook/blob/next/lib/core/docs/storiesOf.md they do not seem to offer a new API to programatically load lots of stories, see storybookjs/storybook#9828
'../../', | ||
true, | ||
/^.*\/src\/.*\.examples\.js$/, | ||
'lazy' |
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 was one of the things causing issues with Storybook 6. We were loading our modules lazily with a promise (this is some barely documented Webpack feature) that caused Storybook to throw errors saying "Error: Cannot add a story when not configuring ...". I've set this to 'sync', see stories.js
6a6fef2
to
6a73a9b
Compare
Somehow not all of our examples are shown with this new upgrade. |
if (!config.renderPage) { | ||
console.warn('A default is no longer provided for \`renderPage\`, you should supply it to the config instead') | ||
} | ||
|
||
if (!config.renderExample) { | ||
console.warn('A default is no longer provided for \`renderExample\`, you should supply it to the config instead') | ||
} |
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.
here they likely wanted to check the opposite (if (config.renderExample)
), see 3abd6ca#diff-f82b6242f20fe2b1c9d6cf5c3522ad1c9463b3a9d8bd703c307050df0f079007
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 work!
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.
Img is still throwing error: Warning: Failed prop type: Invalid prop `src` of type `object` supplied to `Img`, expected `string`. in Img (created by unboundStoryFn) in unboundStoryFn in ErrorBoundary
Also, there is a conflict in yarn.lock
hmm I fixed this in one place, then there must be other places where the |
…r in Billboard example
…not needed warning
…rybook story generation works
7e88040
to
8e13788
Compare
I solved the conflict and fixed all the errors that components were throwing |
Uprade storybook to the latest version, hopefully this will help with the Chromatic issues. Also removed some exotic code.