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

Docs: Fix function prop rendering as noRefCheck in storybook docs #26104

Conversation

thisisanto
Copy link
Contributor

@thisisanto thisisanto commented Feb 20, 2024

Related to #17701, not quite the same i think.

What I did

According to react-element-to-jsx-string, function props are rendered as

function noRefCheck() {}

However, I found that for me, they're rendered without the space between the brackets.

-function noRefCheck() {}
+function noRefCheck(){}

As such, I updated the replacement regex to account for both cases, which fixes my problem.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

Visuals:

Before After
Screenshot 2024-02-20 at 11 25 33 am Screenshot 2024-02-20 at 11 26 14 am

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

@thisisanto thisisanto marked this pull request as ready for review February 20, 2024 00:27
@valentinpalkovic valentinpalkovic self-assigned this Feb 20, 2024
@valentinpalkovic valentinpalkovic added bug ci:normal patch:yes Bugfix & documentation PR that need to be picked to main branch and removed patch:yes Bugfix & documentation PR that need to be picked to main branch labels Feb 20, 2024
auto-merge was automatically disabled February 25, 2024 23:14

Head branch was pushed to by a user without write access

@thisisanto thisisanto force-pushed the anto/fix-function-arg-renders-in-docs branch from b04a9bf to a945910 Compare February 25, 2024 23:14
@thisisanto
Copy link
Contributor Author

@kasperpeulen I believe there's an issue with the DangerJS CI step. There's a bunch of errors in the action log here, but they seem to come up even for jobs that pass.

Only difference I found was the one complaining about a comment on the issue. I think the github token for the job doesn' have sufficient scopes (despite the PRs being public? 🤔)

Anyways, I think deleting the comments from the PR should make pass the build (ironically this comment might cause it to fail lol..)

Please let me know if i'm doing anything wrong, and/or how to proceed 🙏🏼

@valentinpalkovic valentinpalkovic merged commit 7589b50 into storybookjs:next Feb 27, 2024
46 checks passed
@valentinpalkovic
Copy link
Contributor

Hi @thisisanto!

You were not doing anything wrong :) DangerJS doesn't work properly on PRs that are coming from forks.

Thanks for your contribution and patience!

@valentinpalkovic valentinpalkovic changed the title Fix function prop rendering as noRefCheck in storybook docs Docs: Fix function prop rendering as noRefCheck in storybook docs Feb 27, 2024
@github-actions github-actions bot mentioned this pull request Feb 27, 2024
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants