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

Move storySort from preview.js to main.js #30429

Open
4 tasks
shilman opened this issue Jan 31, 2025 · 0 comments
Open
4 tasks

Move storySort from preview.js to main.js #30429

shilman opened this issue Jan 31, 2025 · 0 comments
Labels
Milestone

Comments

@shilman
Copy link
Member

shilman commented Jan 31, 2025

Describe the bug

Currently sorting stories in the sidebar is done using a parameter, options.storySort because once upon a time that code was executed in the preview.

Today, sorting is done in Node. That means that:

  1. storySort can only be defined in preview.js, making it a weird parameter
  2. It must be statically extracted using AST techniques
  3. It has various constraints due to Add support for custom webpack config #2

This is pure tech debt. We should:

  • Move storySort to main.js
  • Update the index and any referencing code
  • Create an automigration to move existing storySort configs to main.js
  • Update the documentation

This is a breaking change that can only be done in a major release.

@shilman shilman added BREAKING CHANGE maintenance User-facing maintenance tasks story index labels Jan 31, 2025
@shilman shilman added this to the 9.0 milestone Jan 31, 2025
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

1 participant