Storysource addon does not detect stories when they are created without chaining:
const stories = storiesOf('MyCoolButton', module);
stories.add('first story', () => (
...
));
stories.add('second story', () => (
...
));
stories.add('third story', () => (
...
));
Tested on @storybook/[email protected], @storybook/[email protected]
Hmm, indeed. I'll study it.
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
Hmm @igor-dv I think you're the only one who really understands the code ... 馃槈
I do if needed
@libetl I think you just volunteered yourself 馃槝
quite busy these days, ideally already fixed in storysource v2, I will take a look when I can
Fair answer! Keep it in mind for storysource v2. In the meantime if anybody else wants to pick this up, go for it!
For those of us mortals, what is storysource v2? Is that some new 5.x.x release?
@sebastian-nowak Probably 6.0 :trollface:
I was sick this weekend and therefore no access to any computer
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
I think this will be available only in v6
@libetl would love to discuss this with you for 10m on discord when you have time. i'm making some changes to the story format as part of SB docs. the changes are backwards compatible (i.e. old stories will keep working), but i'm wondering whether the new format will break storysource. so i want to understand the impact & whether there's anything i need to consider.
sure we can chat
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
In 5.2 we're moving to @storybook/source-loader which was overhauled by @libetl. This might have been fixed in there.
@libetl has done amazing work on this stuff, v5.2 will include his work to bring the loader much needed upgrade 馃帀
I believe this is fixed by #7117
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
Closing this. Please give a shout if this is not working in 5.2-beta and above!
I am still not able to make it work. Even with the latest beta version tab stays at "loading source" state
@datasoysa does it work if you used chained storiesOf().add().add() style?
@datasoysa does it work if you used chained
storiesOf().add().add()style?
Yes i've also tried like that but couldn't make it running @shilman . I am using addon-info instead but it is not the same thing.
@datasoysa do you see any errors in the console? Are you using JS or Typescript? Which version of Storybook? What does your webpack.config.js look like?
@datasoysa do you see any errors in the console? Are you using JS or Typescript? Which version of Storybook? What does your
webpack.config.jslook like?
Actually no errors on console. I am not using webpack. Using a CRA project with .storybook/config.js adding the storysource addon as import '@storybook/addon-storysource/register'; to the addons.js and tried both addDecoration withStorySource and without that one. It creates the tab but only shows "loading source..."
@datasoysa If you're using Storybook then you're using webpack. And you need to add the appropriate webpack loader in order to view the source, otherwise you'll see "loading source...". See https://github.com/storybookjs/storybook/blob/next/addons/storysource/README.md#getting-started
@shilman Thank you :) I've made a mistake on test regex. Now it is fine 馃憤
Most helpful comment
@libetl has done amazing work on this stuff, v5.2 will include his work to bring the loader much needed upgrade 馃帀