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

Story sort should be stable #8792

Closed
tmeasday opened this issue Nov 11, 2019 · 2 comments · Fixed by #8795
Closed

Story sort should be stable #8792

tmeasday opened this issue Nov 11, 2019 · 2 comments · Fixed by #8795

Comments

@tmeasday
Copy link
Member

Describe the bug
We sort stories with Array.prototype.sort() which isn't guaranteed to be stable (as per JS spec).

For example in v8 < v7 (Chrome <70, Node <12 (?)) sorting was not stable: https://v8.dev/blog/array-sort

To Reproduce

  1. Consider official storybook: https://storybooks-official.netlify.com/?path=/story/ui-panel--default -- notice the story order in latest chrome:

image

  1. Notice the story order in Chromatic: (uses JSDOM, ie node sort)

image

In theory the order should be wrong in Chrome 69 also but I haven't yet been able to reproduce.

Expected behavior
The stories should stay in order.

@shilman
Copy link
Member

shilman commented Nov 13, 2019

Good golly!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.3.0-alpha.44 containing PR #8795 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

@shilman
Copy link
Member

shilman commented Dec 2, 2019

Whoopee!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.8 containing PR #8795 that references this issue. Upgrade today to try it out!

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

Successfully merging a pull request may close this issue.

3 participants
@tmeasday @shilman and others