-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Packages: Add the blocks module to the packages folder #8046
Conversation
@@ -78,6 +78,13 @@ function gutenberg_register_scripts_and_styles() { | |||
// WordPress packages. | |||
wp_register_script( 'wp-tinymce', includes_url( 'js/tinymce/' ) . 'wp-tinymce.php', array() ); | |||
|
|||
wp_register_script( | |||
'wp-autop', |
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.
For some reason, autop was not a separate script but was bundled.
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.
url
and wordcount
are also bundled into something, I bet editor
or edit-post
.
1f708c1
to
87a7c23
Compare
/** | ||
* External dependencies | ||
*/ | ||
import { equal } from 'assert'; |
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.
I just removed assert in favor of Jest built-in asserters in all these tests
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.
Awesome, I like this 💯
* | ||
* @param {Object} definitions Server-side block definitions | ||
*/ | ||
export function unstable__bootstrapServerSideBlockDefinitions( definitions ) { // eslint-disable-line camelcase |
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.
This allows us to get rid of the global but it's unstable because the way we do this will change when we do #6733. I'm leaving the work for the final API here for the server-side registration work.
87a7c23
to
3261f08
Compare
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.
I added 4 very tiny commits to make Travis happy and ensure package.json
aligns with others.
Everything looks great and tests well. Let's get it in and continue our efforts with the remaining modules 🎉
Awesome work @youknowriad 🥇
wp_localize_script( 'wp-blocks', '_wpBlocks', gutenberg_prepare_blocks_for_js() ); | ||
wp_add_inline_script( | ||
'wp-blocks', | ||
'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . json_encode( gutenberg_prepare_blocks_for_js() ) . ');' |
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.
yes, nice 👍
Description
Part of #3955.
This PR extracts new
@wordpress/blocks
package.How has this been tested?
Make sure all tests pass