From 3c3180c0eb88988501ea96e153db3243b7bedbe3 Mon Sep 17 00:00:00 2001 From: Nicacio Oliveira Date: Sat, 22 Aug 2026 21:15:41 -0300 Subject: [PATCH 1/2] feat(apps-website): Stats, the first-party analytics collector The React counterpart of the Fresh in deco-cx/apps, so the TanStack fleet has a path off OneDollarStats. Sites import it exactly where they import its predecessor, from @decocms/apps-website/components/Stats. It is twenty lines where OneDollarStats is three hundred, and not because it does less. The lilstts SDK has no notion of how this app routes, no notion of the deco_segment cookie and no notion of window.DECO.events, so that component has to wrap history.pushState, poll for globals, decode the cookie and forward every commerce event by hand. The deco collector's bundle already does all of it and is tested doing it -- first pageview through the prerender guard, pushState/replaceState/popstate, flush on pagehide and visibilitychange, cookie into experiment assignments, and the DECO event subscription with the commerce mapping. Reimplementing any of that here would be a second version of it, drifting from the first. So there is no useEffect, no readiness polling and no module-level StrictMode guard, because there is no client state to guard. dev and debug are data- attributes rather than a global, and on this framework that is load-bearing: TanStack hoists