[wp-trac] [WordPress Trac] #12009: Add support for HTML 5 "async" and "defer" attributes
WordPress Trac
noreply at wordpress.org
Wed Mar 7 10:11:32 UTC 2018
#12009: Add support for HTML 5 "async" and "defer" attributes
---------------------------+-----------------------------
Reporter: Otto42 | Owner: azaozz
Type: enhancement | Status: reopened
Priority: normal | Milestone: Future Release
Component: Script Loader | Version: 4.6
Severity: normal | Resolution:
Keywords: | Focuses:
---------------------------+-----------------------------
Comment (by markcallen):
I just wanted to add a comment about filters on output. It is perhaps the
subject of a new discussion or ticket.
If any output is a html tag, then I believe it should be an array of
attribute => value pairs that is filtered.
This gives full control to developers to add, view, edit or remove
attributes based on their specific needs. It is more resilient to
successive filters being used and more importantly it works for any
attributes - current or future.
String manipulation which is relied on too much for a lot of filters is
just ugly and messy and often gets implemented assuming that no previous
filter has been called.
In the case of this ticket, this approach would allow developers to add
async/defer attributes based on their specific implementations. It
wouldn't need other updates to core and is future proof to any other cool
attributes that are created in the future.
Whether developers use that to enhance or degrade performance is a matter
for the developer, in my opinion. I agree with @azaozz, better to refactor
script-loader for 2018 - with my above point above included on eventual
output :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/12009#comment:53>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list