Skip to content

Commit

Permalink
Restore previous script order
Browse files Browse the repository at this point in the history
amp-editor-blocks needs to run after amp-block-editor
  • Loading branch information
swissspidy committed May 14, 2019
1 parent d49b54d commit e95bc41
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion includes/admin/class-amp-editor-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function enqueue_block_editor_assets() {
wp_enqueue_script(
'amp-editor-blocks',
amp_get_asset_url( 'js/amp-editor-blocks.js' ),
array( 'wp-dom-ready', 'wp-editor', 'wp-edit-post', 'wp-blocks', 'lodash', 'wp-i18n', 'wp-element', 'wp-components' ),
array( 'wp-dom-ready', 'wp-editor', 'wp-edit-post', 'wp-blocks', 'lodash', 'wp-i18n', 'wp-element', 'wp-components', 'amp-block-editor' ),
AMP__VERSION,
true
);
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/class-amp-post-meta-box.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function enqueue_block_assets() {
wp_enqueue_script(
self::BLOCK_ASSET_HANDLE,
amp_get_asset_url( 'js/' . self::BLOCK_ASSET_HANDLE . '.js' ),
array( 'wp-hooks', 'wp-i18n', 'wp-components', 'amp-editor-blocks' ),
array( 'wp-hooks', 'wp-i18n', 'wp-components' ),
AMP__VERSION,
true
);
Expand Down
2 changes: 1 addition & 1 deletion includes/class-amp-story-post-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ public static function enqueue_block_editor_scripts() {
wp_enqueue_script(
'amp-story-editor',
amp_get_asset_url( 'js/amp-stories.js' ),
array( 'wp-dom-ready', 'wp-editor', 'wp-edit-post', 'wp-blocks', 'lodash', 'wp-i18n', 'wp-element', 'wp-components', 'amp-editor-blocks' ),
array( 'wp-dom-ready', 'wp-editor', 'wp-edit-post', 'wp-blocks', 'lodash', 'wp-i18n', 'wp-element', 'wp-components', 'amp-editor-block' ),
AMP__VERSION,
false
);
Expand Down
2 changes: 1 addition & 1 deletion tests/test-class-amp-editor-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function test_enqueue_block_editor_assets() {

$this->assertEquals( $slug, $script->handle );
$this->assertEquals(
array( 'wp-dom-ready', 'wp-editor', 'wp-edit-post', 'wp-blocks', 'lodash', 'wp-i18n', 'wp-element', 'wp-components' ),
array( 'wp-dom-ready', 'wp-editor', 'wp-edit-post', 'wp-blocks', 'lodash', 'wp-i18n', 'wp-element', 'wp-components', 'amp-block-editor' ),
$script->deps
);
$this->assertContains( $expected_file_name, $script->src );
Expand Down

0 comments on commit e95bc41

Please sign in to comment.