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

Dependency update PR broke Storybook source snippets #1913

Closed
fredvisser opened this issue Mar 7, 2024 · 1 comment Β· Fixed by #1918
Closed

Dependency update PR broke Storybook source snippets #1913

fredvisser opened this issue Mar 7, 2024 · 1 comment Β· Fixed by #1918
Labels
bug Something isn't working

Comments

@fredvisser
Copy link
Contributor

πŸ› Bug Report

It looks like PR #1905 was responsible for breaking Storybook source snippets. I.e.

Screenshot 2024-03-07 at 3 57 53β€―PM

πŸ’» Repro or Code Sample

Source snippets worked with the "Select placeholder (#1842)" PR – Chromatic Storybook

Source snippets fail with [object Promise] with the "Dependency Updates March 2024 (#1905)" PR – Chromatic Storybook

πŸ€” Expected Behavior

Screenshot 2024-03-07 at 4 02 59β€―PM

😯 Current Behavior

Screenshot 2024-03-07 at 3 57 53β€―PM

πŸ’ Possible Solution

πŸ”¦ Context

🌍 Your Environment

  • OS & Device: macOS
  • Browser: all
@fredvisser fredvisser added bug Something isn't working triage New issue that needs to be reviewed labels Mar 7, 2024
@rajsite
Copy link
Member

rajsite commented Mar 10, 2024

Prettier was updated as part of the dependency updates which formats the snippets and made their APIs async. The transform function in storybook does not support async yet and it's not on the roadmap.

rajsite added a commit that referenced this issue Mar 12, 2024
# Pull Request

## 🀨 Rationale

Fixes #1913 by using `js-beautify` instead of `prettier: ^3` in
`transformSource.js`.

## πŸ‘©β€πŸ’» Implementation

1. Leverage a popular code formatting tool -
https://www.npmjs.com/package/js-beautify
2. Used the default formatting settings, as they looked correct to me.

## πŸ§ͺ Testing

Manual review of Storybook docs pages. 

## βœ… Checklist

<!--- Review the list and put an x in the boxes that apply or ~~strike
through~~ around items that don't (along with an explanation). -->

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.

---------

Co-authored-by: rajsite <[email protected]>
@m-akinc m-akinc removed the triage New issue that needs to be reviewed label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

3 participants