-
Notifications
You must be signed in to change notification settings - Fork 120
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
chore: ensure story export order is robustly used as story sort order in storybook #1077
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✔️ Deploy Preview for ibm-cloud-cognitive ready! 🔨 Explore the source changes: f0c3b8c 🔍 Inspect the deploy log: https://app.netlify.com/sites/ibm-cloud-cognitive/deploys/610175f059705f000822a507 😎 Browse the preview: https://deploy-preview-1077--ibm-cloud-cognitive.netlify.app |
* fix: update apikeymodal prop testing * fix: added ref tests Co-authored-by: David Menendez <dmenend@us.ibm.com>
- @carbon/ibm-cloud-cognitive@0.62.5
Co-authored-by: David Menendez <dmenend@us.ibm.com>
- @carbon/ibm-cloud-cognitive@0.62.6
matthewgallo
previously approved these changes
Jul 28, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1071
The export order of stories is not a robust cue for story sort order, and in particular is currently scrambled by Webpack which produces a dictionary of exports sorted alphabetically. Added a helper function
prepareStory
for exporting stories, which binds the template, applies story properties, and additionally injects an incremented sequence number. Expanded the story sort function to use the sequence number to sort stories. This effectively produces the export order story sort, but in a robust and assured way rather than relying on the export list being preserved during bundling and optimisation operations.What did you change?
Added story-helper.js, updated preview.js for storybook, and updated stories for every component to use the helper function.
How did you test and verify your work?
Ran storybook.