Install Plausible analytics on RaidGuild website#86
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdds a ChangesPlausible Analytics Installation
Estimated code review effort: 1 (Trivial) | ~5 minutes Related issues: Suggested reviewers: raid-guild/website maintainers familiar with 🐰
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/app/layout.tsxESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/app/layout.tsx (1)
20-31: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse
next/scriptfor the Plausible loader instead of raw<script>tags.The inline snippet is static, so the XSS warning doesn’t apply here, but
next/scriptgives App Router loading control (afterInteractive/lazyOnload) and handles the inline init block with a requiredid.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/app/layout.tsx` around lines 20 - 31, Replace the raw Plausible `<script>` tags in `layout.tsx` with `next/script` usage inside the `head` section so the App Router can control loading and the inline init block can be given a stable `id`. Update the `head` markup around the Plausible loader and the `dangerouslySetInnerHTML` init snippet to use `Script` with an appropriate loading strategy such as `afterInteractive` or `lazyOnload`, keeping the existing Plausible URL and initialization logic intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/app/layout.tsx`:
- Around line 20-31: Replace the raw Plausible `<script>` tags in `layout.tsx`
with `next/script` usage inside the `head` section so the App Router can control
loading and the inline init block can be given a stable `id`. Update the `head`
markup around the Plausible loader and the `dangerouslySetInnerHTML` init
snippet to use `Script` with an appropriate loading strategy such as
`afterInteractive` or `lazyOnload`, keeping the existing Plausible URL and
initialization logic intact.
Summary
Validation
Closes #85.
Summary by CodeRabbit