-
Notifications
You must be signed in to change notification settings - Fork 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
Convert examples to use import syntax #17502
Conversation
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
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.
Two small nits :) Love this!
...signers-developers/developers/tutorials/block-tutorial/block-controls-toolbar-and-sidebar.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/tutorials/block-tutorial/creating-dynamic-blocks.md
Outdated
Show resolved
Hide resolved
…block-controls-toolbar-and-sidebar.md Co-Authored-By: Chris Van Patten <chris@vanpattenmedia.com>
…creating-dynamic-blocks.md Co-Authored-By: Chris Van Patten <chris@vanpattenmedia.com>
How do we communicate that those import statements should have the corresponding entries in package.json file in “dependencies” section? We can include ESLint rule which helps with validation of whether imported dependencies are listed in package.json file. Although there is some bug in ESLint which mades its usage in wp-scripts complicated... |
@gziolo doesn't the reading and including of the dependencies of |
We use externals for all of them so you are correct. As long as they aren't referenced outside of WordPress context, e.g. unit tests, it should be all fine as is 👍 |
Description
Updates the examples to use the syntax:
instead of
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
Types of changes
Documentation.