[wp-trac] [WordPress Trac] #62709: Script modules integration with wp_resource_hints
WordPress Trac
noreply at wordpress.org
Thu Dec 19 09:36:17 UTC 2024
#62709: Script modules integration with wp_resource_hints
---------------------------+--------------------------------------
Reporter: jonsurrell | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Script Loader | Version: 6.5
Severity: minor | Resolution:
Keywords: | Focuses: javascript, performance
---------------------------+--------------------------------------
Changes (by jonsurrell):
* severity: normal => minor
Comment:
`modulepreload` is only added for static module dependencies.
Modules dependencies like the following will not have a `modulepreload`
added (assuming it's not a static import anywhere else in the dependency
graph):
{{{
#!php
$deps = array(
array( 'id' => 'my-module', 'import' => 'dynamic' ),
);
}}}
Dynamic dependencies would still benefit from dns-prefetch.
These dns-prefetches are also added early to the page. On non-block
themes, all of the script module tags are printed in the footer so there
may also be an opportunity for dns-prefetch to happen before any of the
module related tags are processed.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62709#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list