Skip to content

fix: plausible integration#391

Merged
thedaviddias merged 1 commit into
mainfrom
fix-plausible-package
Sep 8, 2025
Merged

fix: plausible integration#391
thedaviddias merged 1 commit into
mainfrom
fix-plausible-package

Conversation

@thedaviddias

@thedaviddias thedaviddias commented Sep 8, 2025

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Enables site-wide analytics via head integration for the specified domain.
  • Refactor
    • Streamlined analytics architecture; analytics provider is now self-contained.
    • Design system provider no longer requires an analytics domain prop.
  • Chores
    • Cleaned up duplicate imports and improved metadata base URL handling.
    • Preserved existing layout structure and UI behavior.

@coderabbitai

coderabbitai Bot commented Sep 8, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

Introduces analytics integration changes: adds AnalyticsHead to the root layout head, updates metadataBase, removes plausibleDomain from DesignSystemProvider, and refactors AnalyticsProvider/Plausible provider to no longer wrap children. Adds a new AnalyticsHead component and simplifies analytics providers to script-only, self-closing components.

Changes

Cohort / File(s) Summary
Web root layout integration
apps/web/app/layout.tsx
Injects AnalyticsHead in <head> with domain "llmstxthub.com"; updates metadataBase via getBaseUrl(); removes plausibleDomain prop usage from DesignSystemProvider; cleans duplicate imports.
Analytics package updates
packages/analytics/head.tsx, packages/analytics/index.tsx, packages/analytics/providers/plausible.tsx
Adds AnalyticsHead component that renders AnalyticsProvider in head. Refactors AnalyticsProvider to accept only plausibleDomain and render scripts without children. Updates Plausible provider to drop children prop and render PlausibleProvider as self-closing or null when no domain. Public APIs changed accordingly (removal of children).
Design system provider props change
packages/design-system/index.tsx
Removes analytics wiring and the plausibleDomain prop from DesignSystemProvider public interface; now renders UI providers directly without wrapping in AnalyticsProvider.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant NextApp as RootLayout
  participant Head as AnalyticsHead
  participant AP as AnalyticsProvider
  participant Plausible as PlausibleAnalyticsComponent
  participant Script as PlausibleProvider (script)

  User->>NextApp: Request page
  NextApp->>Head: Render in <head> with domain
  Head->>AP: Render with plausibleDomain
  AP->>Plausible: Render with domain
  alt domain provided
    Plausible->>Script: Inject analytics script (self-closing)
  else no domain
    Plausible-->>AP: Return null
  end
  NextApp-->>User: HTML with analytics script (if domain)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5caf866 and ffe5557.

📒 Files selected for processing (5)
  • apps/web/app/layout.tsx (2 hunks)
  • packages/analytics/head.tsx (1 hunks)
  • packages/analytics/index.tsx (1 hunks)
  • packages/analytics/providers/plausible.tsx (1 hunks)
  • packages/design-system/index.tsx (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-plausible-package

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel

vercel Bot commented Sep 8, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
llms-txt-hub Ready Ready Preview Comment Sep 8, 2025 1:38pm

@thedaviddias thedaviddias merged commit 58148df into main Sep 8, 2025
3 of 5 checks passed
@thedaviddias thedaviddias deleted the fix-plausible-package branch September 8, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant