From 1c8a0e51ee96436b736fd94d2a9ef675e36668b1 Mon Sep 17 00:00:00 2001 From: ZVN DEV <78920650+zvndev@users.noreply.github.com> Date: Fri, 2 Oct 2026 01:26:34 -0400 Subject: [PATCH] feat(demo): Little Friend analytics on yable-demo.vercel.app Production deployments of the React demo render the Little Friend tag (journey mode, with session replay) in the root layout. Previews, local dev and the e2e dev server render nothing, because the tag depends on VERCEL_ENV being production. - examples/react-demo/turbo.json declares VERCEL_ENV for the build task, so Turborepo keys its cache on it. Without it, a preview build and a production build of the same source share one cache entry, and either can replay the other's output. - install.copy after the hero install command is copied, github.click and npm.click for links to GitHub and npm. - data-lf click ids on the hero calls to action and the docs header. Co-Authored-By: Claude Opus 5.5 (1M context) --- examples/react-demo/src/app/HomeClient.tsx | 12 ++++++--- examples/react-demo/src/app/docs/layout.tsx | 2 ++ examples/react-demo/src/app/layout.tsx | 18 +++++++++++++ examples/react-demo/src/app/little-friend.tsx | 26 +++++++++++++++++++ examples/react-demo/src/lib/little-friend.ts | 24 +++++++++++++++++ examples/react-demo/turbo.json | 9 +++++++ 6 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 examples/react-demo/src/app/little-friend.tsx create mode 100644 examples/react-demo/src/lib/little-friend.ts create mode 100644 examples/react-demo/turbo.json diff --git a/examples/react-demo/src/app/HomeClient.tsx b/examples/react-demo/src/app/HomeClient.tsx index 18147ff..ddc1fb3 100644 --- a/examples/react-demo/src/app/HomeClient.tsx +++ b/examples/react-demo/src/app/HomeClient.tsx @@ -2,6 +2,7 @@ import { useEffect, useMemo, useRef, useState } from 'react' import Link from 'next/link' +import { track } from '@/lib/little-friend' import { useTable, Table, @@ -698,7 +699,9 @@ export default function HomeClient({ codeBlocks }: HomeClientProps) { const reducedMotion = useReducedMotion() const copyInstall = () => { - navigator.clipboard.writeText('npm i @zvndev/yable-react @zvndev/yable-themes') + navigator.clipboard + .writeText('npm i @zvndev/yable-react @zvndev/yable-themes') + .then(() => track('install.copy')) setCopied(true) setTimeout(() => setCopied(false), 2000) } @@ -744,18 +747,19 @@ export default function HomeClient({ codeBlocks }: HomeClientProps) {
- + Explore the gallery - + Read the docs - + New Try column drag + {LITTLE_FRIEND_ENABLED && ( + +