Skip to content

feat: support storybook storyStoreV7 - #69

Merged
sunilsurana merged 2 commits into
microsoft:storybook7from
Hotell:suport-story-store-V7
Feb 10, 2025
Merged

feat: support storybook storyStoreV7#69
sunilsurana merged 2 commits into
microsoft:storybook7from
Hotell:suport-story-store-V7

Conversation

@Hotell

@Hotell Hotell commented Feb 5, 2025

Copy link
Copy Markdown

Previous Behaviour:

StoryWright Steps functionality doesn't work in Storybook 7 by default

New Behaviour:

StoryWright Steps functionality works in Storybook 7 by default

More Context

Ff storyStoreV7 is enabled ( default SB v7 ), SB exposed api on window object, which is used to obtain stories rendered on page within iframe, is different and needs to be executed in 2 steps (also those apis are async).

fun fact: It is still possible to turn off storyStoreV7 within v7 configuration although that is not recommended ( deprecated ) and was supposed to be completely removed from SB - this is probably the case for storybook 8

Fixes microsoft/fluentui#33759

Comment thread package.json
"name": "storywright",
"description": "Storybook setup.",
"license": "MIT",
"version": "0.0.27-storybook7.9",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

not sure how do you do releases ?

else {
let steps = findSteps(children);
return steps;
// @ts-check

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

this logic has been mostly encapsulated to a more maintainable way, incorporating the new behaviours which are necessary to obtain page rendered stories Array

} = require(storiesJsonPath);
stories = Object.values(rawStoriesObject.stories ?? {});
console.log(`${stories.length} stories found`);
console.warn('NOTE: stories Steps will not be processed')

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

provide explicit notification to user in case of GetStories.js eval would fail

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