Skip to content
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

addon-storysource: not working without chaining #6136

Closed
sebastian-nowak opened this issue Mar 17, 2019 · 27 comments
Closed

addon-storysource: not working without chaining #6136

sebastian-nowak opened this issue Mar 17, 2019 · 27 comments

Comments

@sebastian-nowak
Copy link

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/react@5.0.1, @storybook/addon-storysource@5.0.1

@Armanio
Copy link
Member

Armanio commented Mar 17, 2019

Hmm, indeed. I'll study it.

@stale
Copy link

stale bot commented Apr 8, 2019

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!

@stale stale bot added the inactive label Apr 8, 2019
@shilman
Copy link
Member

shilman commented Apr 8, 2019

Hmm @igor-dv I think you're the only one who really understands the code ... 😉

@stale stale bot removed the inactive label Apr 8, 2019
@libetl
Copy link
Member

libetl commented Apr 8, 2019

I do if needed

@shilman
Copy link
Member

shilman commented Apr 8, 2019

@libetl I think you just volunteered yourself 😘

@libetl
Copy link
Member

libetl commented Apr 11, 2019

quite busy these days, ideally already fixed in storysource v2, I will take a look when I can

@shilman
Copy link
Member

shilman commented Apr 11, 2019

Fair answer! Keep it in mind for storysource v2. In the meantime if anybody else wants to pick this up, go for it!

@sebastian-nowak
Copy link
Author

For those of us mortals, what is storysource v2? Is that some new 5.x.x release?

@shilman
Copy link
Member

shilman commented Apr 11, 2019

@sebastian-nowak Probably 6.0 :trollface:

@libetl
Copy link
Member

libetl commented Apr 15, 2019

I was sick this weekend and therefore no access to any computer

@stale
Copy link

stale bot commented May 6, 2019

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!

@stale stale bot added the inactive label May 6, 2019
@libetl
Copy link
Member

libetl commented May 6, 2019

I think this will be available only in v6

@stale stale bot removed the inactive label May 6, 2019
@shilman
Copy link
Member

shilman commented May 6, 2019

@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.

@libetl
Copy link
Member

libetl commented May 7, 2019

sure we can chat

@stale
Copy link

stale bot commented May 28, 2019

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!

@stale stale bot added the inactive label May 28, 2019
@shilman
Copy link
Member

shilman commented May 28, 2019

In 5.2 we're moving to @storybook/source-loader which was overhauled by @libetl. This might have been fixed in there.

@stale stale bot removed the inactive label May 28, 2019
@ndelangen ndelangen modified the milestones: 5.0.x, 5.2.0 Jun 3, 2019
@ndelangen
Copy link
Member

@libetl has done amazing work on this stuff, v5.2 will include his work to bring the loader much needed upgrade 🎉

@stale stale bot added the inactive label Jun 24, 2019
@shilman shilman removed the inactive label Jun 24, 2019
@shilman
Copy link
Member

shilman commented Jun 24, 2019

I believe this is fixed by #7117

@stale stale bot added the inactive label Jul 15, 2019
@storybookjs storybookjs deleted a comment from stale bot Jul 16, 2019
@stale stale bot removed the inactive label Jul 16, 2019
@storybookjs storybookjs deleted a comment from stale bot Jul 16, 2019
@stale
Copy link

stale bot commented Aug 7, 2019

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!

@stale stale bot added the inactive label Aug 7, 2019
@shilman
Copy link
Member

shilman commented Aug 7, 2019

Closing this. Please give a shout if this is not working in 5.2-beta and above!

@shilman shilman closed this as completed Aug 7, 2019
@ghost
Copy link

ghost commented Aug 9, 2019

I am still not able to make it work. Even with the latest beta version tab stays at "loading source" state

@shilman
Copy link
Member

shilman commented Aug 10, 2019

@datasoysa does it work if you used chained storiesOf().add().add() style?

@ghost
Copy link

ghost commented Aug 12, 2019

@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.

@shilman
Copy link
Member

shilman commented Aug 12, 2019

@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?

@ghost
Copy link

ghost commented Aug 12, 2019

@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?

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..."

@shilman
Copy link
Member

shilman commented Aug 12, 2019

@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

@ghost
Copy link

ghost commented Aug 12, 2019

@shilman Thank you :) I've made a mistake on test regex. Now it is fine 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants