-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Enhancement] Configure Webpack to include stubs instead of composers #545
Comments
I hope setComposerStub should work properly. You need to call following in your storybook config file: import { setStubbingMode } from 'react-komposer';
setStubbingMode(true); Also make sure to not to write any Meteor specific imports in the composer file. You can also use React Stubber. Which is the same thing. What you said is doable with a custom webpack config. But I think there are some easy ways to do it. |
Thanks Arunoda, We couldn't avoid importing Meteor specifics in the composer file. We went with customising webpack config, and we came up with this solution: react-stubs, it would be great if you could take a look at it, and give us your thoughts. |
@a-magdy This is too application specific and we can't land this on storybook by default. |
@arunoda We went with customizing webpack config, and it worked. |
Hi,
We are working on a project with Meteor and React, and we are using React Storybook for react components, and so far it is amazing.
But we have this issue, where in containers, we might need dependencies that cannot be available in react storybook, like Meteor (if we are calling a Meteor method).
We tried to come up with a solution using react-komposer's setComposerStub, but it attaches a stub to the original container, demanding its dependencies to be loaded in first place. Therefore,
setComposerStub
is not helping us at leaving Meteor's dependencies out of Storybook.We thought about the problem and we came up with an idea that could be more effective than calling
setComposerStub
. What if we could create files with a.stub
suffix that would be loaded only in storybook, replacing the original file? This way no dependencies from the original composer would need to be loaded.Do you think it is possible, and would that be a good approach ?
The text was updated successfully, but these errors were encountered: