whitespace-se / storybook-addon-html

A Storybook addon that extracts and displays compiled syntax-highlighted HTML
Other
95 stars 44 forks source link

Using the 'config' field #103

Closed noahbald closed 7 months ago

noahbald commented 1 year ago

When running the addon in Storybook 7.0.26, I get the following warning.

You (or an addon) are using the 'config' preset field. This has been replaced by 'previewAnnotations' and will be removed in 8.0

If I remove this addon, the warning goes away.

cotwitch commented 1 year ago

I'm also noticing this.

Occuring on Storybook 7.4.0 storybook-vite using @storybook/html and @storybook/html-vite

When fixed, this page could be "pinged" here

arcticShadow commented 1 year ago

Removing this line https://github.com/whitespace-se/storybook-addon-html/blob/main/preset.js#L15 seems to make the error go away in v7 of storybook.

From what I can tell, The change required for v7 appears to be that the config export is updated to previewAnnotations - however, since previewAnnotations is already there, it seems this addon is already correctly configured for v7.

Which leaves me thinking that it may be intentional to have both config and previewAnnotations exported. Although I don't know why - I have a theory with no basis or research, that it would be to support Storybook 6 & 7 at the same time.