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

Rename GlobalArgs to Globals #11384

Closed
shilman opened this issue Jul 2, 2020 · 2 comments
Closed

Rename GlobalArgs to Globals #11384

shilman opened this issue Jul 2, 2020 · 2 comments
Assignees
Labels
Milestone

Comments

@shilman
Copy link
Member

shilman commented Jul 2, 2020

Storybook Args RFC introduces two types of dynamic data to Storybook, Args and GlobalArgs, and we are renaming GlobalArgs to Globals

Rationale

Args and GlobalArgs share a similar implementation, but different semantics. Specifically, Args are arguments to a story and can only be set at the story or component levels. GlobalArgs are dynamic global variables for Storybook UI (and potentially other uses?) and can only be set globally.

In documenting Args, we found it confusing that there are no "global Args" but there are "GlobalArgs." So before we release and the name sticks forever, we're renaming globalArgs to globals. And globalArgTypes to globalTypes.

@kylemh
Copy link
Member

kylemh commented Jul 2, 2020

DEFINITELY! My favorite draw to CSF was the ability to easily write "tests" once and use them across two tools, and this makes that very simple.

I basically already do this, but with way more silly boiler plate: https://github.com/innocuous-tech/core/blob/master/packages/components/src/Button/__stories__/Button.stories.tsx

@shilman
Copy link
Member Author

shilman commented Jul 2, 2020

Gadzooks!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-beta.39 containing PR #11385 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants