[wp-trac] [WordPress Trac] #58632: Add support for 'async' and 'defer' loading to script that use inline scripts.
WordPress Trac
noreply at wordpress.org
Mon Nov 20 22:59:40 UTC 2023
#58632: Add support for 'async' and 'defer' loading to script that use inline
scripts.
-------------------------------+------------------------------
Reporter: joemcgill | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Script Loader | Version:
Severity: normal | Resolution:
Keywords: needs-patch close | Focuses: performance
-------------------------------+------------------------------
Comment (by JG Visual):
Thanks a ton for the thoughtful response @westonruter. It's great to know
what options are available.
I still have concerns though that the vast majority of developers will end
up without the best solution. They'll try to combine the `aysnc` strategy
with an inline script that loads after, resulting in the strategy not
applying. Then they either won't realize it's not working, or will be
confused why it's not. I only learned what the issue was by diving into
the Core PHP. While some developers might do that, many likely won't.
If this won't be supported, should we at least update the documentation
for the related functions to note the limitations? We could also output a
message in debug.log, but that might be overkill.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58632#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list