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

Controls: Remove auto inference and add to CLI template #14182

Merged
merged 3 commits into from
Mar 9, 2021

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Mar 9, 2021

Issue: #14014

What I did

Seems like the controls matchers as a preset were causing confusion, so this PR removes them and explicitly adds them in the CLI templates for discoverability.

How to test

1 - checkout the branch
2 - run yarn bootstrap && yarn start
3 - Check the examples at examples/official-storybook/stories/addon-controls.stories.tsx, they should still work

@@ -19,6 +19,12 @@ function configurePreview(framework: SupportedFrameworks) {
const parameters = `
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
Copy link
Member Author

Choose a reason for hiding this comment

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

we could maybe add a link to the docs as a comment?

Copy link
Member

Choose a reason for hiding this comment

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

great idea, let's follow up when the new docs are live

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Thanks so much @yannbf 🙏

@shilman shilman changed the title Fix/remove auto inference controls Controls: Remove auto inference and add to CLI template Mar 9, 2021
@shilman shilman added addon: controls maintenance User-facing maintenance tasks labels Mar 9, 2021
@shilman shilman merged commit 0bb9a4f into next Mar 9, 2021
@shilman shilman deleted the fix/remove-auto-inference-controls branch March 9, 2021 23:07
This was referenced Mar 11, 2021
JReinhold added a commit to JReinhold/storybook that referenced this pull request Jul 16, 2022
A PR at storybookjs#14182 removed the default custom regex matchers for colors and dates Controls, and instead added them to the generated output from the CLI.
However the docs don't reflect this change, and felt quite confusing for me working in a project that didn't use a recent version of the CLI, and therefore didn't have the "default" matchers from the CLI.

I've tried to change the wording to reflect that they are only "defaults" if the reader actually sees them in the `.storybook/preview.js` file.

I'm open to inputs on wording, or basically anything.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: controls maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants