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

chore: ensure story export order is robustly used as story sort order in storybook #1077

Merged
merged 15 commits into from
Jul 28, 2021

Conversation

dcwarwick
Copy link
Contributor

@dcwarwick dcwarwick commented Jul 26, 2021

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.

@netlify
Copy link

netlify bot commented Jul 26, 2021

✔️ 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

@dcwarwick dcwarwick marked this pull request as ready for review July 26, 2021 21:46
@dcwarwick dcwarwick requested a review from a team as a code owner July 26, 2021 21:46
dcwarwick and others added 7 commits July 26, 2021 22:53
* 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
matthewgallo previously approved these changes Jul 28, 2021
@dcwarwick dcwarwick merged commit 007a3fe into carbon-design-system:main Jul 28, 2021
@dcwarwick dcwarwick deleted the issue1071 branch July 28, 2021 23:00
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.

Check out story order -- some weird things are happening
3 participants