Changeset 60931 for trunk/src/wp-includes/script-modules.php
- Timestamp:
- 10/14/2025 05:45:17 AM (3 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/script-modules.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/script-modules.php
r60704 r60931 182 182 } 183 183 184 // The Interactivity API is designed with server-side rendering as its primary goal, so all of its script modules should be loaded with low fetch priority since they should not be needed in the critical rendering path. 184 /* 185 * The Interactivity API is designed with server-side rendering as its primary goal, so all of its script modules 186 * should be loaded with low fetchpriority since they should not be needed in the critical rendering path. 187 * Also, the @wordpress/a11y script module is intended to be used as a dynamic import dependency, in which case 188 * the fetchpriority is irrelevant. See <https://make.wordpress.org/core/2024/10/14/updates-to-script-modules-in-6-7/>. 189 * However, in case it is added as a static import dependency, the fetchpriority is explicitly set to be 'low' 190 * since the module should not be involved in the critical rendering path, and if it is, its fetchpriority will 191 * be bumped to match the fetchpriority of the dependent script. 192 */ 185 193 $args = array(); 186 if ( str_starts_with( $script_module_id, '@wordpress/interactivity' ) || str_starts_with( $script_module_id, '@wordpress/block-library' ) ) { 194 if ( 195 str_starts_with( $script_module_id, '@wordpress/interactivity' ) || 196 str_starts_with( $script_module_id, '@wordpress/block-library' ) || 197 '@wordpress/a11y' === $script_module_id 198 ) { 187 199 $args['fetchpriority'] = 'low'; 188 200 }
Note: See TracChangeset
for help on using the changeset viewer.