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

types(controls): allow null for modelValue #766

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andre-brdoch
Copy link

Description

With this PR, null is being added as a valid modelValue type to all controls.

Before it needed to be either the type that is reasonable for the control in question (eg. string for HstText), or undefined. However, authors of components (for which they are writing stories) might choose to allow null as a value for their props.

Controls should not have much opinion about how authors choose to type their components, but instead make it easy and seamless to write stories.

Let me know if you have any questions or disagree 😊


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

type adjustment

Before submitting the PR, please make sure you do the following

  • If it's a new feature, provide a convincing reason to add it. Ideally, you should open a suggestion issue first and have it approved before working on it.
  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

Copy link

codesandbox bot commented Nov 12, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

stackblitz bot commented Nov 12, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

netlify bot commented Nov 12, 2024

Deploy Preview for histoire-examples-vue3 failed.

Name Link
🔨 Latest commit 3fa4604
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-vue3/deploys/6732fb18a5dfce0008df3ebb

Copy link

netlify bot commented Nov 12, 2024

Deploy Preview for histoire-site failed.

Name Link
🔨 Latest commit 3fa4604
🔍 Latest deploy log https://app.netlify.com/sites/histoire-site/deploys/6732fb180d9f950008430e0e

Copy link

netlify bot commented Nov 12, 2024

Deploy Preview for histoire-controls failed.

Name Link
🔨 Latest commit 3fa4604
🔍 Latest deploy log https://app.netlify.com/sites/histoire-controls/deploys/6732fb184b4d1b0008265e1e

Copy link

netlify bot commented Nov 12, 2024

Deploy Preview for histoire-examples-svelte3 failed.

Name Link
🔨 Latest commit 3fa4604
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-svelte3/deploys/6732fb180971d80008e251d0

`null` is being added as a valid `modelValue` type to all controls.
@andre-brdoch andre-brdoch changed the title types(controls): Allow null for modelValue types(controls): allow null for modelValue Nov 12, 2024
@andre-brdoch
Copy link
Author

It complains about the PR title, types is not supported. I assume the same rules apply as for the commit message rules? According to those, types is valid:
https://github.com/histoire-dev/histoire/blob/main/.github/commit-convention.md

/^(revert: )?(feat|fix|docs|dx|refactor|perf|test|workflow|build|ci|chore|types|wip|release|deps)((.+))?: .{1,50}/

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.

1 participant