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

fix: storysort #677

Open
wants to merge 5 commits into
base: next
Choose a base branch
from
Open

fix: storysort #677

wants to merge 5 commits into from

Conversation

dannyhw
Copy link
Member

@dannyhw dannyhw commented Jan 30, 2025

Issue: #414

What I did

figuring out how to apply sorting in v8

How to test

Please explain how to test your changes and consider the following questions

  • Does this need a new example in examples/expo-example?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great on first glance. Does it work?

@dannyhw
Copy link
Member Author

dannyhw commented Jan 31, 2025

@shilman heres the result on this pr

before

sort is specified but ignored
image

after

Sort specified (note that the order changed)
image

No sort specified
image

@dannyhw dannyhw changed the title WIP: experimental storysort WIP: storysort Jan 31, 2025
@dannyhw dannyhw marked this pull request as ready for review January 31, 2025 16:15
@dannyhw dannyhw changed the title WIP: storysort fix: storysort Jan 31, 2025
return { index, importMap };
const sortableStories = Object.values(index.entries);

sortStoriesV7(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pulling in sort stories from preview api to reuse sorting code

@@ -175,7 +195,13 @@ export function start({
annotations: any[];
options?: ReactNativeOptions;
}) {
const { index, importMap } = prepareStories({ storyEntries, options });
const composedAnnotations = composeConfigs<ReactRenderer>(annotations);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using composeConfig lets us read the parameters synchronously

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

Successfully merging this pull request may close these issues.

2 participants