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

Update prepareStories to handle more options & strip play functions #573

Merged
merged 3 commits into from May 27, 2024

Conversation

awinograd
Copy link
Contributor

Issue:

What I did

Adds tests for #570 and adds support for includeStories/excludeStories CSF options on meta.

How to test

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

Unit tests have been added to cover new/changed functionality

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

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

@awinograd awinograd requested a review from dannyhw as a code owner May 3, 2024 18:33
@dannyhw
Copy link
Member

dannyhw commented May 5, 2024

I'd like to make an adjustment to enable the play fn via an option in the config but this looks good to me.

@awinograd
Copy link
Contributor Author

@dannyhw is it actually possible to execute the play fn on native? If so, I definitely see how the option would be useful (and would also be interested myself in how to enable play fn support). I imagine there must be some significant work in terms of getting @storybook/test to play nicely w/native to unblock though.

@dannyhw
Copy link
Member

dannyhw commented May 5, 2024

@awinograd the play function gets called and you can run javascript in there, we just haven't got a way to query elements at runtime without a tool like detox. The idea is that later we could find a way to make it work, I just don't want to change behaviour right now in a minor version even if it doesn't really do much.

I can make the adjustment it will probably just look like this in your main.js

reactNative: {
  playFn: false
}

Copy link
Member

@dannyhw dannyhw left a comment

Choose a reason for hiding this comment

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

@awinograd I pushed some changed the pr that adds some options to main.ts that can be expanded on later. Also probably we don't need the other pr since this one has both sets of changes right? Let me know if you're ok with these changes.

@awinograd
Copy link
Contributor Author

awinograd commented May 13, 2024

@dannyhw the new option looks ok to me! I've closed the other PR since you are right that this one includes that functionality.

Thanks for taking a look at this PR!

@dannyhw dannyhw merged commit 9b4579f into storybookjs:next May 27, 2024
1 check passed
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.

None yet

2 participants