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

feat: Add 'component' option to @addons/info #3476

Closed
wants to merge 4 commits into from

Conversation

wuweiweiwu
Copy link
Member

@wuweiweiwu wuweiweiwu commented Apr 23, 2018

Issue:
fixes #2893

What I did

added a component option that allows users to specify what component is analyzed

Usage:

storiesOf('Addons|Info.Options.component', module).add(
  'Specify another component to be analyzed',
  withInfo({
    component: () => <BaseButton label="specified button" />,
  })(() => myHOC(BaseButton))
);

How to test

Is this testable with Jest or Chromatic screenshots? n/a
Does this need a new example in the kitchen sink apps? y
Does this need an update to the documentation? y

If your answer is yes to any of these, please make sure to include it in your PR.

For maintainers only: Please tag your pull request with at least one of the following:
["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

@storybook-safe-bot
Copy link
Contributor

storybook-safe-bot commented Apr 23, 2018

Fails
🚫

PR is not labeled with one of: ["cleanup","BREAKING CHANGE","feature request","bug","documentation","maintenance","dependencies:update","dependencies","other"]

Generated by 🚫 dangerJS

@codecov
Copy link

codecov bot commented Apr 23, 2018

Codecov Report

Merging #3476 into master will increase coverage by 55.05%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #3476       +/-   ##
==========================================
+ Coverage   37.44%   92.5%   +55.05%     
==========================================
  Files         455       6      -449     
  Lines       10284      40    -10244     
  Branches      906       2      -904     
==========================================
- Hits         3851      37     -3814     
+ Misses       5902       2     -5900     
+ Partials      531       1      -530
Impacted Files Coverage Δ
addons/storysource/src/loader/index.js
lib/cli/bin/index.js
lib/ui/src/modules/api/actions/api.js
addons/storyshots/src/angular/loader.js
addons/info/src/components/types/PrettyPropType.js
app/polymer/bin/index.js
addons/storyshots/src/index.js
app/polymer/src/server/config/babel.js
addons/knobs/src/angular/index.js
app/polymer/src/server/index.js
... and 437 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 1e02ad1...83a9ed8. Read the comment docs.

@wuweiweiwu
Copy link
Member Author

I would say partially, since the propTables option appends other components.

What if the propTables option completely overrides the story component instead?

I mainly just have decorated components in mind for this use case, on second thought, I don't this this is actually needed, since in #2893 you can just pass in the undecorated component into the story unless the decorator adds some extra functionality, but propTables can be used to document the undecorated component instead

@Hypnosphi
Copy link
Member

What if the propTables option completely overrides the story component instead?

You can achieve this by combining it with propTablesExclude

@wuweiweiwu
Copy link
Member Author

I see! Thanks for clarifying

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.

None yet

3 participants