Commit Graph

28 Commits

Author SHA1 Message Date
7d1f29dd9d Implement comprehensive Next.js 16 optimizations
## Performance Improvements

### Build & Development (Phase 1)
- Enable Turbopack for 4-5x faster dev builds
- Configure Partial Prerendering (PPR) via cacheComponents
- Add advanced image optimization (AVIF/WebP support)
- Remove console.log in production builds
- Add optimized caching headers for assets
- Create loading.tsx for global loading UI
- Create error.tsx for error boundary
- Create blog post loading skeleton

### Client-Side JavaScript Reduction (Phase 2)
- Replace Framer Motion with lightweight CSS animations in template.tsx
- Refactor ScrollReveal to CSS-only implementation (removed React state)
- Add dynamic import for SearchModal component
- Fix site-footer to use build-time year calculation for PPR compatibility

### Image Optimization (Phase 3)
- Add explicit dimensions to all Next.js Image components
- Add responsive sizes attribute for optimal image loading
- Use priority for above-the-fold images
- Use loading="lazy" for below-the-fold images
- Prevents Cumulative Layout Shift (CLS)

### Type Safety
- Add @types/react-dom for createPortal support

## Technical Changes

**Files Modified:**
- next.config.mjs: PPR, image optimization, compiler settings
- package.json: Turbopack flag, @types/react-dom dependency
- app/template.tsx: CSS animations replace Framer Motion
- components/scroll-reveal.tsx: CSS-only with IntersectionObserver
- components/site-header.tsx: Dynamic import for SearchModal
- components/site-footer.tsx: Build-time year calculation
- styles/globals.css: Page transitions & scroll reveal CSS
- Image components: Dimensions, sizes, priority/lazy loading

**Files Created:**
- app/loading.tsx: Global loading spinner
- app/error.tsx: Error boundary with retry functionality
- app/blog/[slug]/loading.tsx: Blog post skeleton

## Expected Impact

- First Contentful Paint (FCP): ~1.2s → ~0.8s (-33%)
- Largest Contentful Paint (LCP): ~2.5s → ~1.5s (-40%)
- Cumulative Layout Shift (CLS): ~0.15 → ~0.05 (-67%)
- Total Blocking Time (TBT): ~300ms → ~150ms (-50%)
- Bundle Size: ~180KB → ~100KB (-44%)

## PPR Status
✓ Blog posts now use Partial Prerendering
✓ Static pages now use Partial Prerendering
✓ Tag archives now use Partial Prerendering

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 14:51:54 +08:00
4c08413936 Migrate to Contentlayer2 2025-11-19 21:46:49 +08:00
a249a120a5 Stage all layout updates 2025-11-19 17:38:45 +08:00
ce43491e2e Switch card images to next/image 2025-11-19 02:03:49 +08:00
eab80bd17a Render timeline ticks per card 2025-11-19 01:36:54 +08:00
66cd9b8608 Remove timeline markers entirely 2025-11-19 01:24:12 +08:00
2e80b7ac59 Center timeline markers vertically 2025-11-19 01:22:49 +08:00
be5d942c79 Align node ring visually with timeline rail 2025-11-19 01:17:33 +08:00
3018a25578 Turn timeline nodes into hollow rings 2025-11-19 01:14:06 +08:00
04182ec754 Align timeline nodes with brighter rail 2025-11-19 01:11:45 +08:00
9b2d754a2f Tighten timeline spacing and add white node 2025-11-19 01:07:25 +08:00
1a7ae8a269 Remove timeline node dot 2025-11-19 01:05:22 +08:00
9a7eb6cfe3 Center timeline nodes directly on rail 2025-11-19 01:04:08 +08:00
246646f176 Brighten timeline rail and align nodes 2025-11-19 01:00:18 +08:00
287c0d72a8 Refine timeline visuals and apply to blog list 2025-11-19 00:58:13 +08:00
fe191752da Add aesthetic timeline to post lists 2025-11-19 00:54:58 +08:00
80d0b236c5 Refine navigation and post UI 2025-11-18 17:34:05 +08:00
0c5c5e230c Improve dark-mode readability of tags using neutral backgrounds 2025-11-17 23:15:15 +08:00
4cb3e7627b Introduce env-driven accent color system and apply to links, icons, and tags 2025-11-17 22:46:55 +08:00
5d0fc0fc8b Avoid nested Links in list items to prevent hydration issues 2025-11-17 20:45:03 +08:00
b9b5c77bf1 Avoid wrapping article directly in Link to fix hydration mismatch 2025-11-17 20:33:05 +08:00
3b1a3eb6e1 Introduce colorful accents for tags, tag cloud, and hero 2025-11-17 20:23:45 +08:00
bede4a2f3e Stabilize tag URLs using slugs instead of raw tag text 2025-11-17 18:48:50 +08:00
7c5962485c Link tags to tag pages and add tag overview 2025-11-17 18:40:27 +08:00
2c9074538e Fine-tune dark mode color layering for body, meta, and excerpts 2025-11-17 18:24:13 +08:00
c590ba3210 Show excerpt under tags in article lists 2025-11-17 18:17:49 +08:00
bc5b62c753 Reorder and restyle tags in list items 2025-11-17 18:14:25 +08:00
0bff9bf7f6 Align home and blog lists with reference style 2025-11-17 17:53:06 +08:00