-
-
Notifications
You must be signed in to change notification settings - Fork 322
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
React Storybook integration example #1026
Comments
Hi, I am trying to setup Storybook, here is my current process:
Now you need to improve the Storybook webpack build to take our own build context into account (mostly handle TypeScript).
Right now I get this code for
Sadly it does not reckognize Also storybook needs to be ignored somehow otherwise build will fail. |
Hi, it does not seem to work with |
@eric-burel Hi it actually uses the same config as client and you can see that index.stories.tsx is obviously written in TypeScript, so it should support both ES6 and TS |
You are right for the
Using TS is ok in the index but it fails to parse
|
It behaves as if story build was using a different loader (eg jsx) than the top level import + stories import which will correctly us TypeScript. It fails as soon as I try to use |
Note that I get a different error if I don't use the
|
@eric-burel Should be fixed via: |
Awesome! It's fixed, thanks a lot. |
Storybook works but now my app itself won't build. Here are the errors:
In particular the |
@eric-burel |
Hi here are reproduction steps: Steps:
Minimal repro: https://github.com/lbke/apollo-universal-starter-kit/tree/storybook-stable I understand that those are dependencies issues but the problem is that they come from the underlying packages (eg packages that don't provide a built version, server-side only etc...). The problem here is that indeed we are mixing 2 applications, a pure client side app and a client/server application Storybook. It seems that the build is based on all dependencies but does not necessarily detect unused ones (from the web app point of view, so Storybook related dependencies) that should be ignored. |
Why do you add cross-env into dependencies of |
Hmmm ok I added them as dependencies instead of devDependencies... not used to yarn. I'll try tomorrow I hope it was just that. |
|
Ok got it eventually. What seems to happen is that if I "yarn add" the package in So from the beginning I thought Now it works as expected. Thanks for the support, Storybook is a huge improvement for our productivity. |
spinjs
supports Storybook now, check this code to integrate it:https://github.com/sysgears/spinjs/blob/master/docs/programmatic.md
It will let storybook to utilize the same Webpack config used by the kit. So one will be able to import container components in storybook stories as well as presentational components. There still be a need to mock backend, but we can do it the same way as in the tests, that mocking code should work for storybook stories too.
The text was updated successfully, but these errors were encountered: