Skip to content

Commit 5493f7b

Browse files
committed
Backport changes from Gutenberg PR 72485.
The PR changed the exports from the @wordpress/interactivity package. It removed the `debug` WordPress export module completely. This requires some changes to the special way the debug script module was being registered. See WordPress/gutenberg#72485.
1 parent 7d97865 commit 5493f7b

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

src/wp-includes/script-modules.php

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -159,30 +159,11 @@ function wp_default_script_modules() {
159159
/*
160160
* Build the WordPress Script Module ID from the file name.
161161
* Prepend `@wordpress/` and remove extensions and `/index` if present:
162-
* - interactivity/index.min.js => @wordpress/interactivity
163-
* - interactivity/debug.min.js => @wordpress/interactivity/debug
164-
* - block-library/query/view.js => @wordpress/block-library/query/view
162+
* - interactivity/index.min.js or interactivity/index.js => @wordpress/interactivity
163+
* - block-library/query/view.min.js or block-library/query/view.js => @wordpress/block-library/query/view
165164
*/
166165
$script_module_id = '@wordpress/' . preg_replace( '~(?:/index)?(?:\.min)?\.js$~D', '', $file_name, 1 );
167166

168-
switch ( $script_module_id ) {
169-
/*
170-
* Interactivity exposes two entrypoints, "/index" and "/debug".
171-
* "/debug" should replace "/index" in development.
172-
*/
173-
case '@wordpress/interactivity/debug':
174-
if ( ! SCRIPT_DEBUG ) {
175-
continue 2;
176-
}
177-
$script_module_id = '@wordpress/interactivity';
178-
break;
179-
case '@wordpress/interactivity':
180-
if ( SCRIPT_DEBUG ) {
181-
continue 2;
182-
}
183-
break;
184-
}
185-
186167
/*
187168
* The Interactivity API is designed with server-side rendering as its primary goal, so all of its script modules
188169
* should be loaded with low fetchpriority and printed in the footer since they should not be needed in the

0 commit comments

Comments
 (0)