Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughReplaces Next.js metadata sitemap with custom XML endpoints and a new sitemap utility. Adds two GET route handlers that return sitemap index and site sitemap XML, and introduces a library to discover app routes and render sitemap XML. Removes the legacy metadata-based sitemap module. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/site/src/app/sitemap-site.xml/route.ts`:
- Around line 3-11: The sitemap route handler GET is dynamic by default, causing
regeneration on every request; make it statically cached by exporting the route
cache hint—add an export like export const dynamic = 'force-static' (or the
project-standard static cache export) alongside the GET handler so
getSiteSitemapEntries()/renderSitemapXml runs at build time or is cached instead
of per-request.
In `@apps/site/src/app/sitemap.xml/route.ts`:
- Around line 3-11: The sitemap index route is being treated as dynamic; add a
module-level segment config to force static caching by exporting the dynamic
flag. In the route module (where the GET function is defined) add an export
const dynamic = "force-static"; at top-level so Next.js will statically cache
the rendered sitemap XML instead of regenerating it per request.
In `@apps/site/src/lib/sitemap.ts`:
- Around line 53-55: collectPageRoutes currently lets readdir errors bubble up
which can cause 500s; wrap the call to readdir(directory, { withFileTypes: true
}) in a try/catch inside collectPageRoutes, and on error log the error (e.g.,
console.error or app logger) and return an empty array so sitemap generation
continues gracefully instead of throwing; keep the rest of collectPageRoutes
logic unchanged so it can operate on an empty entries list when filesystem
access fails.
- Around line 27-33: Extract the segment filtering logic into a single helper
(e.g., isRenderableSegment or isRouteSegmentValid) and use it from
toRouteSegment and the other place where segments are filtered to remove
duplication; the helper should return false for: route groups and explicit
intercepting routes like "(.)", "(..)", "(...)" and any other "(group)"
patterns, private segments that start with "_" or bracketed dynamic segments
like "[id]", and parallel route slots that start with "@" (e.g., "@sidebar",
"@modal"); update toRouteSegment to call this helper and make the
intercepting-route checks explicit rather than relying on the generic
startsWith("(")&&endsWith(")") check, then replace the duplicated filtering
block elsewhere in the file with a call to the same helper.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c98167ff-4301-467c-97b7-fca00b3106b1
📒 Files selected for processing (4)
apps/site/src/app/sitemap-site.xml/route.tsapps/site/src/app/sitemap.tsapps/site/src/app/sitemap.xml/route.tsapps/site/src/lib/sitemap.ts
💤 Files with no reviewable changes (1)
- apps/site/src/app/sitemap.ts
Cache the sitemap routes statically and make route discovery skip unsupported segments and filesystem read failures. Made-with: Cursor
Adds two sitemaps for the new site.
sitemap.xmlfor the "host" project. This indicates the sitemaps for blog/docs/site apps.sitemap-site.xmlis the auto-generated sitemap for the site app.Summary by CodeRabbit
New Features
Refactor