[wp-trac] [WordPress Trac] #59301: Incorporate script loading strategies in WP Admin to improve performance where applicable
WordPress Trac
noreply at wordpress.org
Wed Sep 6 20:35:04 UTC 2023
#59301: Incorporate script loading strategies in WP Admin to improve performance
where applicable
-------------------------------------+----------------------------
Reporter: westonruter | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Administration | Version: 6.3
Severity: normal | Keywords:
Focuses: javascript, performance |
-------------------------------------+----------------------------
As of #12009 the script loader now has the ability for scripts to be
printed with `async` or `defer`. This is being used on the frontend now
for block view scripts (#59115), the `comment-reply` script (#58870), and
the `wp-embed` script (#58931). Nevertheless, these new script loading
strategies are not currently being used in the admin. There may be
opportunities to improve performance by doing so.
Typically only `jquery-core`, `jquery-migrate`, and `utils` (less
frequently `moxiejs` and `plupload`, and even less frequently `wp-
polyfill-inert`, `regenerator-runtime`, `wp-polyfill`, `wp-hooks`,
`zxcvbn-async`, `wp-codemirror`, and `underscore`) are loaded in the
`head` in the admin; furthermore, these scripts are concatenated together
via `load-scripts.php`. For backwards-compatibility, these scripts might
not be able to be delayed or moved to the footer. In other cases, there
may be existing footer scripts that could be moved to the `head` and made
to load with `defer`: this would ensure that they start loading sooner so
that they can execute as soon as the document finishes loading. Other
scripts could potentially be lazy-loaded only when needed (e.g. `zxcvbn`).
Note that the block/site editor screens will benefit the most from
[https://github.com/WordPress/gutenberg/discussions/53260#discussioncomment-6870404
block lazy loading].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59301>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list