nolanlawson / emoji-picker-element

A lightweight emoji picker for the modern web
https://nolanlawson.github.io/emoji-picker-element/
Apache License 2.0
1.49k stars 85 forks source link

feat: add support for custom emoji fonts #308

Closed nolanlawson closed 1 year ago

nolanlawson commented 1 year ago

Fixes #82

I really didn't ever intend to do this, but it seems like people want this functionality. And support for COLR fonts seems pretty good in modern browsers. So if folks want it, then let's add it.

github-actions[bot] commented 1 year ago

📊 Tachometer Benchmark Results

Summary

benchmark-total

  • emoji-picker-element-database-interactions: unsure 🔍 -6% - +3% (-9.20ms - +4.89ms)
    this-change vs tip-of-tree
  • emoji-picker-element-first-load: unsure 🔍 -6% - +10% (-4.00ms - +6.39ms)
    this-change vs tip-of-tree
  • emoji-picker-element-second-load: unsure 🔍 -7% - +8% (-4.75ms - +5.18ms)
    this-change vs tip-of-tree

Results

emoji-picker-element-database-interactions
  • Browser: chrome-headless 108.0.5359.98
  • Sample size: 50
  • Built by: Benchmarks #198
  • Commit: d262296
VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
this-change
151.49ms - 160.86ms-unsure 🔍
-6% - +3%
-9.20ms - +4.89ms
tip-of-tree
tip-of-tree
153.07ms - 163.59msunsure 🔍
-3% - +6%
-4.89ms - +9.20ms
-
emoji-picker-element-first-load
  • Browser: chrome-headless 108.0.5359.98
  • Sample size: 60
  • Built by: Benchmarks #198
  • Commit: d262296
VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
this-change
62.02ms - 69.28ms-unsure 🔍
-6% - +10%
-4.00ms - +6.39ms
tip-of-tree
tip-of-tree
60.74ms - 68.18msunsure 🔍
-10% - +6%
-6.39ms - +4.00ms
-
emoji-picker-element-second-load
  • Browser: chrome-headless 108.0.5359.98
  • Sample size: 50
  • Built by: Benchmarks #198
  • Commit: d262296
VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
this-change
64.62ms - 71.42ms-unsure 🔍
-7% - +8%
-4.75ms - +5.18ms
tip-of-tree
tip-of-tree
64.18ms - 71.42msunsure 🔍
-8% - +7%
-5.18ms - +4.75ms
-

tachometer-reporter-action v2 for Benchmarks

github-actions[bot] commented 1 year ago

Size Change: +399 B (+1%)

Total Size: 42.2 kB

Filename Size Change
./bundle.js 42.2 kB +399 B (+1%)

compressed-size-action

nolanlawson commented 1 year ago

Well, it looks like in Safari on Mac, the emoji are misaligned in some cases. It's still busted in Safari Technology Preview too.

Screenshot 2022-12-28 at 4 14 17 PM

I can't figure out what's going on here. It's only in Safari, and only with the custom font.

nolanlawson commented 1 year ago

I'm guessing this has something to do with older emoji and the variation selector: https://emojipedia.org/variation-selector-16/

nolanlawson commented 1 year ago

Filed a bug on Safari. Could not find a workaround for the life of me.

I also couldn't get the COLR font to work at all in Epiphany Browser on Linux (WebKit). So these are limitations of COLR fonts that I think we just have to acknowledge.

nolanlawson commented 1 year ago

Tachometer regression seems genuine based on chrome traces, let's bring back rIC.

Screenshot from 2022-12-29 10-13-30