[wp-trac] [WordPress Trac] #12009: Add support for HTML 5 "async" and "defer" attributes
WordPress Trac
noreply at wordpress.org
Mon Jun 19 11:33:15 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 azaozz):
@joemcgill @westonruter Frankly I'm starting to wonder why are you so
eager to add support for "script after". Is that some kind of a personal
goal or is there another reason?
Generally speaking the "script after" functionality promotes writing of
mediocre JS (scripts that require additional JS code snippets to be
outputted from PHP in order to work). This was somewhat useful ~10 years
ago as many WP devs had good knowledge of PHP but weren't particularly
well versed in JS. However in 2023 I'd like to think that most WP devs
have a deep understanding of JS, and can implement anything they may need
or want with "pure" JS, with no need of PHP "crutches" :)
My opinion still is that re-adding support for "script after" for scripts
with `async` and `defer` is a step in the wrong direction. Seems it can be
seen as "locking" the API to use outdated 2010 methods for this new
functionality instead of attempting to modernize it and try to bring it
closer to the 2023 best practices.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/12009#comment:128>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list