-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
feat: upgraded to storybook 8 and vite-framework #209
Conversation
✅ Deploy Preview for storybook-addon-mock ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hello 🖖 |
aa8760c
to
271191f
Compare
Hi ! I updated it to 20 :) |
stories: [ | ||
'../stories/**/*stories.mdx', | ||
'../stories/**/*stories.@(js|jsx|ts|tsx)', | ||
'../stories/**/*.mdx', |
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 this line can be removed as MDX files are no longer supported since Storybook v8.x
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.
Are you sure ? I can see that they removed the support for .stories.mdx https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#dropping-support-for-storiesmdx-csf-in-mdx-format-and-mdx1-support
Checking their docs for V8 they still use mdx and show examples of it
https://storybook.js.org/docs/writing-docs/mdx
@Jontii thanks for your PR. I left some comments in your PR. Hope you don't mind. |
I tried to debug that further by adding logs inside |
By using the info from here and changing import { withRoundTrip } from '../withRoundTrip';
const preview = {
decorators: [withRoundTrip],
globals: {
mockData: [],
},
};
export default preview; and keeping the console logs, I can now see the decorator is being called From const data = [...globalMockData, ...paramData];
console.warn('withRoundTrip:');
console.log(data); The data being shown is the story args parameter data. Yet the state data is empty and thus the tab also remains empty. It almost works but in the end there is still no data shown inside the tab. |
Two fixes were required. Use the correct addons import and withRoundTrip as a decorator for all stories.
Hi ! I fixed it in my latest commit so everything should be working now. @jdehaan |
@@ -16,7 +16,7 @@ import { Footer } from './footer'; | |||
|
|||
<h3 className="subheading">1. Global configuration</h3> | |||
|
|||
You can set <strong>global configuration</strong> for the addon. Go to the `.storybook/preview.js` file and add `mockAddonConfigs` fields with the following properties. | |||
You can set <strong>global configuration</strong> for the addon. Go to the `.storybook/preview.jsxx` file and add `mockAddonConfigs` fields with the following properties. |
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.
A small typo here jsxx
-> jsx
, other than that LGTM! Thanks for the fix
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, I'll fix it :)
@@ -12,10 +12,10 @@ jobs: | |||
- name: Prepare repository | |||
run: git fetch --unshallow --tags | |||
|
|||
- name: Use Node.js 14.x | |||
uses: actions/setup-node@v1 | |||
- name: Use Node.js 18.x |
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.
Minor, but since we're updating things, I think we might as well choose the latest LTS version of Node.js, and that's version 20.
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.
LGTM Huge kudos to @Jontii and other who contributes this PR. I'm going to merge the PR and publish the new version soon.
"remark-gfm": "^3.0.1", | ||
"superagent": "^8.0.9" | ||
"superagent": "^8.0.9", | ||
"vite": "^5.2.8" |
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.
is vite really a prod dependency of the addon ?
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.
ah sorry. This is the docs package, not the addon
This PR upgrades storybook to v8 and switched from webpack compiler to vite for storybook.