-
Notifications
You must be signed in to change notification settings - Fork 25
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
Upgrade Storybook to v6 #214
Conversation
f5b9384
to
d15f7b6
Compare
export * from '@storybook/addon-actions'; | ||
export * from '@storybook/addon-storysource'; |
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.
Storybook didn't render when both of these were exported. Probably not safe to export * from
multiple npm packages when some of the exports could have the same names.
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.
update: Added deprecations to inform users of the new export locations. also updated all existing stories in theforeman/foreman#7990
e7b76a5
to
ffb4237
Compare
@sharvit @johnpmitsch rebased and ready for review :) Will squash once acked |
const storyWeightA = kindParamsA.storyWeight || globalParamsA.storyWeight; | ||
const storyWeightB = kindParamsB.storyWeight || globalParamsB.storyWeight; | ||
const combined = storyWeightA - storyWeightB; | ||
if (combined) { |
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.
will evaluate to false if 0
// htmlWebpackPlugin is the first plugin in the array | ||
const htmlWebpackPlugin = config.plugins[0]; | ||
const htmlWebpackPlugin = config.plugins.find( | ||
p => p.constructor.name === 'HtmlWebpackPlugin' |
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.
After the upgrade it appears the order of config.plugins
changed, so I changed this to look for the correct name instead
The functionality appears to be working great! The code seems fine but I need to take a closer look at the webpack aspect of it as I'm not as familiar with the existing code there. Maybe @sharvit can review that part better. |
@sharvit can this be merged soon? |
f34918e
to
762c284
Compare
@jeremylenz commits look a little funky here, did something happen when rebasing? |
762c284
to
7e5721c
Compare
@johnpmitsch Re-rebased, hopefully it's better now |
@jeremylenz still working well 👍 |
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.
Thanks @jeremylenz 👍
I deployed those changes to npm
as 6.1.0-next-storybook-6-upgrade.0
and it works well together with theforeman/foreman#7990, see:
To install it, replace the version in the package.json
with ^6.1.0-next-storybook-6-upgrade.0
.
-
Please update the readme file according to the changes and the deprecations.
-
Please squash and finalize your commit message.
In your commit, describe the breaking changes and write a migration guide so it will be landed in the changelog (https://github.com/theforeman/foreman-js/blob/master/CHANGELOG.md) and in the release notes (https://github.com/theforeman/foreman-js/releases).
7e5721c
to
0a4f685
Compare
Thanks @sharvit, squashed and updated! |
- Do not merge until theforeman/foreman-js#214 is merged and @theforeman/stories@7.0.0 is published to npm
Thanks @jeremylenz
This format generated the following release notes:
Please format the commit accordingly. |
BREAKING CHANGE: @storybook/addon-knobs, @storybook/addon-actions, and @storybook/addon-storysource are no longer re-exported from @theforeman/stories. Going forward, import these items directly: e.g. `import { withKnobs } from @storybook/addon-knobs` instead of `import { withKnobs } from @theforeman/stories`. Deprecation error messages have been added where appropriate. BREAKING CHANGE: The Preview component has been renamed to Canvas. BREAKING CHANGE: The Props component has been renamed to ArgsTable. BREAKING CHANGE: Custom separators are no longer supported in story titles. Instead of `title: 'Components|DiffView'` you must write `title: 'Components/DiffView'`. BREAKING CHANGE: The storiesOf API is no longer supported. Please use Component Story Format or MDX instead.
0a4f685
to
7c458d0
Compare
@sharvit updated and formatted the commit message! |
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.
Thanks @jeremylenz
Published as v7.0.0, see https://github.com/theforeman/foreman-js/releases/tag/v7.0.0 |
Testing instructions are on the associated Foreman PR: theforeman/foreman#7990
Along with the upgrade to v6, this PR incorporates several Storybook improvements and addresses issues I had along the way:
main.js
API. This simplifies our configuration quite a bit.main.js
configuration, it appeared that some Webpack loaders were being run twice on the same files, particularly the@mdx-js/loader
. This manifested in an error messageUnexpected default export without title
for every story. The loaders were being run once frommain.js
and another time from our manual Webpack configuration inwebpack.config.rules.js
.index.js
we were doingexport * from
several@storybook/addon
packages. Once I removed them, the Storybook finally rendered.@theforeman/stories
, the stories files in Foreman must import them directly from@storybook/addon-knobs
etc. I added deprecation errors to inform the users. Also, I suppressed theimport/no-extraneous-dependencies
eslint rule for packages that are dependencies of@theforeman/stories
.storyWeight
parameter, which stopped working in v6. Thanks to the Storybook folks for the help on Component-level parameters not available in storySort storybookjs/storybook#11010, I was able to update ourstorySort
function and no changes will be required in our story files.