-
Notifications
You must be signed in to change notification settings - Fork 3.2k
#64076: Emoji loader script can be moved to the footer since non-critical #10145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4a334e8
5afbdcb
d8845a0
ca22ac9
407148e
5f83576
4104301
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -277,16 +277,7 @@ | |
| return twemoji.parse( object, params ); | ||
| } | ||
|
|
||
| /** | ||
| * Initialize our emoji support, and set up listeners. | ||
| */ | ||
| if ( settings ) { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this script is loaded by the |
||
| if ( settings.DOMReady ) { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And since |
||
| load(); | ||
| } else { | ||
| settings.readyCallback = load; | ||
| } | ||
| } | ||
| load(); | ||
|
|
||
| return { | ||
| parse: parse, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code appears to be a vestige of when the emoji was first introduced in 4.2:
wordpress-develop/src/wp-includes/js/wp-emoji-loader.js
Lines 65 to 85 in 7e57307
The logic was greatly simplified since then, now that
DOMContentLoadedis supported by all supported browsers. Also, now that this script is loaded as a module, the DOM will have already been loaded anyway. So it seems like this logic and the corresponding logic insrc/js/_enqueues/wp/emoji.jsis now unnecessary.