From dddf8b94acf7027b1355c85b1f2423b98880d011 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Sun, 16 Aug 2026 09:14:14 -0700 Subject: [PATCH 1/2] Manually exclude the `sync.js` files. This adds a temporary Grunt task to delete the remaining RTC-related files after building. --- Gruntfile.js | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 61f18481e23a8..3b48f41dfb552 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -80,6 +80,18 @@ module.exports = function(grunt) { SOURCE_DIR + 'wp-includes/assets/script-modules-packages.php', ], + /* + * Files included in the `/gutenberg` directory that should be excluded. + * + * `tools/gutenberg/copy.js` copies every package under `gutenberg/build/scripts/` + * indiscriminately. These files are not properly excluded from the built zip file + * built for WordPress Core, so they need to be ecluded manually instead. + */ + gutenbergExcludedCoreFiles = [ + 'wp-includes/js/dist/sync.js', + 'wp-includes/js/dist/sync.min.js', + ], + // All files built by Webpack, in /src or /build. // Webpack only builds Core-specific media files and development scripts. // Blocks, packages, script modules, and vendors come from the Gutenberg build. @@ -1727,6 +1739,20 @@ module.exports = function(grunt) { } ); } ); + /* + * Remove files that are in the `gutenberg` directory that should be included in Core. + */ + grunt.registerTask( 'gutenberg:remove-excluded-files', 'Removes Gutenberg-sourced files that should not ship in WordPress Core.', function() { + gutenbergExcludedCoreFiles.forEach( function( file ) { + var filePath = WORKING_DIR + file; + + if ( fs.existsSync( filePath ) ) { + fs.unlinkSync( filePath ); + grunt.log.writeln( 'Removed ' + filePath ); + } + } ); + } ); + grunt.renameTask( 'watch', '_watch' ); grunt.registerTask( 'watch', function() { @@ -2238,7 +2264,8 @@ module.exports = function(grunt) { 'build:js', 'build:css', 'build:codemirror', - 'build:certificates' + 'build:certificates', + 'gutenberg:remove-excluded-files' ] ); } else { grunt.task.run( [ @@ -2250,7 +2277,8 @@ module.exports = function(grunt) { 'build:css', 'build:codemirror', 'replace:source-maps', - 'verify:build' + 'verify:build', + 'gutenberg:remove-excluded-files' ] ); } } ); From 97bf8af94fa7bcdfed7f09fd4bc33752ee85cffe Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Sun, 16 Aug 2026 09:19:00 -0700 Subject: [PATCH 2/2] Update `$_old_files`. --- src/wp-admin/includes/update-core.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php index e34716f0c8b24..9b4cdf377b45a 100644 --- a/src/wp-admin/includes/update-core.php +++ b/src/wp-admin/includes/update-core.php @@ -905,12 +905,8 @@ // 7.0.2 'wp-includes/collaboration', 'wp-includes/collaboration.php', - /* - * Restored in WordPress 7.1. - * - * 'wp-includes/js/dist/sync.js', - * 'wp-includes/js/dist/sync.min.js', - */ + 'wp-includes/js/dist/sync.js', + 'wp-includes/js/dist/sync.min.js', // 7.1 'wp-includes/images/icon-library/accordion-heading.svg', 'wp-includes/images/icon-library/accordion-item.svg',