Closed mirka closed 2 days ago
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot
label.
If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.
Size Change: 0 B
Total Size: 1.81 MB
What?
Ensure that console warnings using
@wordpress/warning
are also properly logged in Storybook when in dev mode.Why?
warning()
messages were not logged in Storybook, even when in dev mode. This is inconvenient because we often check for these things using Storybook.How?
warning()
checks for dev mode using theSCRIPT_DEBUG
global.https://github.com/WordPress/gutenberg/blob/7714bce8d9356707a020b5d7df84797832c423f8/packages/warning/src/index.ts#L6-L9
We should inject this with Webpack, similar to how the wp packages are built:
https://github.com/WordPress/gutenberg/blob/7714bce8d9356707a020b5d7df84797832c423f8/tools/webpack/shared.js#L75
Testing Instructions
See the "With Actions" story for Snackbar. Adding multiple actions to the
actions
array should log a console warning.https://github.com/WordPress/gutenberg/blob/7714bce8d9356707a020b5d7df84797832c423f8/packages/components/src/snackbar/index.tsx#L119-L123
Alter the story args here so there are multiple actions:
https://github.com/WordPress/gutenberg/blob/7714bce8d9356707a020b5d7df84797832c423f8/packages/components/src/snackbar/stories/index.story.tsx#L59-L64