[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 Jun 26 14:56: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 | Keywords: needs-patch
Focuses: performance |
---------------------------+-----------------------------
This is a follow-up to #12009.
While adding support for registering a script with an 'async' or 'defer'
loading strategy, the solution that was committed [56033] did not include
support for scripts that have an inline script attached in the 'after'
position, nor if any script that is a dependent of the script has an
inline script attached in the after position. In either scenario, the
original script will be printed without the registered loading strategy in
order to maintain execution order of the scripts in the dependency chain
when an inline script is included.
The purpose of this ticket is to reopen discussion about adding support
for this use case. An initial implementation that included support for
this use case was included in [https://github.com/WordPress/wordpress-
develop/pull/4391/ the initial PR] prior to removal in
[https://github.com/WordPress/wordpress-
develop/pull/4391/commits/b7d362df9655eedd2aff8651addd497fca83f1d0 this
commit]. Relevant conversation on the initial ticket that led to the
decision to remove support for inline scripts starts at
[https://core.trac.wordpress.org/ticket/12009#comment:111 this comment].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58632>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list