<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[51268] trunk: Build/Test Tools: Revert [51259-51256,51265].</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/51268">51268</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/51268","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>desrosj</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2021-06-30 02:13:30 +0000 (Wed, 30 Jun 2021)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Build/Test Tools: Revert [51259-51256,51265].
<a href="https://core.trac.wordpress.org/changeset/51259">[51259]</a> introduced a PHP notice that was not actually fixed by <a href="https://core.trac.wordpress.org/changeset/51265">[51265]</a>. Reverting these changes in order to investigate further.
See <a href="https://core.trac.wordpress.org/ticket/53397">#53397</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkgitignore">trunk/.gitignore</a></li>
<li><a href="#trunkGruntfilejs">trunk/Gruntfile.js</a></li>
<li><a href="#trunksrcwpincludesblocksphp">trunk/src/wp-includes/blocks.php</a></li>
<li><a href="#trunksrcwpincludesclasswpblocktypephp">trunk/src/wp-includes/class-wp-block-type.php</a></li>
<li><a href="#trunktestsphpunitdatablocksnoticeblockjson">trunk/tests/phpunit/data/blocks/notice/block.json</a></li>
<li><a href="#trunktestsphpunittestsblocksregisterphp">trunk/tests/phpunit/tests/blocks/register.php</a></li>
<li><a href="#trunktoolswebpackpackagesjs">trunk/tools/webpack/packages.js</a></li>
<li><a href="#trunkwebpackconfigjs">trunk/webpack.config.js</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunktoolswebpackblocksjs">trunk/tools/webpack/blocks.js</a></li>
</ul>
<h3>Property Changed</h3>
<ul>
<li><a href="#trunksrcwpincludesblocksfile">trunk/src/wp-includes/blocks/file/</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkgitignore"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/.gitignore</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/.gitignore 2021-06-30 01:45:10 UTC (rev 51267)
+++ trunk/.gitignore 2021-06-30 02:13:30 UTC (rev 51268)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,9 +29,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /src/wp-includes/css/*.min.css
</span><span class="cx" style="display: block; padding: 0 10px"> /src/wp-includes/css/*-rtl.css
</span><span class="cx" style="display: block; padding: 0 10px"> /src/wp-includes/blocks/**/*.css
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/src/wp-includes/blocks/**/*.js
-/src/wp-includes/blocks/**/*.js.map
-/src/wp-includes/blocks/**/*.asset.php
</del><span class="cx" style="display: block; padding: 0 10px"> /packagehash.txt
</span><span class="cx" style="display: block; padding: 0 10px"> /artifacts
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunkGruntfilejs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/Gruntfile.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/Gruntfile.js 2021-06-30 01:45:10 UTC (rev 51267)
+++ trunk/Gruntfile.js 2021-06-30 02:13:30 UTC (rev 51268)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -996,7 +996,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> WORKING_DIR + 'wp-{admin,includes}/**/*.js',
</span><span class="cx" style="display: block; padding: 0 10px"> WORKING_DIR + 'wp-content/themes/twenty*/**/*.js',
</span><span class="cx" style="display: block; padding: 0 10px"> '!' + WORKING_DIR + 'wp-content/themes/twenty*/node_modules/**/*.js',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- '!' + WORKING_DIR + 'wp-includes/blocks/**/*.js',
</del><span class="cx" style="display: block; padding: 0 10px"> '!' + WORKING_DIR + 'wp-includes/js/dist/**/*.js',
</span><span class="cx" style="display: block; padding: 0 10px"> ]
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">Index: trunk/src/wp-includes/blocks/file
</span><span class="cx" style="display: block; padding: 0 10px">===================================================================
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">--- trunk/src/wp-includes/blocks/file 2021-06-30 01:45:10 UTC (rev 51267)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+++ trunk/src/wp-includes/blocks/file 2021-06-30 02:13:30 UTC (rev 51268)
</ins></span></pre></div>
<a id="trunksrcwpincludesblocksfile"></a>
<div class="propset"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Property changes: trunk/src/wp-includes/blocks/file</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnignore"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: svn:ignore</h4></div>
<span class="cx" style="display: block; padding: 0 10px"> *.css
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-*.asset.php
-*.js
-*.js.map
</del><a id="trunksrcwpincludesblocksphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/blocks.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/blocks.php 2021-06-30 01:45:10 UTC (rev 51267)
+++ trunk/src/wp-includes/blocks.php 2021-06-30 02:13:30 UTC (rev 51268)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,9 +42,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 0 === strpos( $field_name, 'editor' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $asset_handle .= '-editor';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 0 === strpos( $field_name, 'view' ) ) {
- $asset_handle .= '-view';
- }
</del><span class="cx" style="display: block; padding: 0 10px"> return $asset_handle;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,7 +48,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $field_mappings = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'editorScript' => 'editor-script',
</span><span class="cx" style="display: block; padding: 0 10px"> 'script' => 'script',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'viewScript' => 'view-script',
</del><span class="cx" style="display: block; padding: 0 10px"> 'editorStyle' => 'editor-style',
</span><span class="cx" style="display: block; padding: 0 10px"> 'style' => 'style',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -105,23 +101,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $is_core_block = isset( $metadata['file'] ) && 0 === strpos( $metadata['file'], ABSPATH . WPINC );
- $script_uri = $is_core_block ?
- includes_url( str_replace( ABSPATH . WPINC, '', realpath( dirname( $metadata['file'] ) . '/' . $script_path ) ) ) :
- plugins_url( $script_path, $metadata['file'] );
- $script_asset = require $script_asset_path;
- $script_dependencies = isset( $script_asset['dependencies'] ) ? $script_asset['dependencies'] : array();
- $result = wp_register_script(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $script_asset = require $script_asset_path;
+ $result = wp_register_script(
</ins><span class="cx" style="display: block; padding: 0 10px"> $script_handle,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $script_uri,
- $script_dependencies,
- isset( $script_asset['version'] ) ? $script_asset['version'] : false
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ plugins_url( $script_path, $metadata['file'] ),
+ $script_asset['dependencies'],
+ $script_asset['version']
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $metadata['textdomain'] ) && in_array( 'wp-i18n', $script_dependencies ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $metadata['textdomain'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_set_script_translations( $script_handle, $metadata['textdomain'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -320,13 +311,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $metadata['viewScript'] ) ) {
- $settings['view_script'] = register_block_script_handle(
- $metadata,
- 'viewScript'
- );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $metadata['editorStyle'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $settings['editor_style'] = register_block_style_handle(
</span><span class="cx" style="display: block; padding: 0 10px"> $metadata,
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpblocktypephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-block-type.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-block-type.php 2021-06-30 01:45:10 UTC (rev 51267)
+++ trunk/src/wp-includes/class-wp-block-type.php 2021-06-30 02:13:30 UTC (rev 51268)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -156,7 +156,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $provides_context = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Block type editor only script handle.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Block type editor script handle.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string|null
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -164,7 +164,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $editor_script = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Block type front end and editor script handle.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Block type front end script handle.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string|null
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -172,16 +172,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $script = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Block type front end only script handle.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Block type editor style handle.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 5.8.0
- * @var string|null
- */
- public $view_script = null;
-
- /**
- * Block type editor only style handle.
- *
</del><span class="cx" style="display: block; padding: 0 10px"> * @since 5.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string|null
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -188,7 +180,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $editor_style = null;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Block type front end and editor style handle.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Block type front end style handle.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string|null
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -233,11 +225,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type array|null $attributes Block type attributes property schemas.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type array $uses_context Context values inherited by blocks of this type.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type array|null $provides_context Context provided by blocks of this type.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string|null $editor_script Block type editor only script handle.
- * @type string|null $script Block type front end and editor script handle.
- * @type string|null $view_script Block type front end only script handle.
- * @type string|null $editor_style Block type editor only style handle.
- * @type string|null $style Block type front end and editor style handle.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @type string|null $editor_script Block type editor script handle.
+ * @type string|null $script Block type front end script handle.
+ * @type string|null $editor_style Block type editor style handle.
+ * @type string|null $style Block type front end style handle.
</ins><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __construct( $block_type, $args = array() ) {
</span></span></pre></div>
<a id="trunktestsphpunitdatablocksnoticeblockjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/blocks/notice/block.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/notice/block.json 2021-06-30 01:45:10 UTC (rev 51267)
+++ trunk/tests/phpunit/data/blocks/notice/block.json 2021-06-30 02:13:30 UTC (rev 51268)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,7 +48,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "editorScript": "tests-notice-editor-script",
</span><span class="cx" style="display: block; padding: 0 10px"> "script": "tests-notice-script",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "viewScript": "tests-notice-view-script",
</del><span class="cx" style="display: block; padding: 0 10px"> "editorStyle": "tests-notice-editor-style",
</span><span class="cx" style="display: block; padding: 0 10px"> "style": "tests-notice-style"
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsblocksregisterphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/blocks/register.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/register.php 2021-06-30 01:45:10 UTC (rev 51267)
+++ trunk/tests/phpunit/tests/blocks/register.php 2021-06-30 02:13:30 UTC (rev 51268)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -133,10 +133,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> generate_block_asset_handle( $block_name, 'script' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'unit-tests-my-block-view-script',
- generate_block_asset_handle( $block_name, 'viewScript' )
- );
- $this->assertSame(
</del><span class="cx" style="display: block; padding: 0 10px"> 'unit-tests-my-block-editor-style',
</span><span class="cx" style="display: block; padding: 0 10px"> generate_block_asset_handle( $block_name, 'editorStyle' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,10 +157,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> generate_block_asset_handle( $block_name, 'script' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'wp-block-paragraph-view',
- generate_block_asset_handle( $block_name, 'viewScript' )
- );
- $this->assertSame(
</del><span class="cx" style="display: block; padding: 0 10px"> 'wp-block-paragraph-editor',
</span><span class="cx" style="display: block; padding: 0 10px"> generate_block_asset_handle( $block_name, 'editorStyle' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -380,7 +372,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'tests-notice-editor-script', $result->editor_script );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'tests-notice-script', $result->script );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( 'tests-notice-view-script', $result->view_script );
</del><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'tests-notice-editor-style', $result->editor_style );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 'tests-notice-style', $result->style );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktoolswebpackblocksjs"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tools/webpack/blocks.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tools/webpack/blocks.js 2021-06-30 01:45:10 UTC (rev 51267)
+++ trunk/tools/webpack/blocks.js 2021-06-30 02:13:30 UTC (rev 51268)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,212 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * External dependencies
- */
-const { DefinePlugin } = require( 'webpack' );
-const CopyWebpackPlugin = require( 'copy-webpack-plugin' );
-const postcss = require( 'postcss' );
-const UglifyJS = require( 'uglify-js' );
-
-const { join, basename } = require( 'path' );
-const { get } = require( 'lodash' );
-
-/**
- * WordPress dependencies
- */
-const DependencyExtractionPlugin = require( '@wordpress/dependency-extraction-webpack-plugin' );
-
-const baseDir = join( __dirname, '../../' );
-
-module.exports = function( env = { environment: 'production', watch: false, buildTarget: false } ) {
- const mode = env.environment;
- const suffix = mode === 'production' ? '.min' : '';
- let buildTarget = env.buildTarget ? env.buildTarget : ( mode === 'production' ? 'build' : 'src' );
- buildTarget = buildTarget + '/wp-includes';
-
- const dynamicBlockFolders = [
- 'archives',
- 'block',
- 'calendar',
- 'categories',
- 'file',
- 'latest-comments',
- 'latest-posts',
- 'loginout',
- 'page-list',
- 'post-content',
- 'post-date',
- 'post-excerpt',
- 'post-featured-image',
- 'post-terms',
- 'post-title',
- 'post-template',
- 'query',
- 'query-pagination',
- 'query-pagination-next',
- 'query-pagination-numbers',
- 'query-pagination-previous',
- 'query-title',
- 'rss',
- 'search',
- 'shortcode',
- 'site-logo',
- 'site-tagline',
- 'site-title',
- 'social-link',
- 'tag-cloud',
- ];
- const blockFolders = [
- 'audio',
- 'button',
- 'buttons',
- 'code',
- 'column',
- 'columns',
- 'cover',
- 'embed',
- 'freeform',
- 'gallery',
- 'group',
- 'heading',
- 'html',
- 'image',
- 'list',
- 'media-text',
- 'missing',
- 'more',
- 'nextpage',
- 'paragraph',
- 'preformatted',
- 'pullquote',
- 'quote',
- 'separator',
- 'social-links',
- 'spacer',
- 'table',
- 'text-columns',
- 'verse',
- 'video',
- ...dynamicBlockFolders,
- ];
- const blockPHPFiles = {
- 'widgets/src/blocks/legacy-widget/index.php': 'wp-includes/blocks/legacy-widget.php',
- ...dynamicBlockFolders.reduce( ( files, blockName ) => {
- files[ `block-library/src/${ blockName }/index.php` ] = `wp-includes/blocks/${ blockName }.php`;
- return files;
- } , {} ),
- };
- const blockMetadataFiles = {
- 'widgets/src/blocks/legacy-widget/block.json': 'wp-includes/blocks/legacy-widget/block.json',
- ...blockFolders.reduce( ( files, blockName ) => {
- files[ `block-library/src/${ blockName }/block.json` ] = `wp-includes/blocks/${ blockName }/block.json`;
- return files;
- } , {} ),
- };
-
- const blockPHPCopies = Object.keys( blockPHPFiles ).map( ( filename ) => ( {
- from: join( baseDir, `node_modules/@wordpress/${ filename }` ),
- to: join( baseDir, `src/${ blockPHPFiles[ filename ] }` ),
- } ) );
-
- const blockMetadataCopies = Object.keys( blockMetadataFiles ).map( ( filename ) => ( {
- from: join( baseDir, `node_modules/@wordpress/${ filename }` ),
- to: join( baseDir, `src/${ blockMetadataFiles[ filename ] }` ),
- } ) );
-
- const blockStylesheetCopies = blockFolders.map( ( blockName ) => ( {
- from: join( baseDir, `node_modules/@wordpress/block-library/build-style/${ blockName }/*.css` ),
- to: join( baseDir, `${ buildTarget }/blocks/${ blockName }/` ),
- flatten: true,
- transform: ( content ) => {
- if ( mode === 'production' ) {
- return postcss( [
- require( 'cssnano' )( {
- preset: 'default',
- } ),
- ] )
- .process( content, { from: 'src/app.css', to: 'dest/app.css' } )
- .then( ( result ) => result.css );
- }
-
- return content;
- },
- transformPath: ( targetPath, sourcePath ) => {
- if ( mode === 'production' ) {
- return targetPath.replace( /\.css$/, '.min.css' );
- }
-
- return targetPath;
- }
- } ) );
-
- const config = {
- mode,
- entry: {
- 'file/view': join( baseDir, `node_modules/@wordpress/block-library/build-module/file/view` ),
- },
- output: {
- devtoolNamespace: 'wp',
- filename: `[name]${ suffix }.js`,
- path: join( baseDir, `${ buildTarget }/blocks` ),
- },
- resolve: {
- modules: [
- baseDir,
- 'node_modules',
- ],
- alias: {
- 'lodash-es': 'lodash',
- },
- },
- module: {
- rules: [
- {
- test: /\.js$/,
- use: [ 'source-map-loader' ],
- enforce: 'pre',
- },
- ],
- },
- optimization: {
- moduleIds: mode === 'production' ? 'hashed' : 'named',
- },
- plugins: [
- new DefinePlugin( {
- // Inject the `GUTENBERG_PHASE` global, used for feature flagging.
- 'process.env.GUTENBERG_PHASE': 1,
- 'process.env.FORCE_REDUCED_MOTION': JSON.stringify(
- process.env.FORCE_REDUCED_MOTION
- ),
- } ),
- new DependencyExtractionPlugin( {
- injectPolyfill: true,
- } ),
- new CopyWebpackPlugin(
- [
- ...blockPHPCopies,
- ...blockMetadataCopies,
- ...blockStylesheetCopies,
- ],
- ),
- ],
- stats: {
- children: false,
- },
-
- watch: env.watch,
- };
-
- if ( config.mode !== 'production' ) {
- config.devtool = process.env.SOURCEMAP || 'source-map';
- }
-
- if ( mode === 'development' && env.buildTarget === 'build/' ) {
- delete config.devtool;
- config.mode = 'production';
- config.optimization = {
- minimize: false,
- moduleIds: 'hashed',
- };
- }
-
- return config;
-};
</del></span></pre></div>
<a id="trunktoolswebpackpackagesjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tools/webpack/packages.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tools/webpack/packages.js 2021-06-30 01:45:10 UTC (rev 51267)
+++ trunk/tools/webpack/packages.js 2021-06-30 02:13:30 UTC (rev 51268)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -106,9 +106,86 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp-polyfill-dom-rect.min.js': 'polyfill-library/polyfills/__dist/DOMRect/raw.js',
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const dynamicBlockFolders = [
+ 'archives',
+ 'block',
+ 'calendar',
+ 'categories',
+ 'file',
+ 'latest-comments',
+ 'latest-posts',
+ 'loginout',
+ 'page-list',
+ 'post-content',
+ 'post-date',
+ 'post-excerpt',
+ 'post-featured-image',
+ 'post-terms',
+ 'post-title',
+ 'post-template',
+ 'query',
+ 'query-pagination',
+ 'query-pagination-next',
+ 'query-pagination-numbers',
+ 'query-pagination-previous',
+ 'query-title',
+ 'rss',
+ 'search',
+ 'shortcode',
+ 'site-logo',
+ 'site-tagline',
+ 'site-title',
+ 'social-link',
+ 'tag-cloud',
+ ];
+ const blockFolders = [
+ 'audio',
+ 'button',
+ 'buttons',
+ 'code',
+ 'column',
+ 'columns',
+ 'cover',
+ 'embed',
+ 'freeform',
+ 'gallery',
+ 'group',
+ 'heading',
+ 'html',
+ 'image',
+ 'list',
+ 'media-text',
+ 'missing',
+ 'more',
+ 'nextpage',
+ 'paragraph',
+ 'preformatted',
+ 'pullquote',
+ 'quote',
+ 'separator',
+ 'social-links',
+ 'spacer',
+ 'table',
+ 'text-columns',
+ 'verse',
+ 'video',
+ ...dynamicBlockFolders,
+ ];
</ins><span class="cx" style="display: block; padding: 0 10px"> const phpFiles = {
</span><span class="cx" style="display: block; padding: 0 10px"> 'block-serialization-default-parser/parser.php': 'wp-includes/class-wp-block-parser.php',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'widgets/src/blocks/legacy-widget/index.php': 'wp-includes/blocks/legacy-widget.php',
+ ...dynamicBlockFolders.reduce( ( files, blockName ) => {
+ files[ `block-library/src/${ blockName }/index.php` ] = `wp-includes/blocks/${ blockName }.php`;
+ return files;
+ } , {} ),
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const blockMetadataFiles = {
+ 'widgets/src/blocks/legacy-widget/block.json': 'wp-includes/blocks/legacy-widget/block.json',
+ ...blockFolders.reduce( ( files, blockName ) => {
+ files[ `block-library/src/${ blockName }/block.json` ] = `wp-includes/blocks/${ blockName }/block.json`;
+ return files;
+ } , {} ),
+ };
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> const developmentCopies = mapVendorCopies( vendors, buildTarget );
</span><span class="cx" style="display: block; padding: 0 10px"> const minifiedCopies = mapVendorCopies( minifiedVendors, buildTarget );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -154,6 +231,37 @@
</span><span class="cx" style="display: block; padding: 0 10px"> to: join( baseDir, `src/${ phpFiles[ filename ] }` ),
</span><span class="cx" style="display: block; padding: 0 10px"> } ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const blockMetadataCopies = Object.keys( blockMetadataFiles ).map( ( filename ) => ( {
+ from: join( baseDir, `node_modules/@wordpress/${ filename }` ),
+ to: join( baseDir, `src/${ blockMetadataFiles[ filename ] }` ),
+ } ) );
+
+ const blockStylesheetCopies = blockFolders.map( ( blockName ) => ( {
+ from: join( baseDir, `node_modules/@wordpress/block-library/build-style/${ blockName }/*.css` ),
+ to: join( baseDir, `${ buildTarget }/blocks/${ blockName }/` ),
+ flatten: true,
+ transform: ( content ) => {
+ if ( mode === 'production' ) {
+ return postcss( [
+ require( 'cssnano' )( {
+ preset: 'default',
+ } ),
+ ] )
+ .process( content, { from: 'src/app.css', to: 'dest/app.css' } )
+ .then( ( result ) => result.css );
+ }
+
+ return content;
+ },
+ transformPath: ( targetPath, sourcePath ) => {
+ if ( mode === 'production' ) {
+ return targetPath.replace( /\.css$/, '.min.css' );
+ }
+
+ return targetPath;
+ }
+ } ) );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> const config = {
</span><span class="cx" style="display: block; padding: 0 10px"> mode,
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -244,6 +352,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ...vendorCopies,
</span><span class="cx" style="display: block; padding: 0 10px"> ...cssCopies,
</span><span class="cx" style="display: block; padding: 0 10px"> ...phpCopies,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ...blockMetadataCopies,
+ ...blockStylesheetCopies,
</ins><span class="cx" style="display: block; padding: 0 10px"> ],
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ],
</span></span></pre></div>
<a id="trunkwebpackconfigjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/webpack.config.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/webpack.config.js 2021-06-30 01:45:10 UTC (rev 51267)
+++ trunk/webpack.config.js 2021-06-30 02:13:30 UTC (rev 51268)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,4 +1,3 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-const blocksConfig = require( './tools/webpack/blocks' );
</del><span class="cx" style="display: block; padding: 0 10px"> const mediaConfig = require( './tools/webpack/media' );
</span><span class="cx" style="display: block; padding: 0 10px"> const packagesConfig = require( './tools/webpack/packages' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,7 +11,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> const config = [
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- blocksConfig( env ),
</del><span class="cx" style="display: block; padding: 0 10px"> mediaConfig( env ),
</span><span class="cx" style="display: block; padding: 0 10px"> packagesConfig( env ),
</span><span class="cx" style="display: block; padding: 0 10px"> ];
</span></span></pre>
</div>
</div>
</body>
</html>