Skip to content

build: update plausible-client - #246

Merged
vitonsky merged 1 commit into
masterfrom
2026-update-plausible-client
Mar 8, 2026
Merged

build: update plausible-client#246
vitonsky merged 1 commit into
masterfrom
2026-update-plausible-client

Conversation

@vitonsky

@vitonsky vitonsky commented Mar 8, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Enhanced analytics tracking capabilities with improved session identification and engagement metrics
  • Refactor

    • Upgraded analytics library to version 2.0.0 and modernized tracking infrastructure

@coderabbitai

coderabbitai Bot commented Mar 8, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Custom analytics modules for engagement tracking, click tracking, and session scoring have been removed. The plausible-client dependency has been upgraded from v1.5.0 to v2.0.0. Analytics initialization in index.ts has been refactored to import and use these capabilities directly from the upgraded plausible-client library instead of maintaining custom implementations.

Changes

Cohort / File(s) Summary
Dependency Upgrade
packages/site/package.json
Updated plausible-client from ^1.5.0 to ^2.0.0.
Analytics Module Removals
packages/site/src/components/analytics/EngagementTimeTracker.ts, enableClickTracking.ts, enableEngagementTracking.ts, enableSessionScoring.ts
Deleted custom implementations of engagement time tracking, click tracking, and session scoring logic (280 lines total removed). Functionality now delegated to plausible-client library.
Analytics Integration Refactoring
packages/site/src/components/analytics/index.ts
Replaced local imports with plausible-client library functions: enableEngagementTracking, enableLinkClicksCapture, and enableSessionScoring. Added sessionId handling via getSessionId utility from plausible-client/utils/uid. Updated Plausible initialization to use library filters and transformers with sessionId injection. Enabled autoPageviews, enableAutoOutboundTracking, and enableLinkClicksCapture with captureText option.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~35 minutes

Poem

🐰 The old custom code hops away,
Plausible takes the reins today!
Version two brings cleaner skies,
No reinventing—lib supplies!
Analytics simplified and spry. 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'build: update plausible-client' accurately describes the main change: updating the plausible-client dependency from ^1.5.0 to ^2.0.0 and refactoring analytics code to use the new version's exported functions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 2026-update-plausible-client

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

@github-actions

github-actions Bot commented Mar 8, 2026

Copy link
Copy Markdown

Cloudflare Pages Deployment

Event Name: pull_request
Environment: preview
Project: deepink
Built with commit: 0a6adbb
Preview URL: https://9371431b.deepink.pages.dev
Branch Preview URL: https://2026-update-plausible-client.deepink.pages.dev

Wrangler Output

⛅️ wrangler 4.71.0
───────────────────
Uploading... (43/138)
Uploading... (75/138)
Uploading... (106/138)
Uploading... (138/138)
✨ Success! Uploaded 95 files (43 already uploaded) (1.95 sec)

🌎 Deploying...
✨ Deployment complete! Take a peek over at https://9371431b.deepink.pages.dev
✨ Deployment alias URL: https://2026-update-plausible-client.deepink.pages.dev

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/site/src/components/analytics/index.ts`:
- Around line 42-43: The enableLinkClicksCapture call is redundant and conflicts
with enableAutoOutboundTracking, causing duplicate events; remove the
enableLinkClicksCapture(plausible, { captureText: true }) line (or alternatively
change it to include the same-origin filter used by enableAutoOutboundTracking)
so only one click tracker reports outbound clicks; locate the calls to
enableAutoOutboundTracking and enableLinkClicksCapture in this file and delete
or adjust the enableLinkClicksCapture invocation accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0a83053a-54e8-48a6-b3f8-305d5c2f6edb

📥 Commits

Reviewing files that changed from the base of the PR and between 5f7374a and 71bf172.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • packages/site/package.json
  • packages/site/src/components/analytics/EngagementTimeTracker.ts
  • packages/site/src/components/analytics/enableClickTracking.ts
  • packages/site/src/components/analytics/enableEngagementTracking.ts
  • packages/site/src/components/analytics/enableSessionScoring.ts
  • packages/site/src/components/analytics/index.ts
💤 Files with no reviewable changes (4)
  • packages/site/src/components/analytics/enableSessionScoring.ts
  • packages/site/src/components/analytics/enableClickTracking.ts
  • packages/site/src/components/analytics/EngagementTimeTracker.ts
  • packages/site/src/components/analytics/enableEngagementTracking.ts

Comment thread packages/site/src/components/analytics/index.ts
@vitonsky
vitonsky merged commit a57e99d into master Mar 8, 2026
22 of 23 checks passed
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