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

Navigation order breaks during hot reload #482

Closed
jzaefferer opened this issue Sep 23, 2016 · 8 comments
Closed

Navigation order breaks during hot reload #482

jzaefferer opened this issue Sep 23, 2016 · 8 comments
Labels

Comments

@jzaefferer
Copy link

To reproduce: Start with 3 stories, A, B, C. By default, they're alphabetically ordered. Now edit story A. After a hot reload, observe the navigation order.

Expected: A, B, C
Actual: B, C, A

It seems like the hot reloaded story gets stuck to the end of the list. After a hard reload of the page, its back where its supposed to be.

Tested with 2.18.0.

PS: The "Known Issues" link in https://github.com/kadirahq/react-storybook/blob/master/CONTRIBUTING.md#issues is dead

@thani-sh thani-sh added the bug label Sep 23, 2016
@arunoda
Copy link
Member

arunoda commented Sep 25, 2016

Yep. This is a bug.

@arunoda
Copy link
Member

arunoda commented Sep 25, 2016

@mnmtanish This is suppose to work earlier. Seems like HMR dispose is not working properly. Isn't it?

@thani-sh
Copy link
Contributor

@jzaefferer when calling storiesOf, are you giving module as the second argument? HMR dispose will work only if it's done. Example:

storiesOf('MyComponent', module)

@jzaefferer
Copy link
Author

Yes, just verified that all our storiesOf calls pass module as the 2nd argument.

As far as I can tell, we're not doing anything out of the ordinary. Here's our config, webpack config and a sample story: https://gist.github.com/jzaefferer/e4c3152d60dd7e6537a1b72a6f6116dd

@thani-sh
Copy link
Contributor

Thanks for the info. I'll check it out.

@thani-sh
Copy link
Contributor

thani-sh commented Sep 27, 2016

@arunoda this issue was there from the beginning. The order is lost when the module gets disposed and re-added. And when it's added again, it's added as a new component (kind) and so it goes to the end of the list.

Opened a PR for this issue:
#499

@thani-sh
Copy link
Contributor

thani-sh commented Oct 6, 2016

Fixed with #499

@thani-sh thani-sh closed this as completed Oct 6, 2016
@jzaefferer
Copy link
Author

Nice, thank you!

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

No branches or pull requests

3 participants