-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Bug]: deprecation warnings when older icons are being used #25760
Comments
Tempted to make this a beta blocker if we can squeeze it in. It's an easy fix and will reduce the noise, allowing us and users to flag other error/warning messages more easily @vanessayuenn |
I'm working on it now @shilman so hopefully it should be done for Beta. |
Why was this issue closed? The official docs for custom toolbar buttons still show the same method of adding an icon, which causes the deprecation warning |
OP is exactly my scenario, following the theme-switching docs and getting the same icon deprecation warning. Using the latest Storybook 8.1.5 w/ Next.js framework in a fresh setup. |
I have the same deprecation warning and indeed, following the doc of v8.1, we are still recommended to use icons from @storybook/components : Why this issue has been closed ? is there a workaround ? |
@lunelson @notacouch @solyane2002 thanks for bringing this up. The documentation should indeed be updated. Meanwhile, the same icons should be imported from |
Thanks @vanessayuenn — how would we work with the globalTypes API to create icons for toolbar items then? These expect a string identifier: https://storybook.js.org/docs/essentials/toolbars-and-globals#globals |
In the documentation, any reference to |
Actually it does seem to be fixed in the latest version, for me. In a previous patch version, adding this property to the default export of globalTypes: {
graticule: {
description: 'Toggle the Graticule in preview area',
type: 'string',
defaultValue: 'visible',
toolbar: {
icon: 'component', // <--- this line was the problem
items: [
{ value: 'off', title: 'Off' },
{ value: 'hidden', title: 'Hidden' },
{ value: 'visible', title: 'Visible' },
],
},
},
}, |
Here's a minimal repro: https://stackblitz.com/edit/github-mqgxvo?file=.storybook%2Fpreview.js The console warning appears when clicking the 'Click me!' in the toolbar. |
Describe the bug
Project: MealDrop
Version: 8.0.0-alpha.14
Bug/feedback:
It seems that not all parts of Storybook are using the new icons, so the browser console gets many deprecation warnings when older icons are being used such as:
Scenario 1:
When using addon-interactions and accessing a story that contains a play function. The addon interactions panel seems to be using old icons (check, play).
Scenario 2:
When creating your own toolbar (from official docs), you can define icons via their name like so:
When clicking on the newly created toolbar button, you will get as many warnings as the amount of icons you create:
![image](https://private-user-images.githubusercontent.com/1671563/299373904-d4925d79-cf0a-44a9-ae87-6d7381bf9c7f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMDkxMzMsIm5iZiI6MTczOTEwODgzMywicGF0aCI6Ii8xNjcxNTYzLzI5OTM3MzkwNC1kNDkyNWQ3OS1jZjBhLTQ0YTktYWU4Ny02ZDczODFiZjljN2YucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDlUMTM0NzEzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDMxZjBkNmVlZjI0YzAyYTU4NjU4YTYyYmVlODlmMGYyNmFjMDZmOTg5MDJmN2UyNmI3NGRkYmM4NTFjZTA3NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.QM-J-4ve28qLQx_gfcokvmkjDynnM3J9LtjrVquQGq8)
To Reproduce
2.1 Open the
Page - Logged In
story2.2 Click on the circle toolbar
System
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: