[wp-trac] [WordPress Trac] #64076: Emoji loader script can be moved to the footer since non-critical
WordPress Trac
noreply at wordpress.org
Tue Oct 7 07:00:49 UTC 2025
#64076: Emoji loader script can be moved to the footer since non-critical
-------------------------+--------------------------
Reporter: westonruter | Owner: westonruter
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.9
Component: Emoji | Version: 4.2
Severity: normal | Resolution: fixed
Keywords: has-patch | Focuses: performance
-------------------------+--------------------------
Comment (by westonruter):
Replying to [comment:8 jonsurrell]:
> This makes me wonder why this emoji script is an inline script instead
of fetching a remote script. Do you know why it has special treatment?
That's a great question. I think it was probably originally inlined to
avoid the blocking external JS request. Also, perhaps it is to reduce the
chaining, since the emoji detection script loads another script which
actually then does the loading/rendering of the emoji (via Twemoji). So
inlining it eliminates a loader of a loader.
Also, perhaps it was inlined because there was already a need to inline
some JS to export the settings, and so adding the emoji-loader inline as
would just be part of that.
We should investigate further to confirm and then consider whether this
would be an opportunity to register `wp-emoji-loader` as a script module
with `fetchpriority=low` (#61734) and `in_footer=true` (#63486).
It looks like the script was introduced in [31875] to fix #31701, to avoid
loading an external script unless it was needed. Back then, there was no
support for `defer` (or script modules), so every script was a blocking
script, so this was an optimization to avoid external blocking scripts.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64076#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list