Skip to content

[CI] (22322bc) react-router/rrv7-starter - #3650

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-22322bc-react-router-rrv7-starter
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-22322bc-react-router-rrv7-starter

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 22322bc
App: react-router/rrv7-starter
App directory: apps/react-router/rrv7-starter
Workbench branch: wizard-ci-22322bc-react-router-rrv7-starter
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-08-28T19:28:29.344Z
Duration: 305.8s

YARA Scanner

✓ 141 tool calls scanned, 0 violations detected

No violations: ✓ 141 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into a React Router v7 framework mode (RRv7) starter app. It adds posthog-js and @posthog/react as dependencies, initializes PostHog in entry.client.tsx with a PostHogProvider and PostHogErrorBoundary, captures four meaningful custom events across three components, and documents new environment variables in .env.example and env.d.ts.

Files changed Lines added Lines removed
7 +81 -5

Confidence score: 5/5 🧙

  • No reverse proxy configured: The integration sends events directly to us.i.posthog.com from the browser. Ad blockers will silently drop requests. A reverse proxy (e.g., via Vercel rewrites or the PostHog managed proxy) should be configured for reliable data collection. [MEDIUM]
  • No identify() call: The app has no authentication system, but the wizard should have added at least a commented-out placeholder or documentation note showing where to call posthog.identify() when auth is added. Without identification, all events are anonymous. [MEDIUM]
  • Missing noExternal for dev mode in vite.config.ts: The docs for React Router v7 framework mode require posthog-js and @posthog/react in ssr.noExternal to avoid SSR errors. The existing config uses noExternal: true only in build mode; dev mode excludes these packages, which can cause SSR errors when components import usePostHog. [MEDIUM]

File changes

Filename Score Description
app/entry.client.tsx 4/5 New file: initializes PostHog, wraps app with PostHogProvider and PostHogErrorBoundary. Good defensive checks for missing env vars.
app/components/PostCard.tsx 4/5 Adds post_like_toggled capture in click handler with relevant properties
app/routes/buy-followers.tsx 4/5 Adds follower_package_selected and fake_followers_purchased captures with enriched properties
app/routes/profile.tsx 4/5 Adds follow_back_toggled capture; cleans up unused username prop
.env.example 5/5 Documents new PostHog env vars
env.d.ts 5/5 Adds TypeScript declarations for new env vars
package.json 5/5 Adds posthog-js and @posthog/react dependencies

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes Production builds use noExternal: true covering all PostHog packages; entry.client.tsx is syntactically correct
Preserves existing env vars & configs Yes Existing VITE_SITE_URL preserved; new vars added alongside
No syntax or type errors Yes All JSX, imports, and TypeScript declarations are correct
Correct imports/exports Yes usePostHog from @posthog/react, posthog from posthog-js — all correct
Minimal, focused changes Yes Only PostHog-related changes; minor cleanup of unused username prop is appropriate
Pre-existing issues vite.config.ts SSR config In dev mode, noExternal only includes ['gsap'], not posthog-js/@posthog/react. Components importing usePostHog may fail during SSR in development

Issues

  • Missing vite.config.ts update for SSR: The PR adds usePostHog imports to SSR-rendered components (PostCard, buy-followers, profile) but does not add posthog-js and @posthog/react to ssr.noExternal in vite.config.ts. Per the React Router v7 framework mode docs, this is required to avoid SSR errors. Production builds are unaffected (existing noExternal: true in build mode), but dev mode may break. [MEDIUM]

Other completed criteria

  • Environment variables properly documented in .env.example and typed in env.d.ts
  • Build configuration valid — package.json dependencies are correct versions
  • Defensive env var checks in entry.client.tsx with helpful error messages in dev mode
  • Graceful fallback when PostHog is not configured (renders app without PostHogProvider)

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js@^1.422.5 and @posthog/react@^1.10.5 added to package.json
PostHog client initialized Yes posthog.init() called in entry.client.tsx with PostHogProvider wrapping HydratedRouter — matches the documented framework mode pattern
capture() Yes Four custom events captured across three components
identify() No No identify() call anywhere. App has no auth system, but no placeholder or documentation was added
Error tracking Yes PostHogErrorBoundary wraps the router inside PostHogProvider, correctly capturing React rendering exceptions
Reverse proxy No No reverse proxy configured. Events sent directly to us.i.posthog.com from the browser

Issues

  • No reverse proxy: Client-side posthog-js sends events directly to PostHog's servers. Ad blockers and tracking blockers will intercept these requests, causing silent data loss. The docs recommend setting up a reverse proxy via Vercel rewrites, Next.js middleware, or the PostHog managed proxy. [MEDIUM]
  • No identify() implementation: While the app lacks authentication, the wizard should have added a documented placeholder pattern showing where and how to call posthog.identify() when user auth is added. All events remain anonymous without this. [MEDIUM]

Other completed criteria

  • API key loaded from VITE_PUBLIC_POSTHOG_PROJECT_TOKEN environment variable (not hardcoded)
  • API host loaded from VITE_PUBLIC_POSTHOG_HOST environment variable
  • defaults: '2026-05-30' correctly set in init options
  • PostHogErrorBoundary properly nested inside PostHogProvider
  • Optional chaining (posthog?.capture) used consistently to handle uninitialized state

PostHog insights and events ✅

Filename PostHog events Description
app/components/PostCard.tsx post_like_toggled Captures when a user likes/unlikes a post, with is_liked boolean property
app/routes/buy-followers.tsx follower_package_selected, fake_followers_purchased Captures package selection and purchase completion with follower_count, package_price, includes_bonus properties — enables conversion funnel analysis
app/routes/profile.tsx follow_back_toggled Captures follow/unfollow actions with is_following boolean property
app/entry.client.tsx captureException (via PostHogErrorBoundary) Automatically captures uncaught React rendering errors

Issues

None — events are well-structured and actionable.

Other completed criteria

  • Events represent real user actions (liking posts, selecting packages, purchasing, following)
  • Events enable product insights: package_selected → purchased funnel, engagement metrics via like/follow toggles
  • All events include contextual properties (not bare captures)
  • No PII in event properties — only booleans and numeric values
  • Event names are descriptive, consistent snake_case convention

Reviewed by wizard workbench PR evaluator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants