Skip to content
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

Eliminate static emoji handling since most browsers now support natively #6717

Merged
merged 1 commit into from
Nov 15, 2021

Conversation

westonruter
Copy link
Member

@westonruter westonruter commented Nov 12, 2021

Summary

I've been doing some looking into emoji handling in WordPress, as I've realized that I'm not seeing Twemoji images for emoji anymore. From caniemoji.com it seems all modern platforms/browsers now natively support native emoji, so the emoji detection script and dns-prefetch for s.w.org is largely just slowing down page performance in WordPress.

For more in core:

We can improve performance of pages prepared by the AMP plugin by skipping the wp_staticize_emoji() calls (which were neither comprehensive to the whole page nor largely necessary given native browser support), eliminating any connections to WordPress's Twemoji CDN at s.w.org.

Another benefit to eliminating the use of wp_staticize_emoji() is that it outputs not SVG but PNG images (by default), meaning they have appeared quite poor at larger font sizes.

Before After
image image

Checklist

  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@github-actions
Copy link
Contributor

github-actions bot commented Nov 12, 2021

Plugin builds for 7244902 are ready 🛎️!

@dhaval-parekh
Copy link
Collaborator

Changes in PR looks good to me 👍


I have tested the changes in different browsers and the results are consistent across the browsers.

Browser Preview
Firefox image
Chrome image
Safari image
Microsoft Edge image

@westonruter westonruter merged commit 48e5a18 into develop Nov 15, 2021
@westonruter westonruter deleted the remove/emoji branch November 15, 2021 20:39
@maitreyie-chavan maitreyie-chavan requested review from bartoszgadomski and removed request for milindmore22 December 6, 2021 13:16
@bartoszgadomski
Copy link
Contributor

QA passed:

Browser non-AMP AMP
Chrome Screenshot 2021-12-7 at 11 04 56 Screenshot 2021-12-7 at 11 04 59
Firefox Screenshot 2021-12-7 at 11 05 55 Screenshot 2021-12-7 at 11 05 57
Safari Screenshot 2021-12-7 at 11 07 24 Screenshot 2021-12-7 at 11 07 40

Also, connections to s.w.org are eliminated.
Well done 👍

@westonruter westonruter changed the title Eliminate emoji handling altogether since most browsers now support natively Eliminate static emoji handling since most browsers now support natively Dec 15, 2021
@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelogged Whether the issue/PR has been added to release notes. Performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants