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
Update examples to use wp-scripts 5.0.0 #89
Conversation
Since this was a large set of changes I additional bumped the plugin versions to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one. I like how this slowly gets easier to maintain. Next step is proposing to WP core a way to read the asset file to make the script registration a one liner 😃
🎉
Yes, I will close that one 👍 |
Updates the examples to use the syntax: import { ... } from '@wordpress/package'; instead of const { ... } = wp.package; This is more consistent and better for webpack and build setup. The gutenberg-examples repo was already switched to use import syntax in: WordPress/gutenberg-examples#89
I missed one thing when doing review. Those import statements should have the corresponding entries in package.json file in “dependencies” section. |
* Convert examples to use import syntax Updates the examples to use the syntax: import { ... } from '@wordpress/package'; instead of const { ... } = wp.package; This is more consistent and better for webpack and build setup. The gutenberg-examples repo was already switched to use import syntax in: WordPress/gutenberg-examples#89 * Update docs/designers-developers/developers/tutorials/block-tutorial/block-controls-toolbar-and-sidebar.md Co-Authored-By: Chris Van Patten <chris@vanpattenmedia.com> * Update docs/designers-developers/developers/tutorials/block-tutorial/creating-dynamic-blocks.md Co-Authored-By: Chris Van Patten <chris@vanpattenmedia.com>
Let's do all the updates...
import { ... } from '@wordpress/package'
Additionally, I removed the check for
register_block_type
function, since it is available in WP 5.0+. I don't think it is still necessary to show an example for it.Fixes #88
Fixes #90
Also probably makes PR #87 obsolete.