[wp-trac] [WordPress Trac] #42438: Add support for preload links (similar to resource hints)

WordPress Trac noreply at wordpress.org
Thu Jul 7 16:45:17 UTC 2022


#42438: Add support for preload links (similar to resource hints)
--------------------------------------+-------------------------
 Reporter:  nico23                    |       Owner:  swissspidy
     Type:  defect (bug)              |      Status:  assigned
 Priority:  normal                    |   Milestone:  6.1
Component:  Script Loader             |     Version:  4.9
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-------------------------

Comment (by mihai2u):

 "duplicates a near identical API" -> since this a feedback for applying
 Don't Repeat Yourself principles to the code, yes, it's a nice to have,
 but as specs evolve, that might introduce more complexities down the road
 than combining the functions or APIs would.

 I can give one relevant example - preloading a module JS requires a
 different syntax:
 <link rel="modulepreload" href="dog.mjs">

 And with a separate implementation, this logic can be baked in the preload
 logic much easier, like when passing a "msj" parameter for the as, to
 change the output to match the specification:
  [https://developer.chrome.com/blog/modulepreload/]

 My suggestion is to keep this as it is for the flexibility it provides for
 having the code separated.

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


More information about the wp-trac mailing list