Allow async transform docs.source.transform #23703
SimmeNilsson
started this conversation in
Ideas
Replies: 2 comments
-
Also interested in this |
Beta Was this translation helpful? Give feedback.
0 replies
-
The HTML preview addon needs Prettier 3 to format source in Story view, but we can't use Prettier 3 if we use prettier in |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
Prettier has recently switch to an async API.
We are using prettier format in docs.source.transform.
https://storybook.js.org/docs/html/api/doc-block-source#transform
Describe the solution you'd like
Would it be possible to allow for a Promise to be returned from transform?
Describe alternatives you've considered
Tried @prettier/sync but it is dependent on node worker_threads. Breaks storybook build.
Are you able to assist to bring the feature to reality?
no
Additional context
Example of usage, but format is async in prettier 3.x.
transform: (input: string) => { return prettier.format(input, { parser: "html", plugins: [prettierHtml] }); }
Beta Was this translation helpful? Give feedback.
All reactions