From b069c2c59c67377741c9590f243361ce9f142569 Mon Sep 17 00:00:00 2001 From: Adam Wood <1017872+adamwoodnz@users.noreply.github.com> Date: Thu, 12 Nov 2026 12:13:02 +1300 Subject: [PATCH 1/6] fix(wp-build-polyfills): Replace Core's widget-primitives WordPress 7.2 registers its own @wordpress/widget-primitives script module, built from Gutenberg's wp/7.2 branch, which carries 0.10.0. register_modules() assumed Core never shipped the module, so with no Gutenberg active it left that registration in place and wp_register_script_module() silently discarded the bundled 0.11.0. Premium Analytics imports useWidgetIdentity, added in 0.11.0, at module scope, so the import map handed the dashboard a module without that export and the page blanked with "Something went wrong". WP 7.1.x escaped it by registering no such module, and Gutenberg 24.4.0 or later by winning the registration with a copy new enough to use. A supported Gutenberg still keeps its copy untouched. Only the branch where nothing has vouched for the registration replaces it, so the bundled copy also serves every other wp-build dashboard on 7.2. --- .../fix-stats-620-widget-primitives-core-copy | 4 ++++ .../src/class-wp-build-polyfills.php | 20 ++++++++++++------- .../tests/php/WP_Build_Polyfills_Test.php | 13 ++++++++++++ .../fix-stats-620-widget-primitives-core-copy | 4 ++++ .../fix-stats-620-widget-primitives-core-copy | 4 ++++ .../fix-stats-620-widget-primitives-core-copy | 4 ++++ 6 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 projects/packages/wp-build-polyfills/changelog/fix-stats-620-widget-primitives-core-copy create mode 100644 projects/plugins/jetpack/changelog/fix-stats-620-widget-primitives-core-copy create mode 100644 projects/plugins/premium-analytics/changelog/fix-stats-620-widget-primitives-core-copy create mode 100644 projects/plugins/stats/changelog/fix-stats-620-widget-primitives-core-copy diff --git a/projects/packages/wp-build-polyfills/changelog/fix-stats-620-widget-primitives-core-copy b/projects/packages/wp-build-polyfills/changelog/fix-stats-620-widget-primitives-core-copy new file mode 100644 index 000000000000..034ab3ea89fa --- /dev/null +++ b/projects/packages/wp-build-polyfills/changelog/fix-stats-620-widget-primitives-core-copy @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Serve the bundled widget-primitives script module over the copy WordPress registers from 7.2, which trails the exports the dashboards import. diff --git a/projects/packages/wp-build-polyfills/src/class-wp-build-polyfills.php b/projects/packages/wp-build-polyfills/src/class-wp-build-polyfills.php index c6ebb2a64848..98bdf43d2093 100644 --- a/projects/packages/wp-build-polyfills/src/class-wp-build-polyfills.php +++ b/projects/packages/wp-build-polyfills/src/class-wp-build-polyfills.php @@ -2,8 +2,9 @@ /** * Polyfill registration for Core packages not available or incomplete in older WordPress versions. * - * On WordPress 7.0 at the default threshold, only wp-private-apis and wp-rich-text replace Core's - * copies; every other polyfill fills in what Core lacks, or replaces a Gutenberg copy too old to use. + * On WordPress 7.0 at the default threshold, wp-private-apis and wp-rich-text replace Core's copies, + * and @wordpress/widget-primitives replaces Core's on every version; every other polyfill fills in + * what Core lacks, or replaces a Gutenberg copy too old to use. * * @package automattic/jetpack-wp-build-polyfills */ @@ -342,8 +343,9 @@ private static function is_gutenberg_version_safe( $minimum_version, $gutenberg_ * * Calls to wp_register_script_module() silently ignore duplicate registrations (first wins), so an * already registered module is left alone unless it is known to be too old for this package's - * current build: Gutenberg's copy below the minimum version, or another plugin's copy of this - * package bundling an older package version. Those are replaced. + * current build: Gutenberg's copy below the minimum version, another plugin's copy of this + * package bundling an older package version, or Core's own copy of a module the bundled build + * must serve. Those are replaced. * * @param string $build_dir Absolute path to the build directory. * @param string $base_file File path for plugins_url() computation. @@ -370,7 +372,8 @@ private static function register_modules( $build_dir, $base_file, $module_ids = // older ones lack exports the dashboard imports at module scope. The // replacement only adds exports, so Gutenberg's own consumers keep working. 'gutenberg_min_version' => self::GUTENBERG_WIDGET_PRIMITIVES_MIN_VERSION, - // Core never ships it, so outside Gutenberg the newest bundled copy wins. + // Outside a supported Gutenberg the newest bundled copy wins, over Core's + // registration as well as over another plugin's older copy. 'newest_copy_wins' => true, ), ); @@ -412,8 +415,11 @@ private static function register_modules( $build_dir, $base_file, $module_ids = $replace = true; $record = true; } else { - // With a supported Gutenberg its copy stays; otherwise nobody else ships it. - $record = null === $gutenberg_version || $gutenberg_too_old; + // A supported Gutenberg's copy stays. Any other registration is Core's, built + // from Gutenberg's wp/X branch and so behind the bundled copy — WP 7.2 ships + // widget-primitives 0.10.0, which has no `useWidgetIdentity`. + $record = null === $gutenberg_version || $gutenberg_too_old; + $replace = $record; } } diff --git a/projects/packages/wp-build-polyfills/tests/php/WP_Build_Polyfills_Test.php b/projects/packages/wp-build-polyfills/tests/php/WP_Build_Polyfills_Test.php index 5bdd4a827e5d..db947816ed70 100644 --- a/projects/packages/wp-build-polyfills/tests/php/WP_Build_Polyfills_Test.php +++ b/projects/packages/wp-build-polyfills/tests/php/WP_Build_Polyfills_Test.php @@ -905,6 +905,19 @@ public function test_register_modules_does_not_replace_widget_primitives_with_su $this->assertSame( '1.0.0-gutenberg', $module['version'] ); } + /** + * Core registers widget-primitives from WP 7.2, from a Gutenberg branch older than the bundled + * copy, so with no Gutenberg active the bundled copy has to displace it (STATS-620). + */ + public function test_register_modules_replaces_core_widget_primitives_without_gutenberg() { + $GLOBALS['wp_script_modules'] = new \WP_Script_Modules(); + wp_register_script_module( '@wordpress/widget-primitives', 'https://example.com/core-widget-primitives.js', array(), '1.0.0-core' ); + + $this->invoke_register_modules( $this->make_widget_primitives_build( '0.11.0', 'bundled' ) ); + + $this->assert_widget_primitives_from( 'bundled' ); + } + /** * A newer bundled widget-primitives replaces the copy another plugin registered first. */ diff --git a/projects/plugins/jetpack/changelog/fix-stats-620-widget-primitives-core-copy b/projects/plugins/jetpack/changelog/fix-stats-620-widget-primitives-core-copy new file mode 100644 index 000000000000..881c09ca97e7 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-stats-620-widget-primitives-core-copy @@ -0,0 +1,4 @@ +Significance: patch +Type: bugfix + +Premium Analytics: Fix the Stats dashboard failing to load on WordPress 7.2. diff --git a/projects/plugins/premium-analytics/changelog/fix-stats-620-widget-primitives-core-copy b/projects/plugins/premium-analytics/changelog/fix-stats-620-widget-primitives-core-copy new file mode 100644 index 000000000000..66f91e8d33a8 --- /dev/null +++ b/projects/plugins/premium-analytics/changelog/fix-stats-620-widget-primitives-core-copy @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Fix the dashboard failing to load on WordPress 7.2. diff --git a/projects/plugins/stats/changelog/fix-stats-620-widget-primitives-core-copy b/projects/plugins/stats/changelog/fix-stats-620-widget-primitives-core-copy new file mode 100644 index 000000000000..aab31b5fc26f --- /dev/null +++ b/projects/plugins/stats/changelog/fix-stats-620-widget-primitives-core-copy @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Fix the Stats dashboard failing to load on WordPress 7.2. From 23196df6b3d0fd0647df59a8037142081106dd0d Mon Sep 17 00:00:00 2001 From: Adam Wood <1017872+adamwoodnz@users.noreply.github.com> Date: Thu, 12 Nov 2026 14:59:11 +1300 Subject: [PATCH 2/6] docs(wp-build-polyfills): State the coexistence contract Core's copy changed Address review: README described script-module registration as first-wins with one Gutenberg exception, which stopped being true once the bundled widget-primitives copy started displacing Core's own registration. A consumer reading it would expect Core to win on WordPress 7.2 and be surprised by which copy the import map serves. (Codex P3-1) --- projects/packages/wp-build-polyfills/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/packages/wp-build-polyfills/README.md b/projects/packages/wp-build-polyfills/README.md index 9674088a9d8a..c0735491101e 100644 --- a/projects/packages/wp-build-polyfills/README.md +++ b/projects/packages/wp-build-polyfills/README.md @@ -34,14 +34,14 @@ This package provides those missing or updated packages so that plugins using `@ | `@wordpress/a11y` | `@wordpress/a11y` | | `@wordpress/widget-primitives` | `@wordpress/widget-primitives` | -Script modules use "first-wins" semantics — if Core or Gutenberg already registered the module, the polyfill is silently ignored. The exception is `@wordpress/widget-primitives`, which replaces the copy an active Gutenberg older than 24.4.0 registers. +Script modules use "first-wins" semantics — if Core or Gutenberg already registered the module, the polyfill is silently ignored. The exception is `@wordpress/widget-primitives`: the bundled copy replaces Core's registration, which WordPress ships from 7.2 built from a Gutenberg branch behind the bundled copy, and the copy an active Gutenberg older than 24.4.0 registers. A Gutenberg 24.4.0 or later copy stays. ## How it works 1. `WP_Build_Polyfills::register()` hooks into `wp_default_scripts` at **priority 20**, after Core and Gutenberg (both at the default priority 10) have registered their scripts. 2. For each polyfill, it checks whether a built asset file exists (`build/scripts/*/index.asset.php` or `build/modules/*/index.asset.php`). 3. For classic scripts, it checks whether the handle is already registered. Scripts marked for force replacement are deregistered and re-registered with the polyfill version when the WordPress version is below the script's threshold and active Gutenberg is not known to provide a compatible implementation. Non-force scripts are skipped if already registered. -4. For script modules, it calls `wp_register_script_module()`, which ignores duplicates, except that `@wordpress/widget-primitives` first deregisters the copy an active Gutenberg older than 24.4.0 registers. +4. For script modules, it calls `wp_register_script_module()`, which ignores duplicates, except that `@wordpress/widget-primitives` first deregisters any registration a supported Gutenberg did not make: Core's own copy, or an older copy from another plugin that bundles this package. `wp-private-apis` has an additional Gutenberg-version guard because the dashboard packages require a private-apis allowlist that includes `@wordpress/widget-dashboard`. Gutenberg 23.4.0 and older do not include that allowlist entry; Gutenberg 23.5.0 is expected to be the first active-Gutenberg version that matches the current `@next` package build used here. From 5e9e0ecf1cc9c2ff4f227ff4adb432bf4ffdb273 Mon Sep 17 00:00:00 2001 From: Adam Wood <1017872+adamwoodnz@users.noreply.github.com> Date: Thu, 12 Nov 2026 14:59:20 +1300 Subject: [PATCH 3/6] fix(wp-build-polyfills): Say what the changelog entry fixes for a reader Address review: the entry described the module-registration mechanism, so a consumer reading the package CHANGELOG could not tell it was the fix for dashboards that fail to load on WordPress 7.2. The plugin entries already read that way. (Codex P3-2) --- .../changelog/fix-stats-620-widget-primitives-core-copy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/packages/wp-build-polyfills/changelog/fix-stats-620-widget-primitives-core-copy b/projects/packages/wp-build-polyfills/changelog/fix-stats-620-widget-primitives-core-copy index 034ab3ea89fa..8d809e43c98e 100644 --- a/projects/packages/wp-build-polyfills/changelog/fix-stats-620-widget-primitives-core-copy +++ b/projects/packages/wp-build-polyfills/changelog/fix-stats-620-widget-primitives-core-copy @@ -1,4 +1,4 @@ Significance: patch Type: fixed -Serve the bundled widget-primitives script module over the copy WordPress registers from 7.2, which trails the exports the dashboards import. +Fix dashboards failing to load on WordPress 7.2, where Core's own widget-primitives module replaced the bundled one and lacked an export they import. From 9f35521af8478eb68a2cd307c4bc5fb670f9bf53 Mon Sep 17 00:00:00 2001 From: Adam Wood <1017872+adamwoodnz@users.noreply.github.com> Date: Thu, 12 Nov 2026 15:12:30 +1300 Subject: [PATCH 4/6] fix(wp-build-polyfills): Displace only Core's widget-primitives copy Address review: the replacement branch runs whenever no supported Gutenberg is active, so it also deregistered a registration this package knows nothing about. That copy could be newer than the bundled 0.11.0, and a dashboard importing an export only it carries would then fail to load, which is the failure this branch exists to prevent. WP_Script_Modules::get_registered() exposes the registered src, so Core's copy is identifiable by its wp-includes path. Anything else keeps first-wins, since nothing exposes the package version behind it. (Codex P2-1) --- projects/packages/wp-build-polyfills/README.md | 2 +- .../src/class-wp-build-polyfills.php | 11 +++++++---- .../tests/php/WP_Build_Polyfills_Test.php | 15 ++++++++++++++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/projects/packages/wp-build-polyfills/README.md b/projects/packages/wp-build-polyfills/README.md index c0735491101e..c6b8b67156ed 100644 --- a/projects/packages/wp-build-polyfills/README.md +++ b/projects/packages/wp-build-polyfills/README.md @@ -41,7 +41,7 @@ Script modules use "first-wins" semantics — if Core or Gutenberg already regis 1. `WP_Build_Polyfills::register()` hooks into `wp_default_scripts` at **priority 20**, after Core and Gutenberg (both at the default priority 10) have registered their scripts. 2. For each polyfill, it checks whether a built asset file exists (`build/scripts/*/index.asset.php` or `build/modules/*/index.asset.php`). 3. For classic scripts, it checks whether the handle is already registered. Scripts marked for force replacement are deregistered and re-registered with the polyfill version when the WordPress version is below the script's threshold and active Gutenberg is not known to provide a compatible implementation. Non-force scripts are skipped if already registered. -4. For script modules, it calls `wp_register_script_module()`, which ignores duplicates, except that `@wordpress/widget-primitives` first deregisters any registration a supported Gutenberg did not make: Core's own copy, or an older copy from another plugin that bundles this package. +4. For script modules, it calls `wp_register_script_module()`, which ignores duplicates, except that `@wordpress/widget-primitives` first deregisters three copies: Core's, identified by a `src` under `wp-includes`; an active Gutenberg's below 24.4.0; and an older copy from another plugin that bundles this package. A copy from anywhere else keeps first-wins, because nothing exposes the package version behind a registration. `wp-private-apis` has an additional Gutenberg-version guard because the dashboard packages require a private-apis allowlist that includes `@wordpress/widget-dashboard`. Gutenberg 23.4.0 and older do not include that allowlist entry; Gutenberg 23.5.0 is expected to be the first active-Gutenberg version that matches the current `@next` package build used here. diff --git a/projects/packages/wp-build-polyfills/src/class-wp-build-polyfills.php b/projects/packages/wp-build-polyfills/src/class-wp-build-polyfills.php index 98bdf43d2093..c5b46db58134 100644 --- a/projects/packages/wp-build-polyfills/src/class-wp-build-polyfills.php +++ b/projects/packages/wp-build-polyfills/src/class-wp-build-polyfills.php @@ -415,10 +415,13 @@ private static function register_modules( $build_dir, $base_file, $module_ids = $replace = true; $record = true; } else { - // A supported Gutenberg's copy stays. Any other registration is Core's, built - // from Gutenberg's wp/X branch and so behind the bundled copy — WP 7.2 ships - // widget-primitives 0.10.0, which has no `useWidgetIdentity`. - $record = null === $gutenberg_version || $gutenberg_too_old; + // From WP 7.2 Core ships its own copy, built from Gutenberg's wp/X branch and so + // behind the bundled one: 7.2 carries 0.10.0, which has no `useWidgetIdentity`. + // Only Core's is displaced, by its src; nothing exposes the version behind another. + $registered = wp_script_modules()->get_registered( $module_id ); + $is_core = null !== $registered && str_starts_with( $registered['src'], includes_url() ); + + $record = $gutenberg_too_old || ( null === $gutenberg_version && ( null === $registered || $is_core ) ); $replace = $record; } } diff --git a/projects/packages/wp-build-polyfills/tests/php/WP_Build_Polyfills_Test.php b/projects/packages/wp-build-polyfills/tests/php/WP_Build_Polyfills_Test.php index db947816ed70..692527dda5c5 100644 --- a/projects/packages/wp-build-polyfills/tests/php/WP_Build_Polyfills_Test.php +++ b/projects/packages/wp-build-polyfills/tests/php/WP_Build_Polyfills_Test.php @@ -911,13 +911,26 @@ public function test_register_modules_does_not_replace_widget_primitives_with_su */ public function test_register_modules_replaces_core_widget_primitives_without_gutenberg() { $GLOBALS['wp_script_modules'] = new \WP_Script_Modules(); - wp_register_script_module( '@wordpress/widget-primitives', 'https://example.com/core-widget-primitives.js', array(), '1.0.0-core' ); + wp_register_script_module( '@wordpress/widget-primitives', includes_url( 'js/dist/script-modules/widget-primitives/index.js' ), array(), '1.0.0-core' ); $this->invoke_register_modules( $this->make_widget_primitives_build( '0.11.0', 'bundled' ) ); $this->assert_widget_primitives_from( 'bundled' ); } + /** + * Nothing exposes the package version behind a registration, so a copy from outside + * wp-includes could be newer than the bundled one and keeps first-wins. + */ + public function test_register_modules_keeps_third_party_widget_primitives_without_gutenberg() { + $GLOBALS['wp_script_modules'] = new \WP_Script_Modules(); + wp_register_script_module( '@wordpress/widget-primitives', 'https://example.com/other-plugin-widget-primitives.js', array(), '1.0.0-third-party' ); + + $this->invoke_register_modules( $this->make_widget_primitives_build( '0.11.0', 'bundled' ) ); + + $this->assert_widget_primitives_from( '1.0.0-third-party' ); + } + /** * A newer bundled widget-primitives replaces the copy another plugin registered first. */ From 1c06c39b90d88b581677d8f2ae33792770e6200e Mon Sep 17 00:00:00 2001 From: Adam Wood <1017872+adamwoodnz@users.noreply.github.com> Date: Thu, 12 Nov 2026 15:27:15 +1300 Subject: [PATCH 5/6] fix(wp-build-polyfills): Let Core's copy outrank a recorded version Address review: 0.7.4 writes its package_version into the shared versions global even where Core had already won the module ID and its own registration was ignored. It bundles widget-primitives 0.11.0, so on WordPress 7.2 the global claims 0.11.0 is being served while the page gets Core's 0.10.0. A later copy then took the newest-copy-wins branch, compared 0.11.0 against 0.11.0 and skipped the module, so Core's copy stayed and the dashboard broke. Which plugin's copy loaded first decided it, and no single release can fix that from one side. The Core check now runs before the version comparison, so a recorded version no longer stands against a Core registration. (Claude 1) --- .../src/class-wp-build-polyfills.php | 20 ++++++++++--------- .../tests/php/WP_Build_Polyfills_Test.php | 14 +++++++++++++ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/projects/packages/wp-build-polyfills/src/class-wp-build-polyfills.php b/projects/packages/wp-build-polyfills/src/class-wp-build-polyfills.php index c5b46db58134..db73e1d57cab 100644 --- a/projects/packages/wp-build-polyfills/src/class-wp-build-polyfills.php +++ b/projects/packages/wp-build-polyfills/src/class-wp-build-polyfills.php @@ -3,8 +3,8 @@ * Polyfill registration for Core packages not available or incomplete in older WordPress versions. * * On WordPress 7.0 at the default threshold, wp-private-apis and wp-rich-text replace Core's copies, - * and @wordpress/widget-primitives replaces Core's on every version; every other polyfill fills in - * what Core lacks, or replaces a Gutenberg copy too old to use. + * and @wordpress/widget-primitives replaces Core's wherever Core ships one, from 7.2; every other + * polyfill fills in what Core lacks, or replaces a Gutenberg copy too old to use. * * @package automattic/jetpack-wp-build-polyfills */ @@ -407,7 +407,13 @@ private static function register_modules( $build_dir, $base_file, $module_ids = $record = false; if ( ! empty( $data['newest_copy_wins'] ) ) { - if ( array_key_exists( $module_id, $registered_versions ) ) { + // From WP 7.2 Core ships its own copy, built from Gutenberg's wp/X branch and so + // behind the bundled one: 7.2 carries 0.10.0, which has no `useWidgetIdentity`. + // Only Core's is displaced, by its src; nothing exposes the version behind another. + $registered = wp_script_modules()->get_registered( $module_id ); + $is_core = null !== $registered && str_starts_with( $registered['src'], includes_url() ); + + if ( ! $is_core && array_key_exists( $module_id, $registered_versions ) ) { $current = $registered_versions[ $module_id ]; if ( null === $version || ( null !== $current && version_compare( $version, $current, '<=' ) ) ) { continue; @@ -415,12 +421,8 @@ private static function register_modules( $build_dir, $base_file, $module_ids = $replace = true; $record = true; } else { - // From WP 7.2 Core ships its own copy, built from Gutenberg's wp/X branch and so - // behind the bundled one: 7.2 carries 0.10.0, which has no `useWidgetIdentity`. - // Only Core's is displaced, by its src; nothing exposes the version behind another. - $registered = wp_script_modules()->get_registered( $module_id ); - $is_core = null !== $registered && str_starts_with( $registered['src'], includes_url() ); - + // A copy released before this check records its version even where Core had + // already won the ID, so a recorded version cannot stand against Core's copy. $record = $gutenberg_too_old || ( null === $gutenberg_version && ( null === $registered || $is_core ) ); $replace = $record; } diff --git a/projects/packages/wp-build-polyfills/tests/php/WP_Build_Polyfills_Test.php b/projects/packages/wp-build-polyfills/tests/php/WP_Build_Polyfills_Test.php index 692527dda5c5..fef2559c6c57 100644 --- a/projects/packages/wp-build-polyfills/tests/php/WP_Build_Polyfills_Test.php +++ b/projects/packages/wp-build-polyfills/tests/php/WP_Build_Polyfills_Test.php @@ -918,6 +918,20 @@ public function test_register_modules_replaces_core_widget_primitives_without_gu $this->assert_widget_primitives_from( 'bundled' ); } + /** + * A copy released before the Core check records its version even where Core won the ID, so + * the recorded version says the module is served when Core's copy is what the page gets. + */ + public function test_register_modules_replaces_core_widget_primitives_despite_a_recorded_version() { + $GLOBALS['wp_script_modules'] = new \WP_Script_Modules(); + wp_register_script_module( '@wordpress/widget-primitives', includes_url( 'js/dist/script-modules/widget-primitives/index.js' ), array(), '1.0.0-core' ); + $GLOBALS[ WP_Build_Polyfills::MODULE_VERSIONS_GLOBAL ] = array( '@wordpress/widget-primitives' => '0.11.0' ); + + $this->invoke_register_modules( $this->make_widget_primitives_build( '0.11.0', 'bundled' ) ); + + $this->assert_widget_primitives_from( 'bundled' ); + } + /** * Nothing exposes the package version behind a registration, so a copy from outside * wp-includes could be newer than the bundled one and keeps first-wins. From 9b0055f1984760214f360119491af911a2051bcb Mon Sep 17 00:00:00 2001 From: Adam Wood <1017872+adamwoodnz@users.noreply.github.com> Date: Thu, 12 Nov 2026 15:27:35 +1300 Subject: [PATCH 6/6] docs(wp-build-polyfills): Correct two descriptions of the replacement Address review: the README sentence carried what is replaced and why in one clause, and the changelog said Core's module replaced the bundled one when it only registered first and kept the ID. (Claude 3) --- projects/packages/wp-build-polyfills/README.md | 2 +- .../changelog/fix-stats-620-widget-primitives-core-copy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/packages/wp-build-polyfills/README.md b/projects/packages/wp-build-polyfills/README.md index c6b8b67156ed..6f101fb17878 100644 --- a/projects/packages/wp-build-polyfills/README.md +++ b/projects/packages/wp-build-polyfills/README.md @@ -34,7 +34,7 @@ This package provides those missing or updated packages so that plugins using `@ | `@wordpress/a11y` | `@wordpress/a11y` | | `@wordpress/widget-primitives` | `@wordpress/widget-primitives` | -Script modules use "first-wins" semantics — if Core or Gutenberg already registered the module, the polyfill is silently ignored. The exception is `@wordpress/widget-primitives`: the bundled copy replaces Core's registration, which WordPress ships from 7.2 built from a Gutenberg branch behind the bundled copy, and the copy an active Gutenberg older than 24.4.0 registers. A Gutenberg 24.4.0 or later copy stays. +Script modules use "first-wins" semantics — if Core or Gutenberg already registered the module, the polyfill is silently ignored. The exception is `@wordpress/widget-primitives`: the bundled copy replaces both Core's registration and the one an active Gutenberg older than 24.4.0 makes. Core ships its copy from WordPress 7.2, built from a Gutenberg branch behind the bundled one, so it lacks exports the dashboards import. A Gutenberg 24.4.0 or later copy stays. ## How it works diff --git a/projects/packages/wp-build-polyfills/changelog/fix-stats-620-widget-primitives-core-copy b/projects/packages/wp-build-polyfills/changelog/fix-stats-620-widget-primitives-core-copy index 8d809e43c98e..be5d355478f9 100644 --- a/projects/packages/wp-build-polyfills/changelog/fix-stats-620-widget-primitives-core-copy +++ b/projects/packages/wp-build-polyfills/changelog/fix-stats-620-widget-primitives-core-copy @@ -1,4 +1,4 @@ Significance: patch Type: fixed -Fix dashboards failing to load on WordPress 7.2, where Core's own widget-primitives module replaced the bundled one and lacked an export they import. +Fix dashboards failing to load on WordPress 7.2, where Core's own, older widget-primitives module took precedence over the bundled one and lacked an export they import.