|
| 1 | +# Upgrade Plan: Next.js 16 & shadcn/ui Updates |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This plan outlines the steps to upgrade the dbdev website from Next.js 15.4.10 to Next.js 16.x and update shadcn/ui components to follow the latest patterns. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Current State |
| 10 | + |
| 11 | +| Component | Current | Target | |
| 12 | +|-----------|---------|--------| |
| 13 | +| Next.js | 15.4.10 | 16.1.x | |
| 14 | +| React | 19.1.0 | 19.x (compatible) | |
| 15 | +| shadcn/ui | Installed components | Latest patterns | |
| 16 | +| Turbopack | Not default | Default (Next.js 16) | |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +## Phase 1: Next.js 16 Upgrade |
| 21 | + |
| 22 | +### 1.1 Update Core Dependencies |
| 23 | + |
| 24 | +```bash |
| 25 | +cd website |
| 26 | +npm install next@latest react@latest react-dom@latest |
| 27 | +``` |
| 28 | + |
| 29 | +### 1.2 Address Breaking Changes |
| 30 | + |
| 31 | +Based on Next.js 16 upgrade guide: |
| 32 | + |
| 33 | +- [ ] **Turbopack is now default** - Remove any `--turbo` flags, now automatic |
| 34 | +- [ ] **Middleware renamed to proxy** - Check if any middleware needs updates |
| 35 | +- [ ] **React Compiler** - Consider enabling for automatic memoization |
| 36 | +- [ ] **Cache Components** - Evaluate `"use cache"` directive for applicable pages |
| 37 | + |
| 38 | +### 1.3 Configuration Updates |
| 39 | + |
| 40 | +Update `next.config.js` if needed: |
| 41 | +- Review experimental flags that may now be stable |
| 42 | +- Enable React Compiler if desired |
| 43 | + |
| 44 | +### 1.4 Test the Upgrade |
| 45 | + |
| 46 | +```bash |
| 47 | +npm run dev |
| 48 | +npm run build |
| 49 | +npm run lint |
| 50 | +``` |
| 51 | + |
| 52 | +--- |
| 53 | + |
| 54 | +## Phase 2: shadcn/ui Configuration Updates |
| 55 | + |
| 56 | +### 2.1 Update components.json |
| 57 | + |
| 58 | +Current configuration has `"rsc": false`. For App Router, consider enabling RSC: |
| 59 | + |
| 60 | +```json |
| 61 | +{ |
| 62 | + "$schema": "https://ui.shadcn.com/schema.json", |
| 63 | + "style": "default", |
| 64 | + "rsc": true, |
| 65 | + "tsx": true, |
| 66 | + "tailwind": { |
| 67 | + "config": "tailwind.config.js", |
| 68 | + "css": "styles/globals.css", |
| 69 | + "baseColor": "slate", |
| 70 | + "cssVariables": true |
| 71 | + }, |
| 72 | + "aliases": { |
| 73 | + "components": "~/components", |
| 74 | + "utils": "~/lib/utils" |
| 75 | + } |
| 76 | +} |
| 77 | +``` |
| 78 | + |
| 79 | +### 2.2 Update Radix UI Dependencies |
| 80 | + |
| 81 | +Current versions to update: |
| 82 | + |
| 83 | +| Package | Current | Action | |
| 84 | +|---------|---------|--------| |
| 85 | +| @radix-ui/react-avatar | ^1.1.10 | Check for updates | |
| 86 | +| @radix-ui/react-dialog | ^1.1.14 | Check for updates | |
| 87 | +| @radix-ui/react-dropdown-menu | ^2.1.15 | Check for updates | |
| 88 | +| @radix-ui/react-label | ^2.1.7 | Check for updates | |
| 89 | +| @radix-ui/react-separator | ^1.1.7 | Check for updates | |
| 90 | +| @radix-ui/react-slot | ^1.2.3 | Check for updates | |
| 91 | +| @radix-ui/react-tabs | ^1.1.12 | Check for updates | |
| 92 | +| @radix-ui/react-toast | ^1.2.14 | Check for updates | |
| 93 | + |
| 94 | +```bash |
| 95 | +npm update @radix-ui/react-avatar @radix-ui/react-dialog @radix-ui/react-dropdown-menu @radix-ui/react-label @radix-ui/react-separator @radix-ui/react-slot @radix-ui/react-tabs @radix-ui/react-toast |
| 96 | +``` |
| 97 | + |
| 98 | +### 2.3 Update Utility Dependencies |
| 99 | + |
| 100 | +```bash |
| 101 | +npm update class-variance-authority clsx tailwind-merge lucide-react |
| 102 | +``` |
| 103 | + |
| 104 | +--- |
| 105 | + |
| 106 | +## Phase 3: Component Pattern Updates |
| 107 | + |
| 108 | +### 3.1 Review Existing Components |
| 109 | + |
| 110 | +Components in `website/components/ui/`: |
| 111 | +- [ ] avatar.tsx |
| 112 | +- [ ] badge.tsx |
| 113 | +- [ ] button.tsx |
| 114 | +- [ ] card.tsx |
| 115 | +- [ ] dropdown-menu.tsx |
| 116 | +- [ ] input.tsx |
| 117 | +- [ ] label.tsx |
| 118 | +- [ ] separator.tsx |
| 119 | +- [ ] tabs.tsx |
| 120 | +- [ ] toast.tsx |
| 121 | + |
| 122 | +### 3.2 Consider Adding New Components |
| 123 | + |
| 124 | +shadcn/ui has added new components. Evaluate if any would benefit the project: |
| 125 | +- Sonner (modern toast alternative) |
| 126 | +- Drawer |
| 127 | +- Resizable |
| 128 | +- Carousel |
| 129 | +- Chart |
| 130 | + |
| 131 | +--- |
| 132 | + |
| 133 | +## Phase 4: Testing & Validation |
| 134 | + |
| 135 | +### 4.1 Development Testing |
| 136 | + |
| 137 | +```bash |
| 138 | +npm run dev |
| 139 | +``` |
| 140 | + |
| 141 | +- [ ] Verify all pages load correctly |
| 142 | +- [ ] Test component functionality |
| 143 | +- [ ] Check dark mode theming |
| 144 | +- [ ] Verify form submissions |
| 145 | + |
| 146 | +### 4.2 Build Testing |
| 147 | + |
| 148 | +```bash |
| 149 | +npm run build |
| 150 | +npm run start |
| 151 | +``` |
| 152 | + |
| 153 | +- [ ] Ensure production build succeeds |
| 154 | +- [ ] No TypeScript errors |
| 155 | +- [ ] No ESLint errors |
| 156 | + |
| 157 | +### 4.3 Visual Regression |
| 158 | + |
| 159 | +- [ ] Compare UI before/after upgrade |
| 160 | +- [ ] Verify styling consistency |
| 161 | + |
| 162 | +--- |
| 163 | + |
| 164 | +## Rollback Plan |
| 165 | + |
| 166 | +If issues arise: |
| 167 | + |
| 168 | +1. Revert `package.json` changes |
| 169 | +2. Delete `node_modules` and `package-lock.json` |
| 170 | +3. Run `npm install` |
| 171 | +4. Verify application works on previous versions |
| 172 | + |
| 173 | +--- |
| 174 | + |
| 175 | +## Files to Modify |
| 176 | + |
| 177 | +| File | Changes | |
| 178 | +|------|---------| |
| 179 | +| `website/package.json` | Update Next.js, React, Radix UI versions | |
| 180 | +| `website/components.json` | Enable RSC support | |
| 181 | +| `website/next.config.js` | Review for deprecated options | |
| 182 | +| `website/components/ui/*` | Update component patterns if needed | |
| 183 | + |
| 184 | +--- |
| 185 | + |
| 186 | +## Timeline Considerations |
| 187 | + |
| 188 | +- Phase 1 (Next.js upgrade): Core dependency update |
| 189 | +- Phase 2 (shadcn config): Configuration alignment |
| 190 | +- Phase 3 (Components): Pattern updates as needed |
| 191 | +- Phase 4 (Testing): Validation before merge |
| 192 | + |
| 193 | +--- |
| 194 | + |
| 195 | +## References |
| 196 | + |
| 197 | +- [Next.js 16 Release Notes](https://nextjs.org/blog/next-16) |
| 198 | +- [Next.js 16.1 Release Notes](https://nextjs.org/blog/next-16-1) |
| 199 | +- [Next.js 16 Upgrade Guide](https://nextjs.org/docs/app/guides/upgrading/version-16) |
| 200 | +- [shadcn/ui Documentation](https://ui.shadcn.com) |
| 201 | +- [shadcn/ui Changelog](https://github.com/shadcn-ui/ui/releases) |
0 commit comments