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 proptypes warning for kitchen-sink #1238

Closed
wants to merge 2 commits into from
Closed

Fix proptypes warning for kitchen-sink #1238

wants to merge 2 commits into from

Conversation

alexandrebodin
Copy link
Contributor

@alexandrebodin alexandrebodin commented Jun 9, 2017

Issue:

What I did

I cleaned some proptypes in addon-info and test-cra

I got every addons to work with this config on node v8 npm 4.6

Changed test-cra deps to lerna for easy experimenting / addon updating

@alexandrebodin alexandrebodin changed the title Fix proptypes warning Fix proptypes warning for kitchen-sink Jun 9, 2017
@codecov
Copy link

codecov bot commented Jun 9, 2017

Codecov Report

Merging #1238 into 1220-kitchen-sink will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@                Coverage Diff                 @@
##           1220-kitchen-sink    #1238   +/-   ##
==================================================
  Coverage              13.74%   13.74%           
==================================================
  Files                    207      207           
  Lines                   4633     4633           
  Branches                 582      513   -69     
==================================================
  Hits                     637      637           
- Misses                  3494     3544   +50     
+ Partials                 502      452   -50
Impacted Files Coverage Δ
addons/info/src/components/Props.js 0% <ø> (ø) ⬆️
lib/ui/src/modules/shortcuts/actions/shortcuts.js 6.25% <0%> (ø) ⬆️
lib/ui/src/modules/ui/containers/left_panel.js 20% <0%> (ø) ⬆️
app/react/src/client/preview/reducer.js 0% <0%> (ø) ⬆️
.../ui/src/modules/ui/components/left_panel/header.js 27.58% <0%> (ø) ⬆️
addons/knobs/src/components/types/Number.js 8.06% <0%> (ø) ⬆️
addons/knobs/src/components/types/Color.js 8% <0%> (ø) ⬆️
addons/info/src/components/markdown/htags.js 0% <0%> (ø) ⬆️
app/react/src/client/preview/error_display.js 0% <0%> (ø) ⬆️
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 46cff5f...0bcda4f. Read the comment docs.

@shilman
Copy link
Member

shilman commented Jun 9, 2017

@tmeasday do you mind reviewing this? I think you are the primary "user" of test-cra at this point, and that there's a good reason it's set up the way it is with file: deps instead of lerna bootstrap?

@@ -17,7 +17,7 @@ const Button = ({ children, onClick }) =>
</button>;

Button.propTypes = {
children: PropTypes.string.isRequired,
children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).isRequired,
Copy link
Member

Choose a reason for hiding this comment

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

This can be PropTypes.node

@@ -118,7 +118,7 @@ export default class Welcome extends React.Component {
}

Welcome.propTypes = {
showApp: PropTypes.function,
Copy link
Member

Choose a reason for hiding this comment

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

rookie mistake, whoever wrote this... Ow wait this was me.

"@storybook/channels": "file:../../lib/channels",
"@storybook/react": "file:../../app/react",
"@storybook/ui": "file:../../lib/ui",
"@storybook/addon-actions": "^3.0.1",
Copy link
Member

Choose a reason for hiding this comment

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

This removes the purpose of test-cra

I at one point set it up as an alternative if bootstrapping wouldn't work.

Nowadays bootstrapping is relatively fast-ish (compared to what is was) and it's reliable (at least for me & on CI).

I think we can discontinue this example now, and stop using file dependencies. @tmeasday I'd like your thoughts on this?

Copy link
Member

Choose a reason for hiding this comment

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

Previously there was an advantage to test-cra because it flattened dependencies (with npm<5) and thus "looked like" a real app in terms of how require/import resolved.

However, in npm@5, file:// URLs are treated like npm links (AFAICT), so that advantage is gone. It seems like we can just about get away with it with aggressive use of peerDependencies in packages and linking every storybook related package in the app (this is OK).

So I don't think there's any point in distinguishing test-cra from cra-storybook any more.

Copy link
Member

Choose a reason for hiding this comment

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

I definitely don't think linking to versions is what we want.

Copy link
Member

Choose a reason for hiding this comment

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

Are you OK with me just removing it then?

Copy link
Member

Choose a reason for hiding this comment

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

I think so if you agree with the motivation for it in the first place above.

@alexandrebodin
Copy link
Contributor Author

@ndelangen @tmeasday @shilman

I have some questions so I can continue working on this :

  • From what we discussed on this thread and slack can I rename this project react-kitchen-sink ? Or should we set it up outside this repo ?

  • @tmeasday not sure what you meant but using peerDependencies. Is it that we add every storybook dependency as peer dependency and npm link each one when working on it ? If so I can work on a script to do the linking automatically. Should I add storybook as peer deps with "*" version instead of sth like "^3.x.x" ?

  • I'm open to any other suggestions you've got to work on this :)

@shilman
Copy link
Member

shilman commented Jun 10, 2017

@alexandrebodin sorry for the confusion here. i'd love your help with this stuff. Let's go with the following:

And please feel free to do as much as you'd like, or we can divide it up.

BTW I've converted crna-getstorybook to "*" style dependencies over in #1219 and I think that's a good template.

@tmeasday
Copy link
Member

What I meant by peer deps is e.g. if one of the addons has a direct dependency on @storybook/addons, then things will break when linking because the version it imports will be different from the app's version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants