[wp-trac] [WordPress Trac] #12009: Add support for HTML 5 "async" and "defer" attributes

WordPress Trac noreply at wordpress.org
Thu May 11 19:51:11 UTC 2023


#12009: Add support for HTML 5 "async" and "defer" attributes
-------------------------------------------------+-------------------------
 Reporter:  Otto42                               |       Owner:  10upsimon
     Type:  enhancement                          |      Status:  assigned
 Priority:  high                                 |   Milestone:  6.3
Component:  Script Loader                        |     Version:  4.6
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests 2nd-        |     Focuses:
  opinion                                        |  performance
-------------------------------------------------+-------------------------

Comment (by mor10):

 Replying to [comment:105 azaozz]:

 > Hey, Welcome back! Long time no see :)

 I'm not back. This is me from the past adding context to an old issue.

 As per MDN: "For module scripts, if the async attribute is present then
 the scripts and all their dependencies will be executed in the defer
 queue, therefore they will get fetched in parallel to parsing and
 evaluated as soon as they are available."

 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script

 `async` and `defer` are not optional features; they are part of the web
 platform. Adding one but not the other is arbitrary and works counter to
 the intent of the platform itself. It also makes a decision on behalf of
 WordPress developers that runs counter to how the web works.

 IMO this isn't a "decisions, not options" situation because the decision
 has already been made by the platform spec. WordPress needs to follow the
 standard.

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


More information about the wp-trac mailing list