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

CSF: Promote args/argTypes to first-class metadata #10117

Merged
merged 2 commits into from Mar 12, 2020

Conversation

shilman
Copy link
Member

@shilman shilman commented Mar 12, 2020

Issue: N/A

What I did

Promote arg/argTypes to peers of parameters in CSF for both kinds/components and stories.

  • Update CSF loading logic (and renamed)
  • Update unit tests and stories
  • Update documentation

Before:

Example.story = {
  parameters: {
    args: { ... },
    argTypes: { ... },
  }
}

After:

Example.story = {
  args: { ... },
  argTypes: { ... },
}

Note that under the hood they are still stored in parameters. This simplifies the implementation, preserves compatibility with parameterEnhancers, and preserves back-compat with the storiesOf format.

How to test

See attached tests and stories

@shilman shilman added this to the 6.0.0 milestone Mar 12, 2020
Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

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

LGTM ++

lib/core/src/client/preview/loadCsf.ts Outdated Show resolved Hide resolved
@shilman shilman merged commit a9fc57f into next Mar 12, 2020
@shilman shilman deleted the promote-args-argtypes-in-csf branch March 12, 2020 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core csf maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants