Packages: Add the blocks module to the packages folder#8046
Conversation
lib/client-assets.php
Outdated
There was a problem hiding this comment.
For some reason, autop was not a separate script but was bundled.
There was a problem hiding this comment.
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.
I just removed assert in favor of Jest built-in asserters in all these tests
| * | ||
| * @param {Object} definitions Server-side block definitions | ||
| */ | ||
| export function unstable__bootstrapServerSideBlockDefinitions( definitions ) { // eslint-disable-line camelcase |
There was a problem hiding this comment.
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
gziolo
left a comment
There was a problem hiding this comment.
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() ) . ');' |
Description
Part of #3955.
This PR extracts new
@wordpress/blockspackage.How has this been tested?
Make sure all tests pass