Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Caution Review failedThe pull request is closed. WalkthroughThis PR expands SDK documentation by adding comprehensive guides for the core and React SDKs, creating a dedicated SDK section with integration examples for Next.js App and Pages routers. The main documentation index is restructured, and the React SDK package version is bumped to 0.4.0 with a pinned dependency on Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
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.
Actionable comments posted: 1
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
apps/docs/content/docs/index.mdx(1 hunks)apps/docs/content/docs/sdk/core.mdx(1 hunks)apps/docs/content/docs/sdk/index.mdx(1 hunks)apps/docs/content/docs/sdk/nextjs-app-router.mdx(1 hunks)apps/docs/content/docs/sdk/nextjs-pages-router.mdx(1 hunks)apps/docs/content/docs/sdk/react.mdx(1 hunks)packages/react-sdk/package.json(2 hunks)
🧰 Additional context used
🪛 LanguageTool
apps/docs/content/docs/sdk/core.mdx
[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ost or null. #### getPinnedPost() Returns the pinned post or null. ### `getTag...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
🔇 Additional comments (15)
apps/docs/content/docs/index.mdx (1)
6-12: LGTM! Clean consolidation of navigation.The restructured landing page with the unified Cards component provides a cleaner, more maintainable navigation structure. The addition of the SDKs card aligns well with the comprehensive SDK documentation being added in this PR.
packages/react-sdk/package.json (1)
3-3: LGTM! Version bump aligns with SDK documentation.The minor version bump to 0.4.0 appropriately reflects the SDK enhancements documented in this PR.
apps/docs/content/docs/sdk/index.mdx (1)
1-18: LGTM! Well-structured SDK overview.The SDK index page provides a clear, logical navigation structure that separates core SDKs from framework-specific examples.
apps/docs/content/docs/sdk/react.mdx (3)
48-70: LGTM! Clear API documentation.The API reference for
usePostsis comprehensive and well-structured, with clear descriptions of options and return values.
71-85: Verify property name in ChangelogPost render prop.The render prop example on line 77 references
plainText, which should be consistent with the actual property name used throughout the SDK. Cross-reference with the API implementation to ensure accuracy.
14-46: No action needed. The documentation correctly usesplainTextas the render prop name. The SDK's ChangelogPost component intentionally transforms the API'splain_text_contentproperty to the camelCaseplainTextprop, which is documented accurately in the example.apps/docs/content/docs/sdk/core.mdx (2)
6-26: LGTM! Clear installation and usage guide.The installation steps and usage example effectively demonstrate the core SDK's main methods, providing a solid foundation for developers.
28-60: LGTM! Comprehensive API reference.The API documentation clearly describes all client methods, options, and return values. The consistent "Returns" phrasing in the method descriptions (lines 53, 57) maintains clarity in technical documentation despite the style hint.
apps/docs/content/docs/sdk/nextjs-app-router.mdx (3)
12-66: LGTM! Proper App Router pattern with SSR.The example correctly demonstrates Next.js App Router patterns with server-side data fetching and client-side hydration. The TypeScript typing with
Awaited<ReturnType<...>>is a nice touch for type safety.
68-108: LGTM! Clean client-only implementation.The client-only example properly handles initial loading state and provides a good user experience with disabled button states during pagination.
110-174: LGTM! Polished Tailwind implementation.The Tailwind CSS example provides a production-ready implementation with comprehensive tag styling, a nice loading spinner, and proper responsive design. The tag color mapping covers all
PostTagvalues appropriately.apps/docs/content/docs/sdk/nextjs-pages-router.mdx (4)
12-57: LGTM! Correct SSR implementation.The SSR example follows Next.js Pages Router conventions correctly, with proper TypeScript typing using
InferGetServerSidePropsType.
59-107: LGTM! SSG with ISR properly configured.The SSG example demonstrates Incremental Static Regeneration with a 60-second revalidation window, which is a practical pattern for changelog data.
109-147: LGTM! Straightforward client-side implementation.The client-only example provides a clean implementation that handles loading states appropriately.
149-211: LGTM! Consistent Tailwind styling.The Tailwind CSS example maintains consistency with the App Router version, providing a cohesive styling pattern across both Next.js routing approaches.
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (3)
apps/docs/content/docs/sdk/core.mdx (3)
14-26: Consider adding error handling guidance.The usage example demonstrates the happy path well, but documenting error handling would help users implement robust integrations.
💡 Enhanced example with error handling
import { createChangesPageClient } from "@changespage/core"; const client = createChangesPageClient({ baseUrl: "https://your-page.changes.page", }); +try { const { posts, totalCount, hasMore } = await client.getPosts({ limit: 10 }); - const latestPost = await client.getLatestPost(); - const pinnedPost = await client.getPinnedPost(); +} catch (error) { + console.error("Failed to fetch changelog data:", error); +}
40-49: Consider documenting the Post structure.Users would benefit from knowing what fields are available in the returned
postsarray. Consider adding a subsection documenting the Post interface/type structure.Example addition:
**Returns:** An object with: - `posts`: Array of post objects (each containing `id`, `title`, `content`, `publishedAt`, etc.) - `totalCount`: Total number of posts available - `hasMore`: Boolean indicating if more posts exist beyond current offset
51-57: Optional: Vary sentence structure for readability.The static analysis tool flagged repetitive sentence structure (three sentences starting with "Returns"). While the documentation is clear, varying the wording slightly could improve readability.
Example alternatives:
#### `getLatestPost()` Retrieves the most recent post or `null` if none exist. #### `getPinnedPost()` Returns the pinned post or `null` if none is pinned.Based on static analysis hints from LanguageTool.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
apps/docs/content/docs/sdk/core.mdx(1 hunks)apps/docs/content/docs/sdk/nextjs-app-router.mdx(1 hunks)apps/docs/content/docs/sdk/nextjs-pages-router.mdx(1 hunks)apps/docs/content/docs/sdk/react.mdx(1 hunks)apps/docs/mdx-components.tsx(1 hunks)apps/docs/package.json(1 hunks)apps/docs/source.config.ts(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- apps/docs/content/docs/sdk/nextjs-pages-router.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
- apps/docs/content/docs/sdk/react.mdx
- apps/docs/content/docs/sdk/nextjs-app-router.mdx
🧰 Additional context used
🪛 LanguageTool
apps/docs/content/docs/sdk/core.mdx
[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ost or null. #### getPinnedPost() Returns the pinned post or null. ### `getTag...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
🔇 Additional comments (3)
apps/docs/content/docs/sdk/core.mdx (1)
1-10: LGTM!The frontmatter and installation section are well-structured and provide clear initial guidance.
apps/docs/mdx-components.tsx (1)
1-12: LGTM! Clean integration of Tab and Tabs components.The import and registration of Tab/Tabs components into the MDX components mapping is correct. The spreading order properly allows consumers to override these components if needed.
apps/docs/source.config.ts (1)
7-20: LGTM! Standard remarkInstall plugin configuration.The remarkInstall plugin is correctly imported and configured with package manager persistence, which will enable users to see installation commands for their preferred package manager (npm/yarn/pnpm) across the documentation.
2d81dd8 to
4541d7c
Compare
Summary by CodeRabbit
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.