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

[Storybook] Notify the user about stories that use the mock-api #60

Open
larsvanbraam opened this issue Apr 28, 2022 · 0 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed muban-template @pota/muban-template

Comments

@larsvanbraam
Copy link
Contributor

larsvanbraam commented Apr 28, 2022

Introduction

So on one of my projects we use the mock-API in multiple components, since Storybook doesn't start up the mock server by default we might end up with stories that appear broken because of XHR requests failing.

Suggestion

To avoid the stories from being broken we basically have two options:

  1. Always enable the mock-API when starting up Storybook so all stories work like expected.
  2. Gracefully let the user know when a story requires the mock-API to be enabled.

The first option is probably the easiest to implement but it also has a downside because always running the mock-API causes extra processes to be started that might slow down the stories that do not require the mock-API.

The second option might be better for performance but also requires users to mark stories as API-dependant and would require some form of UI that instructs users to start up Storybook with the mock-API enabled.

@larsvanbraam larsvanbraam changed the title [StorybookNotify the user about stories that use [Storybook] Notify the user about stories that use the mock-api Apr 28, 2022
@larsvanbraam larsvanbraam added the enhancement New feature or request label Apr 28, 2022
@psimk psimk added help wanted Extra attention is needed muban-template @pota/muban-template labels Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed muban-template @pota/muban-template
Projects
None yet
Development

No branches or pull requests

2 participants