External Library: Twemoji

In this article

Upgrading

The current process for upgrading the Twemoji library is as follows:

  1. The new image assets from the Twemoji release must be uploaded to the wordpress.orgWordPress.org The community site where WordPress code is created and shared by the users. This is where you can download the source code for WordPress core, plugins and themes as well as the central location for community conversations and organization. https://wordpress.org/ CDN. This must be done before any testing occurs. Hitting the URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org where a character is expected to be will prime the CDN’s cache and should be viewed as having an indefinite lifespan.
    • When ”only new files/Emoji” are added, the previous folder can be used. Since only the new files need to be fetched, it can help to save requests re-fetching the same asset at a new URL.
    • When old files/Emoji are modified and the modifications change the meaning or how the Emoji is interpreted, a new folder should be added to the CDN. For an example of this, see #51356 and the changes to the kneeling Emoji.
    • When old files/Emoji are modified and the modifications do not change the meaning or interpretation of the character, a new folder is not always necessary.
  2. Update the src/js/_enqueues/vendor/twemoji.js file to include the latest changes. There are WP specific changes in this file that must be preserved.
  3. The values of baseUrl, svgUrl, and $cdn_url variables in src/wp-includes/formatting.php and $png_cdn/$svg_cdn in tests/phpunit/tests/formatting/emoji.php should be updated to reflect the new paths for the w.org CDN locations.
  4. The Twemoji version queried in the replace:emoji-regex Grunt task found in Gruntfile.js should be updated to ensure the correct list of characters is retrieved.
  5. Run npm run grunt precommit:emoji to update the list of entities and partials in src/wp-includes/formatting.php.
  6. The emoji case within browserSupportsEmoji()` should be updated to test for a character in the most recently supported version of Emoji to ensure all characters are properly displayed.
  7. When a new flag is added or adjusted, the conditions used to the browser properly supports the latest version of Emoji in `src/js/_enqueues/lib/emoji-loader.js should be examined.
    • When a new letter localeLocale A locale is a combination of language and regional dialect. Usually locales correspond to countries, as is the case with Portuguese (Portugal) and Portuguese (Brazil). Other examples of locales include Canadian English and U.S. English. flag is added, there is a check that should be updated to replace the previous, most recent one (currently Sark as of Emoji 16/[60227]).
    • There may be additional edge cases that warrant new checks. For example, England is a country within the United Kingdom and does not have a two letter locale. It’s character sequence is represented by (black flag emoji + [G] + [B] + [E] + [N] + [G]).
    • The transgender flag is the (white flag emoji + transgender symbol) combined with either a ZWJ or zero-width space.
    • The assertions performed in Tests_Formatting_Emoji::test_wp_emoji_list_returns_data are updated to reflect the update being applied.

Notes

s
search
c
compose new post
r
reply
e
edit
t
go to top
j
go to the next post or comment
k
go to the previous post or comment
o
toggle comment visibility
esc
cancel edit post or comment