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(scripts): reduce watcher updates and fix small path bug #261

Merged
merged 1 commit into from
Sep 11, 2021

Conversation

dannyhw
Copy link
Member

@dannyhw dannyhw commented Sep 9, 2021

Issue: NA

What I did

I've made the watcher only update requires when stories are added or removed or the main/preview.js was updated.

I also made an adjustment to how the paths work in the get-stories script.

How to test

Run the sbn-watcher and sbn-get-stories scripts in the example project.

@dannyhw dannyhw added the 6.5 label Sep 9, 2021
@dannyhw dannyhw self-assigned this Sep 9, 2021
Copy link
Contributor

@lauriharpf lauriharpf left a comment

Choose a reason for hiding this comment

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

Seems to work well 👍 🚀 🏅 .

Here's how I understand the different operations related to updates, please correct if mistaken:

  • yarn dev in root React Native Storybook project directory: Causes any changes made to the core React Native Storybook files to be reflected in the example app
  • yarn start in the examples/native directory: Needs to be running before running yarn android/yarn ios. When the app is running, changes to existing stories cause a reload & are reflected. New stories do not get added (storybook.requires.js only gets written when the app starts, because prestart runs sbn-get-stories).
  • yarn storybook-watcher in the examples/native directory: If this is running, then adding/removing stories causes storybook.requires.js to be updated, so adding/removing stories is reflected in the app without a restart.

@dannyhw
Copy link
Member Author

dannyhw commented Sep 11, 2021

Seems to work well 👍 🚀 🏅 .

Here's how I understand the different operations related to updates, please correct if mistaken:

  • yarn dev in root React Native Storybook project directory: Causes any changes made to the core React Native Storybook files to be reflected in the example app
  • yarn start in the examples/native directory: Needs to be running before running yarn android/yarn ios. When the app is running, changes to existing stories cause a reload & are reflected. New stories do not get added (storybook.requires.js only gets written when the app starts, because prestart runs sbn-get-stories).
  • yarn storybook-watcher in the examples/native directory: If this is running, then adding/removing stories causes storybook.requires.js to be updated, so adding/removing stories is reflected in the app without a restart.

Yeah that's exactly it, the watcher just makes it so you don't need to manually run sbn-get-stories after adding a new story its mostly a convenience thing. I'm sure some people would prefer to just run the get stories command instead of having a watcher running.

@dannyhw dannyhw merged commit a702142 into next-6.0 Sep 11, 2021
@dannyhw dannyhw deleted the fix/paths-have-extra-dot branch September 11, 2021 16:32
dannyhw added a commit to raychanks/react-native that referenced this pull request Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants