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

Separate storyshots #155

Merged
merged 4 commits into from
Jun 7, 2018
Merged

Separate storyshots #155

merged 4 commits into from
Jun 7, 2018

Conversation

cjies
Copy link
Contributor

@cjies cjies commented Jun 6, 2018

  • Separate all the story snapshots into individual storyshots.
  • Load custom babelrc in web storybook.
  • Add .editorconfig to maintain consistent coding styles between different editors.

@cjies cjies requested a review from 0xycvv June 6, 2018 14:18
getSnapshotFileName,
} from '@storybook/addon-storyshots';
import renderer from 'react-test-renderer';
import 'jest-styled-components';
Copy link
Member

Choose a reason for hiding this comment

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

This library is not working as I expect. Do you know why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am checking the problem XD
Btw, this plugins quite useful in my project.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, i can't find the problem why it is not working... ☹️

Copy link
Member

Choose a reason for hiding this comment

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

I guess it is related to this. I got some warning about multiple instances of styled-components when I open storybook. It's not a new issue though.

https://github.com/styled-components/jest-styled-components#working-with-multiple-packages

Copy link
Contributor Author

@cjies cjies Jun 7, 2018

Choose a reason for hiding this comment

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

But I found that there has only one version of styled-components (in native and web packages), are any 3rd party libraries also using the styled-components?

Copy link
Member

Choose a reason for hiding this comment

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

Yes. Sorry I forget to mention about that.
I have included my own priority nav https://github.com/ericyip/react-priority-navigation
I tried to avoid bundle with sc but it's not working..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you should separate them XD

Copy link
Member

Choose a reason for hiding this comment

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

Finally got this one working

Add custom serializer in order to work with multiSnapShot
storybookjs/storybook#887 (comment)

@@ -0,0 +1,3 @@
{
"extends": "../../../.babelrc"
Copy link
Member

Choose a reason for hiding this comment

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

I thought it will be loaded as default

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unfortunately, not 😅

Copy link
Contributor Author

@cjies cjies Jun 6, 2018

Choose a reason for hiding this comment

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

By default, Storybook loads your root .babelrc file and load those configurations.
https://storybook.js.org/configurations/custom-babel-config/

But it only reads the "root" of web/ workspace, if the babelrc is out of its scope, it wont be loaded.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another question, why you moved .babelrc to the root since #144?

Copy link
Member

Choose a reason for hiding this comment

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

Shhh.. I thought it is duplicated

Copy link
Member

@0xycvv 0xycvv left a comment

Choose a reason for hiding this comment

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

Thanks CJ! =D

@cjies cjies force-pushed the CJ/fix_web_storybook branch from fd3ded5 to bba80ea Compare June 6, 2018 15:20
@0xycvv 0xycvv merged commit 51b631f into master Jun 7, 2018
@0xycvv 0xycvv deleted the CJ/fix_web_storybook branch June 7, 2018 03:04
@0xycvv 0xycvv added the internal Internal improvement label Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Internal improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants