-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
In production, stories do not appear in export order #17611
Comments
I have seen this repeatedly in about 8 different Storybook environments at minimum. This is a major issue as on many stories, we may intentionally build the first story to handle all the controls and be a flexible demonstration of all the options. THEN we will choose to iterate out more "hard coded" stories for some of the additional ones to provide multiple varying scenarios we can run a11y tests against, etc. I wish I'd have had time to look into this, but we've definitely seen this for MONTHS. |
Did you see this comment |
Thanks for sharing that link! Unfortunately, it does not resolve this issue. That comment refers to a problem with a custom Webpack config. In the repro above, we are using the default configuration, without any Webpack customization. |
@himerus in your case i think it's your custom babel config that's overriding the defaults. try adding |
Yes, I'm seeing this problem only with Storybook Angular. I'm not able to reproduce the problem with Storybook React. |
Interesting. Now I have to figure out/remember why we have that large babel config in place to begin with. It is a leftover remnant from long ago. Adding Any additional thoughts welcome, otherwise I'll dig more into that configuration. |
@himerus To clarify, do you mean in the DocsPage for that story on the Docs tab? |
@shilman Exactly. This is on the Docs tab. |
@tmeasday any ideas why the DocsPage story order wouldn't match the sidebar order? |
@himerus -- am I correct in saying you are NOT using If so, I don't really see any obvious reason why the order here (which drives the docs page): storybook/lib/store/src/StoryStore.ts Line 219 in fc9853a
would differ from the order in storybook/lib/store/src/StoryStore.ts Line 246 in fc9853a
However, I suppose technically there's definitely a bug there, as the order in the index could definitely be different from the raw export order (e.g. if you are using sorting, or On the surface it doesn't seem like what's happening here though -- in the v6 store (without sorting, or order), the index just ends up walking the exports anyway: storybook/lib/client-api/src/StoryStoreFacade.ts Lines 190 to 192 in b422c7f
|
Great Caesar's ghost!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.0-alpha.47 containing PR #17669 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Thanks for making this change! I've updated the repro to Storybook 6.5.0-alpha.48. Stories are now sorted in alphabetical order in both local and development. My understanding is that the intended behavior is for stories to be sorted in export order, not alphabetical order. For example, in the How to write stories docs, the Button stories are shown in export order:
I think there's still more to do, but I don't have permission to re-open this issue because I'm not a collaborator and I didn't close the issue. Could someone please re-open this issue? Thank you! |
With the new version:
And the default config (
Stories in prod build are still not in their imported order @shilman can you reopen? |
Shiver me timbers!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.20 containing PR #17669 that references this issue. Upgrade today to the
|
Still sorted in the wrong order. Tried even |
I'm unable to reopen this issue, so I'd recommend continuing the conversation in #17665, which appears to describe a similar problem. Thanks! 😄 |
Describe the bug
In production, stories do not appear in export order. Instead, they are sorted alphabetically.
#15574 describes similar behavior and was closed when a fix was released in v6.14.13 and v6.5.0-alpha.17. I'm still experiencing this problem with Storybook 6.5.0-alpha.45, however.
Thank you in advance for your help!! 😄
To Reproduce
Clone https://github.com/rdebeasi/storybook-sort-repro
Run
yarn storybook
to start Storybook in dev mode. Stories appear in export order (Story C, Story B, Story A). This is the expected behavior.Run
yarn build-storybook && npx serve
to start Storybook in production mode. Shows appear in sorted in alphabetical order (Story A, Story B, Story C). This behavior appears to be a bug.System
The text was updated successfully, but these errors were encountered: