Skip to content

Conversation

@MrTob
Copy link

@MrTob MrTob commented Jan 28, 2026

Summary

Updates the Next.js tutorial to fix breaking changes. The current tutorial contains deprecated method signatures and incorrect TypeScript types that prevent the code from working.

What's Changed

SDK Method Updates (Steps 6-7)

  • Migrated database methods to object-parameter style (createRow, deleteRow, listRows)
  • Added TypeScript generics for type-safe responses: listRows<Idea>({})

Authentication Model (Step 4)

  • Changed state type from Models.Session to Models.User<Models.Preferences>
  • Updated login() to fetch user after session creation
  • Fixed deleteSession() to use object parameters

Type Safety & API Changes

  • User property access: userId$id, providerUidname || email
  • Import paths: relative imports → @/ path aliases

State Management (Step 7)

  • Lifted state to parent component for proper real-time updates
  • Implemented props drilling pattern for CRUD operations
  • Added error handling in form submission

Tested With

  • appwrite@^21.5.0
  • next@^16.1.6

Summary by CodeRabbit

  • Documentation
    • Updated tutorial code examples with improved authentication flow, including user registration and current user retrieval functionality.
    • Refined database operations API usage patterns in tutorial examples.
    • Enhanced component examples with improved prop-based data handling for forms and lists.
    • Updated import paths to use alias conventions throughout tutorial examples.

✏️ Tip: You can customize this high-level summary in your review settings.

- Migrated from positional to object-parameter style for database methods
- Updated deprecated createRow, deleteRow, and listRows methods
- Fixed TypeScript types: Models.Session to Models.User<Models.Preferences>
- Changed user property access: userId to \$id, providerUid to email
- Added TypeScript generics for type-safe API responses
- Fixed state management with proper props drilling for real-time updates
- Updated import paths to use Next.js path aliases (@/)
- Updated deleteSession to use object parameter style

Tested with appwrite@^21.5.0 and next@^16.1.6"
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

Walkthrough

This pull request refactors a Next.js tutorial spanning steps 4-7, introducing several interconnected changes. Step 4 updates the authentication hook to retrieve and manage user objects instead of sessions, adds registration and user-fetching functions, and switches to absolute import paths. Step 5 updates the navbar to display user names or emails. Step 6 refactors API calls to use options objects instead of positional arguments and updates method signatures. Step 7 converts IdeasForm and IdeasList components from internally managing state to accepting props (onAdd, ideas, loading, onRemove) and updates the home page to wire these components using custom hooks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 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 clearly and concisely summarizes the main change: updating the Next.js tutorial for Appwrite SDK v16+ compatibility, which aligns with the substantial refactoring across multiple tutorial steps to address breaking changes in the SDK.
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.


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.

❤️ Share

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

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