[wp-trac] [WordPress Trac] #61734: Add the ability to handle "fetchpriority" to ES Modules and Import Maps

WordPress Trac noreply at wordpress.org
Tue Oct 14 05:45:32 UTC 2025


#61734: Add the ability to handle "fetchpriority" to ES Modules and Import Maps
-------------------------------------+-------------------------------------
 Reporter:  dennysdionigi            |       Owner:  westonruter
     Type:  enhancement              |      Status:  closed
 Priority:  normal                   |   Milestone:  6.9
Component:  Script Loader            |     Version:  6.5
 Severity:  minor                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-      |     Focuses:  javascript,
  tests needs-dev-note               |  performance
-------------------------------------+-------------------------------------
Changes (by westonruter):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"60931" 60931]:
 {{{
 #!CommitTicketReference repository="" revision="60931"
 Script Loader: Propagate `fetchpriority` from dependents to dependencies.

 This introduces a "fetchpriority bumping" mechanism for both classic
 scripts (`WP_Scripts`) and script modules (`WP_Script_Modules`). When a
 script with a higher `fetchpriority` is enqueued, any of its dependencies
 will have their `fetchpriority` elevated to match that of the highest-
 priority dependent. This ensures that all assets in a critical dependency
 chain are loaded with the appropriate priority, preventing a high-priority
 script from being blocked by a low-priority dependency. This is similar to
 logic used in script loading strategies to ensure that a blocking
 dependent causes delayed (`async`/`defer`) dependencies to also become
 blocking. See #12009.

 When a script's `fetchpriority` is escalated, its original, registered
 priority is added to the tag via a `data-wp-fetchpriority` attribute. This
 matches the addition of the `data-wp-strategy` parameter added when the
 resulting loading strategy does not match the original.

 Developed in https://github.com/WordPress/wordpress-develop/pull/9770.

 Follow-up to [60704].

 Props westonruter, jonsurrell.
 Fixes #61734.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61734#comment:49>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list