refactor: extract frustration tracking into separate add-on script

Move rage click and dead click detection (35% of script.js) into
script.frustration.js as an optional add-on. Core script drops from
8.1KB to 5.7KB gzipped. Add-on auto-discovers core via window.pulse
polling and supports opt-out via data-no-rage/data-no-dead attributes.

- Expose cleanPath on window.pulse for add-on consumption
- Add script.frustration.js to middleware PUBLIC_ROUTES
- Update integration guides, ScriptSetupBlock, and FrustrationTable
  empty state to reference the add-on script
This commit is contained in:
Usman Baig
2026-03-16 16:59:37 +01:00
parent f797d89131
commit e444985295
6 changed files with 334 additions and 271 deletions

View File

@@ -13,6 +13,7 @@ const PUBLIC_ROUTES = new Set([
'/changelog',
'/installation',
'/script.js', // * Tracking script must load without auth for embedded sites (Shopify, etc.)
'/script.frustration.js', // * Frustration tracking add-on (rage clicks, dead clicks)
])
const PUBLIC_PREFIXES = [