medama-io / medama

Self-hostable, privacy-focused website analytics.
https://oss.medama.io
388 stars 8 forks source link

fix(tracker): simplify tagged event click logic #123

Closed ayuhito closed 2 months ago

ayuhito commented 2 months ago

PR 7/? for #9.

This simplifies the logic needed for click tracking reducing the bundle size and also fixing some edge cases in the process!

File Size Compressed (gzip) Compressed (brotli)
tagged-events.min.js (old) 2036 bytes (1.99 KB) 997 bytes (0.97 KB) 802 bytes (0.78 KB)
tagged-events.min.js (new) 1959 bytes (1.91 KB) 958 bytes (0.94 KB) 775 bytes (0.76 KB)

Full tests are also now included for tagged events in this PR.

ayuhito commented 2 months ago

Failing test due to randomly updated golang-ci-lint rule. This is fixed in #120.