Skip to main content

Next.js 14 App Router Complete Guide - Server Components and Beyond

Muhammad Ubaid Raza
Wednesday, April 10, 2024
Next.jsReactApp Router
Next.js 14 App Router architecture diagram

Next.js 14 App Router Complete Guide: Server Components and Beyond

Next.js 14's App Router represents the future of React development, bringing Server Components, improved performance, and a more intuitive developer experience. After migrating multiple production applications to the App Router, I'm sharing the comprehensive guide that covers everything from basic concepts to advanced patterns.

Understanding the App Router Architecture

The App Router introduces a file-system based routing that's more powerful and flexible than the Pages Router:

app/
├── layout.js          # Root layout
├── page.js           # Home page
├── loading.js        # Loading UI
├── error.js          # Error UI
├── not-found.js      # 404 page
├── global-error.js   # Global error boundary
├── dashboard/
   ├── layout.js     # Dashboard layout
   ├── page.js       # Dashboard page
   ├── loading.js    # Dashboard loading
   └── settings/
       └── page.js   # Settings page
└── api/
    └── users/
        └── route.js  # API endpoint

Server Components by Default

Every component in the App Router is a Server Component unless explicitly marked as a Client Component:

// app/page.js - Server Component (default)
import { Suspense } from "react"
import UserList from "./components/UserList"
import Analytics from "./components/Analytics"

export default async function HomePage() {
  // Data fetching happens on the server
  const stats = await fetchSiteStats()

  return (
    <div>
      <h1>Dashboard</h1>
      <div className="grid grid-cols-2 gap-4">
        <Suspense fallback={<div>Loading users...</div>}>
          <UserList />
        </Suspense>
        <Analytics stats={stats} />
      </div>
    </div>
  )
}

// app/components/UserList.js - Server Component
async function UserList() {
  const users = await fetchUsers()

  return (
    <div>
      <h2>Recent Users</h2>
      {users.map((user) => (
        <UserCard key={user.id} user={user} />
      ))}
    </div>
  )
}

Client Components for Interactivity

Use the 'use client' directive for components that need interactivity:

// app/components/SearchBox.js
"use client"

import { useState } from "react"

export default function SearchBox({ onSearch }) {
  const [query, setQuery] = useState("")

  const handleSubmit = (e) => {
    e.preventDefault()
    onSearch(query)
  }

  return (
    <form onSubmit={handleSubmit}>
      <input
        type="text"
        value={query}
        onChange={(e) => setQuery(e.target.value)}
        placeholder="Search..."
        className="border rounded px-3 py-2"
      />
      <button
        type="submit"
        className="ml-2 px-4 py-2 bg-blue-500 text-white rounded"
      >
        Search
      </button>
    </form>
  )
}

Advanced Routing Patterns

Dynamic Routes and Route Groups

app/
├── (marketing)/          # Route group (doesn't affect URL)
   ├── layout.js        # Marketing layout
   ├── about/
   └── page.js      # /about
   └── contact/
       └── page.js      # /contact
├── (dashboard)/         # Another route group
   ├── layout.js        # Dashboard layout
   ├── analytics/
   └── page.js      # /analytics
   └── settings/
       └── page.js      # /settings
├── blog/
   ├── [slug]/
   └── page.js      # /blog/[slug]
   └── [...tags]/
       └── page.js      # /blog/[...tags] (catch-all)
└── shop/
    └── [[...slug]]/
        └── page.js      # /shop/[[...slug]] (optional catch-all)

Parallel Routes and Intercepting Routes

// app/dashboard/@analytics/page.js
export default async function Analytics() {
  const data = await fetchAnalytics();
  return <AnalyticsChart data={data} />;
}

// app/dashboard/@notifications/page.js
export default async function Notifications() {
  const notifications = await fetchNotifications();
  return <NotificationList notifications={notifications} />;
}

// app/dashboard/layout.js
export default function DashboardLayout({
  children,
  analytics,
  notifications
}) {
  return (
    <div className="dashboard-layout">
      <main>{children}</main>
      <aside className="sidebar">
        {analytics}
        {notifications}
      </aside>
    </div>
  );
}

Intercepting Routes for Modals

// app/@modal/(.)photo/[id]/page.js
import Modal from '@/components/Modal';
import PhotoView from '@/components/PhotoView';

export default function PhotoModal({ params }) {
  return (
    <Modal>
      <PhotoView id={params.id} />
    </Modal>
  );
}

// app/photo/[id]/page.js
export default function PhotoPage({ params }) {
  return <PhotoView id={params.id} />;
}

Data Fetching and Caching Strategies

Server-Side Data Fetching

// app/posts/page.js
async function getPosts() {
  const res = await fetch("https://api.example.com/posts", {
    // Next.js extends fetch with caching options
    next: {
      revalidate: 3600, // Revalidate every hour
      tags: ["posts"], // Cache tags for on-demand revalidation
    },
  })

  if (!res.ok) {
    throw new Error("Failed to fetch posts")
  }

  return res.json()
}

export default async function PostsPage() {
  const posts = await getPosts()

  return (
    <div>
      <h1>Blog Posts</h1>
      {posts.map((post) => (
        <article key={post.id}>
          <h2>{post.title}</h2>
          <p>{post.excerpt}</p>
        </article>
      ))}
    </div>
  )
}

Advanced Caching Patterns

// app/lib/data.js
import { unstable_cache } from "next/cache"

// Cache expensive database queries
export const getUser = unstable_cache(
  async (id) => {
    const user = await db.user.findUnique({ where: { id } })
    return user
  },
  ["user"], // Cache key
  {
    revalidate: 3600, // 1 hour
    tags: ["user"], // For targeted revalidation
  },
)

// Cache with dynamic parameters
export const getUserPosts = unstable_cache(
  async (userId, limit = 10) => {
    const posts = await db.post.findMany({
      where: { authorId: userId },
      take: limit,
      orderBy: { createdAt: "desc" },
    })
    return posts
  },
  ["user-posts"],
  {
    revalidate: 1800, // 30 minutes
    tags: (userId) => [`user-${userId}-posts`],
  },
)

On-Demand Revalidation

// app/api/revalidate/route.js
import { revalidateTag, revalidatePath } from "next/cache"
import { NextResponse } from "next/server"

export async function POST(request) {
  const { tag, path, secret } = await request.json()

  // Verify secret to prevent unauthorized revalidation
  if (secret !== process.env.REVALIDATION_SECRET) {
    return NextResponse.json({ message: "Invalid secret" }, { status: 401 })
  }

  if (tag) {
    revalidateTag(tag)
    return NextResponse.json({ message: `Tag ${tag} revalidated` })
  }

  if (path) {
    revalidatePath(path)
    return NextResponse.json({ message: `Path ${path} revalidated` })
  }

  return NextResponse.json(
    { message: "No tag or path provided" },
    { status: 400 },
  )
}

// Usage in your CMS webhook
// POST /api/revalidate
// { "tag": "posts", "secret": "your-secret" }

Streaming and Loading States

Streaming with Suspense

// app/dashboard/page.js
import { Suspense } from "react"
import UserStats from "./components/UserStats"
import RecentActivity from "./components/RecentActivity"
import AnalyticsChart from "./components/AnalyticsChart"

export default function Dashboard() {
  return (
    <div className="dashboard">
      <h1>Dashboard</h1>

      {/* Fast loading component */}
      <Suspense fallback={<UserStatsSkeleton />}>
        <UserStats />
      </Suspense>

      {/* Slower loading components stream in independently */}
      <div className="grid grid-cols-2 gap-4">
        <Suspense fallback={<ActivitySkeleton />}>
          <RecentActivity />
        </Suspense>

        <Suspense fallback={<ChartSkeleton />}>
          <AnalyticsChart />
        </Suspense>
      </div>
    </div>
  )
}

Custom Loading Components

// app/dashboard/loading.js
export default function DashboardLoading() {
  return (
    <div className="dashboard-loading">
      <div className="animate-pulse">
        <div className="h-8 bg-gray-200 rounded w-1/4 mb-6"></div>
        <div className="grid grid-cols-3 gap-4">
          {[...Array(6)].map((_, i) => (
            <div key={i} className="h-32 bg-gray-200 rounded"></div>
          ))}
        </div>
      </div>
    </div>
  )
}

Error Handling and Recovery

Error Boundaries

// app/error.js - Global error boundary
'use client';

import { useEffect } from 'react';

export default function Error({ error, reset }) {
  useEffect(() => {
    // Log error to monitoring service
    console.error('Application error:', error);
  }, [error]);

  return (
    <div className="error-boundary">
      <h2>Something went wrong!</h2>
      <p>{error.message}</p>
      <button
        onClick={() => reset()}
        className="mt-4 px-4 py-2 bg-blue-500 text-white rounded"
      >
        Try again
      </button>
    </div>
  );
}

// app/dashboard/error.js - Scoped error boundary
'use client';

export default function DashboardError({ error, reset }) {
  return (
    <div className="dashboard-error">
      <h2>Dashboard Error</h2>
      <p>Failed to load dashboard data</p>
      <button onClick={reset}>Retry</button>
    </div>
  );
}

Global Error Handling

// app/global-error.js
"use client"

export default function GlobalError({ error, reset }) {
  return (
    <html>
      <body>
        <div className="global-error">
          <h1>Application Error</h1>
          <p>A critical error occurred. Please try refreshing the page.</p>
          <button onClick={() => window.location.reload()}>Refresh Page</button>
        </div>
      </body>
    </html>
  )
}

API Routes and Server Actions

Modern API Routes

// app/api/users/route.js
import { NextResponse } from "next/server"
import { headers } from "next/headers"

export async function GET(request) {
  const { searchParams } = new URL(request.url)
  const page = searchParams.get("page") || "1"
  const limit = searchParams.get("limit") || "10"

  try {
    const users = await fetchUsers({
      page: parseInt(page),
      limit: parseInt(limit),
    })

    return NextResponse.json({
      users,
      pagination: {
        page: parseInt(page),
        limit: parseInt(limit),
        total: users.length,
      },
    })
  } catch (error) {
    return NextResponse.json(
      { error: "Failed to fetch users" },
      { status: 500 },
    )
  }
}

export async function POST(request) {
  const headersList = headers()
  const authorization = headersList.get("authorization")

  if (!authorization) {
    return NextResponse.json({ error: "Unauthorized" }, { status: 401 })
  }

  const userData = await request.json()

  try {
    const user = await createUser(userData)
    return NextResponse.json(user, { status: 201 })
  } catch (error) {
    return NextResponse.json(
      { error: "Failed to create user" },
      { status: 400 },
    )
  }
}

Server Actions

// app/lib/actions.js
"use server"

import { revalidatePath } from "next/cache"
import { redirect } from "next/navigation"

export async function createPost(formData) {
  const title = formData.get("title")
  const content = formData.get("content")

  // Validate data
  if (!title || !content) {
    throw new Error("Title and content are required")
  }

  try {
    const post = await db.post.create({
      data: { title, content },
    })

    // Revalidate the posts page
    revalidatePath("/posts")

    // Redirect to the new post
    redirect(`/posts/${post.id}`)
  } catch (error) {
    throw new Error("Failed to create post")
  }
}

// app/posts/new/page.js
import { createPost } from "@/lib/actions"

export default function NewPost() {
  return (
    <form action={createPost}>
      <input type="text" name="title" placeholder="Post title" required />
      <textarea name="content" placeholder="Post content" required />
      <button type="submit">Create Post</button>
    </form>
  )
}

Migration from Pages Router

Gradual Migration Strategy

// next.config.js - Enable both routers during migration
/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    appDir: true, // Enable App Router
  },
  // Pages Router continues to work
}

module.exports = nextConfig

Converting Pages to App Router

// Before: pages/blog/[slug].js
import { GetStaticProps, GetStaticPaths } from 'next';

export default function BlogPost({ post }) {
  return (
    <article>
      <h1>{post.title}</h1>
      <div dangerouslySetInnerHTML={{ __html: post.content }} />
    </article>
  );
}

export const getStaticProps: GetStaticProps = async ({ params }) => {
  const post = await fetchPost(params.slug);
  return { props: { post } };
};

export const getStaticPaths: GetStaticPaths = async () => {
  const posts = await fetchAllPosts();
  const paths = posts.map(post => ({ params: { slug: post.slug } }));
  return { paths, fallback: false };
};

// After: app/blog/[slug]/page.js
async function getPost(slug) {
  const post = await fetchPost(slug);
  return post;
}

export async function generateStaticParams() {
  const posts = await fetchAllPosts();
  return posts.map(post => ({ slug: post.slug }));
}

export default async function BlogPost({ params }) {
  const post = await getPost(params.slug);

  return (
    <article>
      <h1>{post.title}</h1>
      <div dangerouslySetInnerHTML={{ __html: post.content }} />
    </article>
  );
}

Performance Optimization

Bundle Analysis and Optimization

// next.config.js
const withBundleAnalyzer = require("@next/bundle-analyzer")({
  enabled: process.env.ANALYZE === "true",
})

/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    optimizePackageImports: ["lucide-react", "date-fns"],
  },
  images: {
    formats: ["image/avif", "image/webp"],
    remotePatterns: [
      {
        protocol: "https",
        hostname: "images.unsplash.com",
      },
    ],
  },
}

module.exports = withBundleAnalyzer(nextConfig)

Image Optimization

// app/components/OptimizedImage.js
import Image from "next/image"

export default function OptimizedImage({ src, alt, ...props }) {
  return (
    <Image
      src={src}
      alt={alt}
      placeholder="blur"
      blurDataURL="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAAIAAoDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAhEAACAQMDBQAAAAAAAAAAAAABAgMABAUGIWGRkqGx0f/EABUBAQEAAAAAAAAAAAAAAAAAAAMF/8QAGhEAAgIDAAAAAAAAAAAAAAAAAAECEgMRkf/aAAwDAQACEQMRAD8AltJagyeH0AthI5xdrLcNM91BF5pX2HaH9bcfaSXWGaRmknyJckliyjqTzSlT54b6bk+h0R//2Q=="
      quality={85}
      sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
      {...props}
    />
  )
}

Testing Strategies

Component Testing

// __tests__/components/UserCard.test.js
import { render, screen } from "@testing-library/react"
import UserCard from "@/components/UserCard"

const mockUser = {
  id: 1,
  name: "John Doe",
  email: "john@example.com",
  avatar: "/avatar.jpg",
}

describe("UserCard", () => {
  it("renders user information correctly", () => {
    render(<UserCard user={mockUser} />)

    expect(screen.getByText("John Doe")).toBeInTheDocument()
    expect(screen.getByText("john@example.com")).toBeInTheDocument()
    expect(screen.getByRole("img")).toHaveAttribute("alt", "John Doe")
  })
})

Integration Testing

// __tests__/app/dashboard/page.test.js
import { render, screen, waitFor } from "@testing-library/react"
import Dashboard from "@/app/dashboard/page"

// Mock the data fetching functions
jest.mock("@/lib/data", () => ({
  fetchUserStats: jest.fn(() => Promise.resolve({ users: 100, posts: 50 })),
  fetchRecentActivity: jest.fn(() => Promise.resolve([])),
}))

describe("Dashboard Page", () => {
  it("renders dashboard with user stats", async () => {
    render(<Dashboard />)

    expect(screen.getByText("Dashboard")).toBeInTheDocument()

    await waitFor(() => {
      expect(screen.getByText("100")).toBeInTheDocument()
      expect(screen.getByText("50")).toBeInTheDocument()
    })
  })
})

Deployment and Production Considerations

Environment Configuration

// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
  env: {
    CUSTOM_KEY: process.env.CUSTOM_KEY,
  },
  images: {
    domains: ["example.com"],
  },
  async headers() {
    return [
      {
        source: "/api/:path*",
        headers: [
          { key: "Access-Control-Allow-Origin", value: "*" },
          {
            key: "Access-Control-Allow-Methods",
            value: "GET,OPTIONS,PATCH,DELETE,POST,PUT",
          },
        ],
      },
    ]
  },
  async rewrites() {
    return [
      {
        source: "/api/proxy/:path*",
        destination: "https://external-api.com/:path*",
      },
    ]
  },
}

module.exports = nextConfig

Monitoring and Analytics

// app/lib/analytics.js
export function trackEvent(eventName, properties = {}) {
  if (typeof window !== "undefined") {
    // Client-side analytics
    gtag("event", eventName, properties)
  }
}

// app/layout.js
import { Analytics } from "@vercel/analytics/react"
import { SpeedInsights } from "@vercel/speed-insights/next"

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Analytics />
        <SpeedInsights />
      </body>
    </html>
  )
}

Conclusion

Next.js 14's App Router represents a significant evolution in React development, offering:

  1. Better Performance - Server Components reduce bundle sizes and improve loading times
  2. Improved Developer Experience - Intuitive file-system routing and better error handling
  3. Enhanced Caching - Sophisticated caching strategies for optimal performance
  4. Streaming Support - Progressive loading for better user experience
  5. Type Safety - Better TypeScript integration and type inference

The migration from Pages Router to App Router requires careful planning, but the benefits in performance, developer experience, and maintainability make it worthwhile for most applications.

Start with new features in the App Router, gradually migrate existing pages, and leverage the powerful caching and streaming capabilities to build faster, more responsive applications.

Have you started using the App Router in your projects? What challenges have you encountered during migration? I'd love to hear about your experiences and help with any specific issues you're facing.

Full-stack engineer leading teams to build scalable systems & tools, with solid DevOps expertise.

Muhammad Ubaid R.

\n\n{#each data.items as item}\n
{item.name}
\n{/each}\n","svelte",[122,9539,9540,9545,9550,9555,9560,9564,9569,9574],{"__ignoreMap":120},[125,9541,9542],{"class":127,"line":128},[125,9543,9544],{},"\n",[125,9546,9547],{"class":127,"line":135},[125,9548,9549],{},"\n",[125,9561,9562],{"class":127,"line":170},[125,9563,387],{"emptyLinePlaceholder":386},[125,9565,9566],{"class":127,"line":181},[125,9567,9568],{},"{#each data.items as item}\n",[125,9570,9571],{"class":127,"line":192},[125,9572,9573],{},"
{item.name}
\n",[125,9575,9576],{"class":127,"line":203},[125,9577,9578],{},"{/each}\n",[104,9580,9581,1898],{},[7774,9582,9440],{},[7919,9584,9585,9588,9591,9594],{},[7771,9586,9587],{},"Minimal runtime",[7771,9589,9590],{},"Excellent performance",[7771,9592,9593],{},"Simple syntax",[7771,9595,9596],{},"Small bundle sizes",[301,9598,9600],{"id":9599},"remix","Remix",[104,9602,9603,9605],{},[7774,9604,9342],{},": Data-driven applications, forms",[115,9607,9609],{"className":8012,"code":9608,"language":8014,"meta":120,"style":120},"// Remix - Form handling\nexport async function action({ request }) {\n const formData = await request.formData()\n // Process form\n}\n",[122,9610,9611,9616,9634,9652,9657],{"__ignoreMap":120},[125,9612,9613],{"class":127,"line":128},[125,9614,9615],{"class":145},"// Remix - Form handling\n",[125,9617,9618,9620,9622,9624,9626,9628,9630,9632],{"class":127,"line":135},[125,9619,392],{"class":324},[125,9621,399],{"class":398},[125,9623,402],{"class":398},[125,9625,5332],{"class":405},[125,9627,846],{"class":328},[125,9629,2746],{"class":708},[125,9631,852],{"class":328},[125,9633,412],{"class":328},[125,9635,9636,9638,9640,9642,9644,9646,9648,9650],{"class":127,"line":16},[125,9637,422],{"class":398},[125,9639,5018],{"class":332},[125,9641,428],{"class":328},[125,9643,431],{"class":324},[125,9645,2746],{"class":332},[125,9647,697],{"class":328},[125,9649,5002],{"class":405},[125,9651,438],{"class":437},[125,9653,9654],{"class":127,"line":159},[125,9655,9656],{"class":145}," // Process form\n",[125,9658,9659],{"class":127,"line":170},[125,9660,603],{"class":328},[104,9662,9663,1898],{},[7774,9664,9440],{},[7919,9666,9667,9670,9673,9676],{},[7771,9668,9669],{},"Web standards focus",[7771,9671,9672],{},"Excellent form handling",[7771,9674,9675],{},"Progressive enhancement",[7771,9677,9678],{},"Nested routing",[99,9680,9682],{"id":9681},"real-world-performance-comparison","Real-World Performance Comparison",[9684,9685,9686,9708],"table",{},[9687,9688,9689],"thead",{},[9690,9691,9692,9696,9699,9702,9705],"tr",{},[9693,9694,9695],"th",{},"Framework",[9693,9697,9698],{},"TTI",[9693,9700,9701],{},"Bundle Size",[9693,9703,9704],{},"LCP",[9693,9706,9707],{},"FID",[9709,9710,9711,9729,9745,9760],"tbody",{},[9690,9712,9713,9717,9720,9723,9726],{},[9714,9715,9716],"td",{},"Next.js 16",[9714,9718,9719],{},"1.2s",[9714,9721,9722],{},"145KB",[9714,9724,9725],{},"1.5s",[9714,9727,9728],{},"15ms",[9690,9730,9731,9733,9736,9739,9742],{},[9714,9732,9458],{},[9714,9734,9735],{},"1.1s",[9714,9737,9738],{},"132KB",[9714,9740,9741],{},"1.4s",[9714,9743,9744],{},"12ms",[9690,9746,9747,9749,9752,9755,9757],{},[9714,9748,9527],{},[9714,9750,9751],{},"0.9s",[9714,9753,9754],{},"85KB",[9714,9756,9735],{},[9714,9758,9759],{},"10ms",[9690,9761,9762,9765,9768,9771,9774],{},[9714,9763,9764],{},"React SPA",[9714,9766,9767],{},"2.5s",[9714,9769,9770],{},"250KB",[9714,9772,9773],{},"2.8s",[9714,9775,9776],{},"45ms",[99,9778,8544],{"id":8543},[301,9780,9782],{"id":9781},"from-create-react-app","From Create React App",[115,9784,9786],{"className":117,"code":9785,"language":119,"meta":120,"style":120},"# Using create-next-app\nnpx create-next-app@latest my-app\n# Or use codemods for automatic migration\nnpx @next/codemod@latest react-to-next my-app\n",[122,9787,9788,9793,9804,9809],{"__ignoreMap":120},[125,9789,9790],{"class":127,"line":128},[125,9791,9792],{"class":145},"# Using create-next-app\n",[125,9794,9795,9798,9801],{"class":127,"line":135},[125,9796,9797],{"class":131},"npx",[125,9799,9800],{"class":141}," create-next-app@latest",[125,9802,9803],{"class":141}," my-app\n",[125,9805,9806],{"class":127,"line":16},[125,9807,9808],{"class":145},"# Or use codemods for automatic migration\n",[125,9810,9811,9813,9816,9819],{"class":127,"line":159},[125,9812,9797],{"class":131},[125,9814,9815],{"class":141}," @next/codemod@latest",[125,9817,9818],{"class":141}," react-to-next",[125,9820,9803],{"class":141},[301,9822,9824],{"id":9823},"from-vue-cli","From Vue CLI",[115,9826,9828],{"className":117,"code":9827,"language":119,"meta":120,"style":120},"# Migrate to Nuxt 4\nnpx nuxi@latest init my-app\n# Follow migration guide for Vue 3 composition API\n",[122,9829,9830,9835,9847],{"__ignoreMap":120},[125,9831,9832],{"class":127,"line":128},[125,9833,9834],{"class":145},"# Migrate to Nuxt 4\n",[125,9836,9837,9839,9842,9845],{"class":127,"line":135},[125,9838,9797],{"class":131},[125,9840,9841],{"class":141}," nuxi@latest",[125,9843,9844],{"class":141}," init",[125,9846,9803],{"class":141},[125,9848,9849],{"class":127,"line":16},[125,9850,9851],{"class":145},"# Follow migration guide for Vue 3 composition API\n",[99,9853,9855],{"id":9854},"best-practices-for-2026","Best Practices for 2026",[301,9857,9859],{"id":9858},"_1-embrace-server-components","1. Embrace Server Components",[115,9861,9863],{"className":8012,"code":9862,"language":8014,"meta":120,"style":120},"// Server Component - runs on server only\nexport default async function ServerComponent() {\n const data = await db.query('SELECT * FROM ...')\n return \n}\n",[122,9864,9865,9870,9887,9914,9936],{"__ignoreMap":120},[125,9866,9867],{"class":127,"line":128},[125,9868,9869],{"class":145},"// Server Component - runs on server only\n",[125,9871,9872,9874,9876,9878,9880,9883,9885],{"class":127,"line":135},[125,9873,392],{"class":324},[125,9875,395],{"class":324},[125,9877,399],{"class":398},[125,9879,402],{"class":398},[125,9881,9882],{"class":405}," ServerComponent",[125,9884,409],{"class":328},[125,9886,412],{"class":328},[125,9888,9889,9891,9893,9895,9897,9899,9901,9903,9905,9907,9910,9912],{"class":127,"line":16},[125,9890,422],{"class":398},[125,9892,1383],{"class":332},[125,9894,428],{"class":328},[125,9896,431],{"class":324},[125,9898,2301],{"class":332},[125,9900,697],{"class":328},[125,9902,864],{"class":405},[125,9904,703],{"class":437},[125,9906,1677],{"class":328},[125,9908,9909],{"class":141},"SELECT * FROM ...",[125,9911,1677],{"class":328},[125,9913,885],{"class":437},[125,9915,9916,9918,9920,9923,9925,9927,9929,9931,9934],{"class":127,"line":159},[125,9917,447],{"class":324},[125,9919,1402],{"class":328},[125,9921,9922],{"class":131},"ClientComponent",[125,9924,1383],{"class":131},[125,9926,565],{"class":328},[125,9928,1412],{"class":437},[125,9930,2619],{"class":328},[125,9932,9933],{"class":437}," /",[125,9935,461],{"class":328},[125,9937,9938],{"class":127,"line":170},[125,9939,603],{"class":437},[301,9941,9943],{"id":9942},"_2-optimize-data-fetching","2. Optimize Data Fetching",[115,9945,9947],{"className":8012,"code":9946,"language":8014,"meta":120,"style":120},"// Use appropriate caching strategies\nconst { data } = await useFetch(\"/api/data\", {\n cache: \"force-cache\", // Static\n // cache: 'no-store', // Dynamic\n})\n",[122,9948,9949,9954,9983,10001,10009],{"__ignoreMap":120},[125,9950,9951],{"class":127,"line":128},[125,9952,9953],{"class":145},"// Use appropriate caching strategies\n",[125,9955,9956,9958,9960,9963,9965,9967,9969,9971,9973,9975,9977,9979,9981],{"class":127,"line":135},[125,9957,5506],{"class":398},[125,9959,329],{"class":328},[125,9961,9962],{"class":332}," data ",[125,9964,2619],{"class":328},[125,9966,428],{"class":328},[125,9968,431],{"class":324},[125,9970,9218],{"class":405},[125,9972,703],{"class":332},[125,9974,497],{"class":328},[125,9976,9225],{"class":141},[125,9978,497],{"class":328},[125,9980,867],{"class":328},[125,9982,412],{"class":328},[125,9984,9985,9988,9990,9992,9994,9996,9998],{"class":127,"line":16},[125,9986,9987],{"class":437}," cache",[125,9989,1898],{"class":328},[125,9991,342],{"class":328},[125,9993,9404],{"class":141},[125,9995,497],{"class":328},[125,9997,867],{"class":328},[125,9999,10000],{"class":145}," // Static\n",[125,10002,10003,10006],{"class":127,"line":159},[125,10004,10005],{"class":145}," // cache: 'no-store',",[125,10007,10008],{"class":145}," // Dynamic\n",[125,10010,10011,10013],{"class":127,"line":170},[125,10012,2619],{"class":328},[125,10014,885],{"class":332},[301,10016,10018],{"id":10017},"_3-implement-proper-error-handling","3. Implement Proper Error Handling",[115,10020,10022],{"className":8012,"code":10021,"language":8014,"meta":120,"style":120},"// Error boundaries and error pages\nexport default defineComponent({\n setup() {\n const { error } = useAsyncData()\n if (error) return \n }\n})\n",[122,10023,10024,10029,10042,10050,10067,10098,10102],{"__ignoreMap":120},[125,10025,10026],{"class":127,"line":128},[125,10027,10028],{"class":145},"// Error boundaries and error pages\n",[125,10030,10031,10033,10035,10038,10040],{"class":127,"line":135},[125,10032,392],{"class":324},[125,10034,395],{"class":324},[125,10036,10037],{"class":405}," defineComponent",[125,10039,703],{"class":332},[125,10041,1979],{"class":328},[125,10043,10044,10046,10048],{"class":127,"line":16},[125,10045,9199],{"class":437},[125,10047,409],{"class":328},[125,10049,412],{"class":328},[125,10051,10052,10054,10056,10058,10060,10062,10065],{"class":127,"line":159},[125,10053,2291],{"class":398},[125,10055,329],{"class":328},[125,10057,3668],{"class":332},[125,10059,336],{"class":328},[125,10061,428],{"class":328},[125,10063,10064],{"class":405}," useAsyncData",[125,10066,438],{"class":437},[125,10068,10069,10072,10074,10076,10078,10081,10083,10086,10088,10090,10092,10094,10096],{"class":127,"line":170},[125,10070,10071],{"class":324}," if",[125,10073,901],{"class":437},[125,10075,3705],{"class":332},[125,10077,1976],{"class":437},[125,10079,10080],{"class":324},"return",[125,10082,1402],{"class":328},[125,10084,10085],{"class":131},"ErrorPage",[125,10087,3668],{"class":131},[125,10089,565],{"class":328},[125,10091,3705],{"class":437},[125,10093,2619],{"class":328},[125,10095,9933],{"class":437},[125,10097,461],{"class":328},[125,10099,10100],{"class":127,"line":181},[125,10101,938],{"class":437},[125,10103,10104],{"class":127,"line":192},[125,10105,10106],{"class":437},"})\n",[99,10108,10110],{"id":10109},"the-future-of-meta-frameworks","The Future of Meta-Frameworks",[104,10112,10113],{},"Looking ahead, we expect:",[7768,10115,10116,10122,10128,10134],{},[7771,10117,10118,10121],{},[7774,10119,10120],{},"Edge Computing",": More edge-native features",[7771,10123,10124,10127],{},[7774,10125,10126],{},"AI Integration",": Built-in AI capabilities",[7771,10129,10130,10133],{},[7774,10131,10132],{},"Better DX",": Even more automation and conventions",[7771,10135,10136,10139],{},[7774,10137,10138],{},"Unified APIs",": Standardization across frameworks",[99,10141,7763],{"id":7762},[104,10143,10144],{},"Meta-frameworks have won because they solve real problems: performance, SEO, developer experience, and maintainability. Whether you choose Next.js, Nuxt, SvelteKit, or another framework, the meta-framework approach is now the standard for good reason.",[104,10146,10147],{},"The question is no longer \"Should I use a meta-framework?\" but \"Which meta-framework is right for my project?\"",[10149,10150],"hr",{},[104,10152,10153,10156],{},[7774,10154,10155],{},"Ready to migrate?"," Start with a new project or a non-critical section of your application. The learning curve is gentle, and the benefits are immediate.",[7812,10158,10159],{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}",{"title":120,"searchDepth":135,"depth":135,"links":10161},[10162,10163,10164,10169,10175,10176,10180,10185,10186],{"id":9104,"depth":135,"text":9099},{"id":9113,"depth":135,"text":9114},{"id":9158,"depth":135,"text":9159,"children":10165},[10166,10167,10168],{"id":9162,"depth":16,"text":9163},{"id":9273,"depth":16,"text":9274},{"id":9311,"depth":16,"text":9312},{"id":9332,"depth":135,"text":9333,"children":10170},[10171,10172,10173,10174],{"id":9336,"depth":16,"text":9337},{"id":9457,"depth":16,"text":9458},{"id":9526,"depth":16,"text":9527},{"id":9599,"depth":16,"text":9600},{"id":9681,"depth":135,"text":9682},{"id":8543,"depth":135,"text":8544,"children":10177},[10178,10179],{"id":9781,"depth":16,"text":9782},{"id":9823,"depth":16,"text":9824},{"id":9854,"depth":135,"text":9855,"children":10181},[10182,10183,10184],{"id":9858,"depth":16,"text":9859},{"id":9942,"depth":16,"text":9943},{"id":10017,"depth":16,"text":10018},{"id":10109,"depth":135,"text":10110},{"id":7762,"depth":135,"text":7763},"2026-02-23","Discover why meta-frameworks like Next.js, Nuxt, and SvelteKit have become the default choice for web development in 2026.",{"readingTime":10190},"8 min read","/blog/26-meta-frameworks-new-default-2026",{"title":9099,"description":10188},"Modern Web Development","Exploring the latest in web framework technology",{"src":10196,"mime":7873,"alt":10197,"width":7875,"height":7876},"/img/blog/26-meta-frameworks-new-default-2026/banner.svg","Meta-Frameworks 2026 - Modern framework logos connected in network on dark gradient background","blog/26-meta-frameworks-new-default-2026",[10200,7879,10201,10202,10203],"Meta-Frameworks","Nuxt","SvelteKit","Web Development","8iJs8iUFApsYayvqX9yXG9_wUixKKAiyYmRvfxBOuNI",{"id":10206,"title":10207,"abstract":7863,"author":7887,"authorUrl":7863,"body":10208,"date":13511,"dateUpdated":13511,"description":13512,"excerpt":7863,"extension":7864,"featured":386,"headline":7863,"image":7863,"meta":13513,"navigation":386,"ogImage":7863,"path":13514,"seo":13515,"series":13516,"seriesDescription":13517,"seriesOrder":135,"socialImage":13518,"stem":13521,"tags":13522,"__hash__":13523},"blog/blog/32-react-compiler-auto-memoization-2026.md","React Compiler & Auto-Memoization: End of Manual Optimization",{"type":96,"value":10209,"toc":13469},[10210,10213,10223,10227,10230,10234,10465,10469,10626,10630,10634,10782,10786,11017,11021,11135,11139,11143,11320,11324,11443,11447,11766,11770,11774,11841,11845,11919,11923,11938,11942,11946,12179,12183,12259,12263,12466,12470,12474,12666,12670,12940,12944,13091,13093,13097,13177,13181,13258,13262,13322,13326,13330,13403,13407,13450,13452,13455,13458,13460,13466],[99,10211,10207],{"id":10212},"react-compiler-auto-memoization-end-of-manual-optimization",[104,10214,10215,10216,7899,10218,7903,10220,10222],{},"The React landscape has changed dramatically. In 2026, the React Compiler automatically optimizes your components, eliminating the need for manual memoization with ",[122,10217,7898],{},[122,10219,7902],{},[122,10221,7906],{},". This isn't just a quality-of-life improvement—it's a fundamental shift in how we write React code.",[99,10224,10226],{"id":10225},"what-is-react-compiler","What is React Compiler?",[104,10228,10229],{},"React Compiler is a zero-config optimization tool that automatically memoizes components and values. It analyzes your component code and applies memoization where beneficial, removing the burden from developers.",[301,10231,10233],{"id":10232},"before-react-compiler","Before React Compiler",[115,10235,10237],{"className":8012,"code":10236,"language":8014,"meta":120,"style":120},"// Manual optimization required\nconst UserProfile = ({ user, onUpdate }) => {\n const formattedName = useMemo(() => {\n return `${user.firstName} ${user.lastName}`\n }, [user.firstName, user.lastName])\n\n const handleClick = useCallback(() => {\n onUpdate(user.id)\n }, [user.id, onUpdate])\n\n return (\n
\n {formattedName}\n
\n )\n}\n\nexport default React.memo(UserProfile)\n",[122,10238,10239,10244,10268,10287,10316,10338,10342,10361,10376,10394,10398,10404,10419,10428,10436,10440,10444,10448],{"__ignoreMap":120},[125,10240,10241],{"class":127,"line":128},[125,10242,10243],{"class":145},"// Manual optimization required\n",[125,10245,10246,10248,10251,10253,10255,10257,10259,10262,10264,10266],{"class":127,"line":135},[125,10247,5506],{"class":398},[125,10249,10250],{"class":332}," UserProfile ",[125,10252,494],{"class":328},[125,10254,5732],{"class":328},[125,10256,2294],{"class":708},[125,10258,867],{"class":328},[125,10260,10261],{"class":708}," onUpdate",[125,10263,852],{"class":328},[125,10265,715],{"class":398},[125,10267,412],{"class":328},[125,10269,10270,10272,10275,10277,10279,10281,10283,10285],{"class":127,"line":16},[125,10271,422],{"class":398},[125,10273,10274],{"class":332}," formattedName",[125,10276,428],{"class":328},[125,10278,8125],{"class":405},[125,10280,703],{"class":437},[125,10282,409],{"class":328},[125,10284,715],{"class":398},[125,10286,412],{"class":328},[125,10288,10289,10291,10294,10296,10298,10301,10303,10306,10308,10310,10313],{"class":127,"line":159},[125,10290,2335],{"class":324},[125,10292,10293],{"class":328}," `${",[125,10295,709],{"class":332},[125,10297,697],{"class":328},[125,10299,10300],{"class":332},"firstName",[125,10302,2619],{"class":328},[125,10304,10305],{"class":328}," ${",[125,10307,709],{"class":332},[125,10309,697],{"class":328},[125,10311,10312],{"class":332},"lastName",[125,10314,10315],{"class":328},"}`\n",[125,10317,10318,10320,10322,10324,10326,10328,10330,10332,10334,10336],{"class":127,"line":170},[125,10319,3727],{"class":328},[125,10321,861],{"class":437},[125,10323,709],{"class":332},[125,10325,697],{"class":328},[125,10327,10300],{"class":332},[125,10329,867],{"class":328},[125,10331,2294],{"class":332},[125,10333,697],{"class":328},[125,10335,10312],{"class":332},[125,10337,8110],{"class":437},[125,10339,10340],{"class":127,"line":181},[125,10341,387],{"emptyLinePlaceholder":386},[125,10343,10344,10346,10349,10351,10353,10355,10357,10359],{"class":127,"line":192},[125,10345,422],{"class":398},[125,10347,10348],{"class":332}," handleClick",[125,10350,428],{"class":328},[125,10352,8049],{"class":405},[125,10354,703],{"class":437},[125,10356,409],{"class":328},[125,10358,715],{"class":398},[125,10360,412],{"class":328},[125,10362,10363,10366,10368,10370,10372,10374],{"class":127,"line":203},[125,10364,10365],{"class":405}," onUpdate",[125,10367,703],{"class":437},[125,10369,709],{"class":332},[125,10371,697],{"class":328},[125,10373,737],{"class":332},[125,10375,885],{"class":437},[125,10377,10378,10380,10382,10384,10386,10388,10390,10392],{"class":127,"line":211},[125,10379,3727],{"class":328},[125,10381,861],{"class":437},[125,10383,709],{"class":332},[125,10385,697],{"class":328},[125,10387,737],{"class":332},[125,10389,867],{"class":328},[125,10391,10261],{"class":332},[125,10393,8110],{"class":437},[125,10395,10396],{"class":127,"line":225},[125,10397,387],{"emptyLinePlaceholder":386},[125,10399,10400,10402],{"class":127,"line":237},[125,10401,447],{"class":324},[125,10403,450],{"class":437},[125,10405,10406,10408,10410,10412,10414,10417],{"class":127,"line":249},[125,10407,455],{"class":328},[125,10409,458],{"class":332},[125,10411,3987],{"class":332},[125,10413,565],{"class":328},[125,10415,10416],{"class":332},"handleClick",[125,10418,966],{"class":328},[125,10420,10421,10423,10426],{"class":127,"line":29},[125,10422,691],{"class":328},[125,10424,10425],{"class":708},"formattedName",[125,10427,603],{"class":328},[125,10429,10430,10432,10434],{"class":127,"line":272},[125,10431,587],{"class":328},[125,10433,458],{"class":332},[125,10435,461],{"class":328},[125,10437,10438],{"class":127,"line":281},[125,10439,597],{"class":437},[125,10441,10442],{"class":127,"line":290},[125,10443,603],{"class":328},[125,10445,10446],{"class":127,"line":555},[125,10447,387],{"emptyLinePlaceholder":386},[125,10449,10450,10452,10454,10457,10459,10462],{"class":127,"line":574},[125,10451,392],{"class":324},[125,10453,395],{"class":324},[125,10455,10456],{"class":332}," React",[125,10458,697],{"class":328},[125,10460,10461],{"class":405},"memo",[125,10463,10464],{"class":332},"(UserProfile)\n",[301,10466,10468],{"id":10467},"after-react-compiler","After React Compiler",[115,10470,10472],{"className":8012,"code":10471,"language":8014,"meta":120,"style":120},"// Automatic optimization\nconst UserProfile = ({ user, onUpdate }) => {\n const formattedName = `${user.firstName} ${user.lastName}`\n\n const handleClick = () => {\n onUpdate(user.id)\n }\n\n return (\n
\n {formattedName}\n
\n )\n}\n\nexport default UserProfile\n",[122,10473,10474,10479,10501,10529,10533,10547,10561,10565,10569,10575,10589,10597,10605,10609,10613,10617],{"__ignoreMap":120},[125,10475,10476],{"class":127,"line":128},[125,10477,10478],{"class":145},"// Automatic optimization\n",[125,10480,10481,10483,10485,10487,10489,10491,10493,10495,10497,10499],{"class":127,"line":135},[125,10482,5506],{"class":398},[125,10484,10250],{"class":332},[125,10486,494],{"class":328},[125,10488,5732],{"class":328},[125,10490,2294],{"class":708},[125,10492,867],{"class":328},[125,10494,10261],{"class":708},[125,10496,852],{"class":328},[125,10498,715],{"class":398},[125,10500,412],{"class":328},[125,10502,10503,10505,10507,10509,10511,10513,10515,10517,10519,10521,10523,10525,10527],{"class":127,"line":16},[125,10504,422],{"class":398},[125,10506,10274],{"class":332},[125,10508,428],{"class":328},[125,10510,10293],{"class":328},[125,10512,709],{"class":332},[125,10514,697],{"class":328},[125,10516,10300],{"class":332},[125,10518,2619],{"class":328},[125,10520,10305],{"class":328},[125,10522,709],{"class":332},[125,10524,697],{"class":328},[125,10526,10312],{"class":332},[125,10528,10315],{"class":328},[125,10530,10531],{"class":127,"line":159},[125,10532,387],{"emptyLinePlaceholder":386},[125,10534,10535,10537,10539,10541,10543,10545],{"class":127,"line":170},[125,10536,422],{"class":398},[125,10538,10348],{"class":332},[125,10540,428],{"class":328},[125,10542,5815],{"class":328},[125,10544,715],{"class":398},[125,10546,412],{"class":328},[125,10548,10549,10551,10553,10555,10557,10559],{"class":127,"line":181},[125,10550,10365],{"class":405},[125,10552,703],{"class":437},[125,10554,709],{"class":332},[125,10556,697],{"class":328},[125,10558,737],{"class":332},[125,10560,885],{"class":437},[125,10562,10563],{"class":127,"line":192},[125,10564,938],{"class":328},[125,10566,10567],{"class":127,"line":203},[125,10568,387],{"emptyLinePlaceholder":386},[125,10570,10571,10573],{"class":127,"line":211},[125,10572,447],{"class":324},[125,10574,450],{"class":437},[125,10576,10577,10579,10581,10583,10585,10587],{"class":127,"line":225},[125,10578,455],{"class":328},[125,10580,458],{"class":332},[125,10582,3987],{"class":332},[125,10584,565],{"class":328},[125,10586,10416],{"class":332},[125,10588,966],{"class":328},[125,10590,10591,10593,10595],{"class":127,"line":237},[125,10592,691],{"class":328},[125,10594,10425],{"class":708},[125,10596,603],{"class":328},[125,10598,10599,10601,10603],{"class":127,"line":249},[125,10600,587],{"class":328},[125,10602,458],{"class":332},[125,10604,461],{"class":328},[125,10606,10607],{"class":127,"line":29},[125,10608,597],{"class":437},[125,10610,10611],{"class":127,"line":272},[125,10612,603],{"class":328},[125,10614,10615],{"class":127,"line":281},[125,10616,387],{"emptyLinePlaceholder":386},[125,10618,10619,10621,10623],{"class":127,"line":290},[125,10620,392],{"class":324},[125,10622,395],{"class":324},[125,10624,10625],{"class":332}," UserProfile\n",[99,10627,10629],{"id":10628},"how-react-compiler-works","How React Compiler Works",[301,10631,10633],{"id":10632},"_1-automatic-dependency-tracking","1. Automatic Dependency Tracking",[115,10635,10637],{"className":8012,"code":10636,"language":8014,"meta":120,"style":120},"// Compiler automatically tracks dependencies\nfunction Component({ data, filter }) {\n // No need for useMemo\n const filtered = data.filter(item => item.type === filter)\n\n // Compiler knows this depends on filtered.length\n const hasItems = filtered.length > 0\n\n return
{hasItems ? 'Has items' : 'Empty'}
\n}\n",[122,10638,10639,10644,10664,10669,10706,10710,10715,10736,10740,10778],{"__ignoreMap":120},[125,10640,10641],{"class":127,"line":128},[125,10642,10643],{"class":145},"// Compiler automatically tracks dependencies\n",[125,10645,10646,10648,10651,10653,10655,10657,10660,10662],{"class":127,"line":135},[125,10647,8026],{"class":398},[125,10649,10650],{"class":405}," Component",[125,10652,846],{"class":328},[125,10654,1383],{"class":708},[125,10656,867],{"class":328},[125,10658,10659],{"class":708}," filter",[125,10661,852],{"class":328},[125,10663,412],{"class":328},[125,10665,10666],{"class":127,"line":16},[125,10667,10668],{"class":145}," // No need for useMemo\n",[125,10670,10671,10673,10676,10678,10680,10682,10685,10687,10690,10692,10695,10697,10699,10702,10704],{"class":127,"line":159},[125,10672,422],{"class":398},[125,10674,10675],{"class":332}," filtered",[125,10677,428],{"class":328},[125,10679,1383],{"class":332},[125,10681,697],{"class":328},[125,10683,10684],{"class":405},"filter",[125,10686,703],{"class":437},[125,10688,10689],{"class":708},"item",[125,10691,715],{"class":398},[125,10693,10694],{"class":332}," item",[125,10696,697],{"class":328},[125,10698,5490],{"class":332},[125,10700,10701],{"class":328}," ===",[125,10703,10659],{"class":332},[125,10705,885],{"class":437},[125,10707,10708],{"class":127,"line":170},[125,10709,387],{"emptyLinePlaceholder":386},[125,10711,10712],{"class":127,"line":181},[125,10713,10714],{"class":145}," // Compiler knows this depends on filtered.length\n",[125,10716,10717,10719,10722,10724,10726,10728,10730,10733],{"class":127,"line":192},[125,10718,422],{"class":398},[125,10720,10721],{"class":332}," hasItems",[125,10723,428],{"class":328},[125,10725,10675],{"class":332},[125,10727,697],{"class":328},[125,10729,4549],{"class":332},[125,10731,10732],{"class":328}," >",[125,10734,10735],{"class":1910}," 0\n",[125,10737,10738],{"class":127,"line":203},[125,10739,387],{"emptyLinePlaceholder":386},[125,10741,10742,10744,10746,10748,10750,10752,10755,10757,10760,10762,10765,10767,10770,10772,10774,10776],{"class":127,"line":211},[125,10743,447],{"class":324},[125,10745,1402],{"class":437},[125,10747,458],{"class":131},[125,10749,472],{"class":437},[125,10751,2315],{"class":328},[125,10753,10754],{"class":437},"hasItems ? ",[125,10756,1677],{"class":328},[125,10758,10759],{"class":437},"Has items",[125,10761,1677],{"class":328},[125,10763,10764],{"class":328}," :",[125,10766,1671],{"class":328},[125,10768,10769],{"class":141},"Empty",[125,10771,1677],{"class":328},[125,10773,1576],{"class":328},[125,10775,458],{"class":332},[125,10777,461],{"class":328},[125,10779,10780],{"class":127,"line":225},[125,10781,603],{"class":328},[301,10783,10785],{"id":10784},"_2-intelligent-memoization","2. Intelligent Memoization",[115,10787,10789],{"className":8012,"code":10788,"language":8014,"meta":120,"style":120},"// Compiler decides what to memoize\nfunction ProductList({ products, onSelect }) {\n // Expensive computation - automatically memoized\n const sorted = products.sort((a, b) => a.price - b.price)\n\n // Event handler - automatically wrapped\n const handleSelect = (product) => {\n onSelect(product)\n }\n\n return (\n
\n {sorted.map(product => (\n \n ))}\n
\n )\n}\n",[122,10790,10791,10796,10815,10820,10871,10875,10880,10899,10910,10914,10918,10924,10932,10951,10957,10969,10979,10991,10995,11001,11009,11013],{"__ignoreMap":120},[125,10792,10793],{"class":127,"line":128},[125,10794,10795],{"class":145},"// Compiler decides what to memoize\n",[125,10797,10798,10800,10802,10804,10806,10808,10811,10813],{"class":127,"line":135},[125,10799,8026],{"class":398},[125,10801,8674],{"class":405},[125,10803,846],{"class":328},[125,10805,8679],{"class":708},[125,10807,867],{"class":328},[125,10809,10810],{"class":708}," onSelect",[125,10812,852],{"class":328},[125,10814,412],{"class":328},[125,10816,10817],{"class":127,"line":16},[125,10818,10819],{"class":145}," // Expensive computation - automatically memoized\n",[125,10821,10822,10824,10827,10829,10831,10833,10836,10838,10840,10843,10845,10848,10850,10852,10855,10857,10860,10863,10865,10867,10869],{"class":127,"line":159},[125,10823,422],{"class":398},[125,10825,10826],{"class":332}," sorted",[125,10828,428],{"class":328},[125,10830,8679],{"class":332},[125,10832,697],{"class":328},[125,10834,10835],{"class":405},"sort",[125,10837,703],{"class":437},[125,10839,703],{"class":328},[125,10841,10842],{"class":708},"a",[125,10844,867],{"class":328},[125,10846,10847],{"class":708}," b",[125,10849,712],{"class":328},[125,10851,715],{"class":398},[125,10853,10854],{"class":332}," a",[125,10856,697],{"class":328},[125,10858,10859],{"class":332},"price",[125,10861,10862],{"class":328}," -",[125,10864,10847],{"class":332},[125,10866,697],{"class":328},[125,10868,10859],{"class":332},[125,10870,885],{"class":437},[125,10872,10873],{"class":127,"line":170},[125,10874,387],{"emptyLinePlaceholder":386},[125,10876,10877],{"class":127,"line":181},[125,10878,10879],{"class":145}," // Event handler - automatically wrapped\n",[125,10881,10882,10884,10887,10889,10891,10893,10895,10897],{"class":127,"line":192},[125,10883,422],{"class":398},[125,10885,10886],{"class":332}," handleSelect",[125,10888,428],{"class":328},[125,10890,901],{"class":328},[125,10892,8702],{"class":708},[125,10894,712],{"class":328},[125,10896,715],{"class":398},[125,10898,412],{"class":328},[125,10900,10901,10904,10906,10908],{"class":127,"line":203},[125,10902,10903],{"class":405}," onSelect",[125,10905,703],{"class":437},[125,10907,8702],{"class":332},[125,10909,885],{"class":437},[125,10911,10912],{"class":127,"line":211},[125,10913,938],{"class":328},[125,10915,10916],{"class":127,"line":225},[125,10917,387],{"emptyLinePlaceholder":386},[125,10919,10920,10922],{"class":127,"line":237},[125,10921,447],{"class":324},[125,10923,450],{"class":437},[125,10925,10926,10928,10930],{"class":127,"line":249},[125,10927,455],{"class":437},[125,10929,458],{"class":131},[125,10931,461],{"class":437},[125,10933,10934,10936,10939,10941,10943,10945,10947,10949],{"class":127,"line":29},[125,10935,691],{"class":328},[125,10937,10938],{"class":708},"sorted",[125,10940,697],{"class":437},[125,10942,700],{"class":708},[125,10944,703],{"class":437},[125,10946,8702],{"class":708},[125,10948,715],{"class":328},[125,10950,450],{"class":437},[125,10952,10953,10955],{"class":127,"line":272},[125,10954,509],{"class":328},[125,10956,8801],{"class":708},[125,10958,10959,10961,10963,10965,10967],{"class":127,"line":281},[125,10960,8806],{"class":332},[125,10962,565],{"class":328},[125,10964,8811],{"class":437},[125,10966,737],{"class":332},[125,10968,603],{"class":328},[125,10970,10971,10973,10975,10977],{"class":127,"line":290},[125,10972,8820],{"class":332},[125,10974,565],{"class":328},[125,10976,8702],{"class":332},[125,10978,603],{"class":328},[125,10980,10981,10984,10986,10989],{"class":127,"line":555},[125,10982,10983],{"class":332}," onSelect",[125,10985,565],{"class":328},[125,10987,10988],{"class":332},"handleSelect",[125,10990,603],{"class":328},[125,10992,10993],{"class":127,"line":574},[125,10994,8843],{"class":328},[125,10996,10997,10999],{"class":127,"line":584},[125,10998,754],{"class":437},[125,11000,603],{"class":328},[125,11002,11003,11005,11007],{"class":127,"line":594},[125,11004,587],{"class":328},[125,11006,458],{"class":332},[125,11008,461],{"class":328},[125,11010,11011],{"class":127,"line":600},[125,11012,597],{"class":437},[125,11014,11015],{"class":127,"line":606},[125,11016,603],{"class":328},[301,11018,11020],{"id":11019},"_3-component-boundaries","3. Component Boundaries",[115,11022,11024],{"className":8012,"code":11023,"language":8014,"meta":120,"style":120},"// Compiler respects component boundaries\nfunction Parent({ items }) {\n // Each component optimized independently\n return (\n \n )\n}\n\nfunction Child({ items }) {\n // This is memoized separately\n return
{items.length}
\n}\n",[122,11025,11026,11031,11047,11052,11058,11076,11080,11084,11088,11103,11108,11131],{"__ignoreMap":120},[125,11027,11028],{"class":127,"line":128},[125,11029,11030],{"class":145},"// Compiler respects component boundaries\n",[125,11032,11033,11035,11038,11040,11043,11045],{"class":127,"line":135},[125,11034,8026],{"class":398},[125,11036,11037],{"class":405}," Parent",[125,11039,846],{"class":328},[125,11041,11042],{"class":708}," items",[125,11044,852],{"class":328},[125,11046,412],{"class":328},[125,11048,11049],{"class":127,"line":16},[125,11050,11051],{"class":145}," // Each component optimized independently\n",[125,11053,11054,11056],{"class":127,"line":159},[125,11055,447],{"class":324},[125,11057,450],{"class":437},[125,11059,11060,11062,11065,11067,11069,11072,11074],{"class":127,"line":170},[125,11061,455],{"class":328},[125,11063,11064],{"class":332},"Child",[125,11066,11042],{"class":332},[125,11068,565],{"class":328},[125,11070,11071],{"class":332},"items",[125,11073,2619],{"class":328},[125,11075,543],{"class":328},[125,11077,11078],{"class":127,"line":181},[125,11079,597],{"class":437},[125,11081,11082],{"class":127,"line":192},[125,11083,603],{"class":328},[125,11085,11086],{"class":127,"line":203},[125,11087,387],{"emptyLinePlaceholder":386},[125,11089,11090,11092,11095,11097,11099,11101],{"class":127,"line":211},[125,11091,8026],{"class":398},[125,11093,11094],{"class":405}," Child",[125,11096,846],{"class":328},[125,11098,11042],{"class":708},[125,11100,852],{"class":328},[125,11102,412],{"class":328},[125,11104,11105],{"class":127,"line":225},[125,11106,11107],{"class":145}," // This is memoized separately\n",[125,11109,11110,11112,11114,11116,11118,11120,11123,11125,11127,11129],{"class":127,"line":237},[125,11111,447],{"class":324},[125,11113,1402],{"class":437},[125,11115,458],{"class":131},[125,11117,472],{"class":437},[125,11119,2315],{"class":328},[125,11121,11122],{"class":437},"items.",[125,11124,4549],{"class":332},[125,11126,1576],{"class":328},[125,11128,458],{"class":332},[125,11130,461],{"class":328},[125,11132,11133],{"class":127,"line":249},[125,11134,603],{"class":328},[99,11136,11138],{"id":11137},"performance-benefits","Performance Benefits",[301,11140,11142],{"id":11141},"_1-reduced-re-renders","1. Reduced Re-renders",[115,11144,11146],{"className":8012,"code":11145,"language":8014,"meta":120,"style":120},"// Without compiler: Manual optimization needed\n// With compiler: Automatic\n\nfunction Dashboard({ data }) {\n // Automatically memoized\n const stats = calculateStats(data)\n const chart = prepareChartData(data)\n const table = prepareTableData(data)\n\n return (\n
\n \n \n \n \n )\n}\n",[122,11147,11148,11153,11158,11162,11176,11181,11198,11216,11234,11238,11244,11252,11269,11287,11304,11312,11316],{"__ignoreMap":120},[125,11149,11150],{"class":127,"line":128},[125,11151,11152],{"class":145},"// Without compiler: Manual optimization needed\n",[125,11154,11155],{"class":127,"line":135},[125,11156,11157],{"class":145},"// With compiler: Automatic\n",[125,11159,11160],{"class":127,"line":16},[125,11161,387],{"emptyLinePlaceholder":386},[125,11163,11164,11166,11168,11170,11172,11174],{"class":127,"line":159},[125,11165,8026],{"class":398},[125,11167,3150],{"class":405},[125,11169,846],{"class":328},[125,11171,1383],{"class":708},[125,11173,852],{"class":328},[125,11175,412],{"class":328},[125,11177,11178],{"class":127,"line":170},[125,11179,11180],{"class":145}," // Automatically memoized\n",[125,11182,11183,11185,11187,11189,11192,11194,11196],{"class":127,"line":181},[125,11184,422],{"class":398},[125,11186,425],{"class":332},[125,11188,428],{"class":328},[125,11190,11191],{"class":405}," calculateStats",[125,11193,703],{"class":437},[125,11195,1412],{"class":332},[125,11197,885],{"class":437},[125,11199,11200,11202,11205,11207,11210,11212,11214],{"class":127,"line":192},[125,11201,422],{"class":398},[125,11203,11204],{"class":332}," chart",[125,11206,428],{"class":328},[125,11208,11209],{"class":405}," prepareChartData",[125,11211,703],{"class":437},[125,11213,1412],{"class":332},[125,11215,885],{"class":437},[125,11217,11218,11220,11223,11225,11228,11230,11232],{"class":127,"line":203},[125,11219,422],{"class":398},[125,11221,11222],{"class":332}," table",[125,11224,428],{"class":328},[125,11226,11227],{"class":405}," prepareTableData",[125,11229,703],{"class":437},[125,11231,1412],{"class":332},[125,11233,885],{"class":437},[125,11235,11236],{"class":127,"line":211},[125,11237,387],{"emptyLinePlaceholder":386},[125,11239,11240,11242],{"class":127,"line":225},[125,11241,447],{"class":324},[125,11243,450],{"class":437},[125,11245,11246,11248,11250],{"class":127,"line":237},[125,11247,455],{"class":437},[125,11249,458],{"class":131},[125,11251,461],{"class":437},[125,11253,11254,11256,11259,11261,11263,11265,11267],{"class":127,"line":249},[125,11255,466],{"class":328},[125,11257,11258],{"class":332},"StatsPanel",[125,11260,425],{"class":332},[125,11262,565],{"class":328},[125,11264,568],{"class":332},[125,11266,2619],{"class":328},[125,11268,543],{"class":328},[125,11270,11271,11273,11276,11278,11280,11283,11285],{"class":127,"line":29},[125,11272,466],{"class":328},[125,11274,11275],{"class":332},"Chart",[125,11277,1383],{"class":332},[125,11279,565],{"class":328},[125,11281,11282],{"class":332},"chart",[125,11284,2619],{"class":328},[125,11286,543],{"class":328},[125,11288,11289,11291,11294,11296,11298,11300,11302],{"class":127,"line":272},[125,11290,466],{"class":328},[125,11292,11293],{"class":332},"Table",[125,11295,1383],{"class":332},[125,11297,565],{"class":328},[125,11299,9684],{"class":332},[125,11301,2619],{"class":328},[125,11303,543],{"class":328},[125,11305,11306,11308,11310],{"class":127,"line":281},[125,11307,587],{"class":328},[125,11309,458],{"class":332},[125,11311,461],{"class":328},[125,11313,11314],{"class":127,"line":290},[125,11315,597],{"class":437},[125,11317,11318],{"class":127,"line":555},[125,11319,603],{"class":328},[301,11321,11323],{"id":11322},"_2-better-memory-management","2. Better Memory Management",[115,11325,11327],{"className":8012,"code":11326,"language":8014,"meta":120,"style":120},"// Compiler optimizes memory usage\nfunction DataTable({ rows }) {\n // No manual cleanup needed\n const processed = rows.map(row => transform(row))\n const grouped = groupBy(processed, 'category')\n\n return
\n}\n",[122,11328,11329,11334,11350,11355,11386,11414,11418,11439],{"__ignoreMap":120},[125,11330,11331],{"class":127,"line":128},[125,11332,11333],{"class":145},"// Compiler optimizes memory usage\n",[125,11335,11336,11338,11341,11343,11346,11348],{"class":127,"line":135},[125,11337,8026],{"class":398},[125,11339,11340],{"class":405}," DataTable",[125,11342,846],{"class":328},[125,11344,11345],{"class":708}," rows",[125,11347,852],{"class":328},[125,11349,412],{"class":328},[125,11351,11352],{"class":127,"line":16},[125,11353,11354],{"class":145}," // No manual cleanup needed\n",[125,11356,11357,11359,11362,11364,11366,11368,11370,11372,11375,11377,11380,11382,11384],{"class":127,"line":159},[125,11358,422],{"class":398},[125,11360,11361],{"class":332}," processed",[125,11363,428],{"class":328},[125,11365,11345],{"class":332},[125,11367,697],{"class":328},[125,11369,700],{"class":405},[125,11371,703],{"class":437},[125,11373,11374],{"class":708},"row",[125,11376,715],{"class":398},[125,11378,11379],{"class":405}," transform",[125,11381,703],{"class":437},[125,11383,11374],{"class":332},[125,11385,7139],{"class":437},[125,11387,11388,11390,11393,11395,11398,11400,11403,11405,11407,11410,11412],{"class":127,"line":170},[125,11389,422],{"class":398},[125,11391,11392],{"class":332}," grouped",[125,11394,428],{"class":328},[125,11396,11397],{"class":405}," groupBy",[125,11399,703],{"class":437},[125,11401,11402],{"class":332},"processed",[125,11404,867],{"class":328},[125,11406,1671],{"class":328},[125,11408,11409],{"class":141},"category",[125,11411,1677],{"class":328},[125,11413,885],{"class":437},[125,11415,11416],{"class":127,"line":181},[125,11417,387],{"emptyLinePlaceholder":386},[125,11419,11420,11422,11424,11426,11428,11430,11433,11435,11437],{"class":127,"line":192},[125,11421,447],{"class":324},[125,11423,1402],{"class":328},[125,11425,11293],{"class":131},[125,11427,1383],{"class":131},[125,11429,565],{"class":328},[125,11431,11432],{"class":437},"grouped",[125,11434,2619],{"class":328},[125,11436,9933],{"class":437},[125,11438,461],{"class":328},[125,11440,11441],{"class":127,"line":203},[125,11442,603],{"class":437},[301,11444,11446],{"id":11445},"_3-improved-dev-experience","3. Improved Dev Experience",[115,11448,11450],{"className":8012,"code":11449,"language":8014,"meta":120,"style":120},"// Cleaner, more readable code\nfunction UserForm({ user, onSave }) {\n const [form, setForm] = useState(user)\n\n const handleChange = (field, value) => {\n setForm(prev => ({ ...prev, [field]: value }))\n }\n\n const handleSubmit = () => {\n onSave(form)\n }\n\n return (\n \n handleChange('name', v)} />\n handleChange('email', v)} />\n \n \n )\n}\n",[122,11451,11452,11457,11477,11502,11506,11531,11567,11571,11575,11589,11600,11604,11608,11614,11628,11677,11722,11750,11758,11762],{"__ignoreMap":120},[125,11453,11454],{"class":127,"line":128},[125,11455,11456],{"class":145},"// Cleaner, more readable code\n",[125,11458,11459,11461,11464,11466,11468,11470,11473,11475],{"class":127,"line":135},[125,11460,8026],{"class":398},[125,11462,11463],{"class":405}," UserForm",[125,11465,846],{"class":328},[125,11467,2294],{"class":708},[125,11469,867],{"class":328},[125,11471,11472],{"class":708}," onSave",[125,11474,852],{"class":328},[125,11476,412],{"class":328},[125,11478,11479,11481,11483,11485,11487,11490,11492,11494,11496,11498,11500],{"class":127,"line":16},[125,11480,422],{"class":398},[125,11482,861],{"class":328},[125,11484,955],{"class":332},[125,11486,867],{"class":328},[125,11488,11489],{"class":332}," setForm",[125,11491,873],{"class":328},[125,11493,428],{"class":328},[125,11495,818],{"class":405},[125,11497,703],{"class":437},[125,11499,709],{"class":332},[125,11501,885],{"class":437},[125,11503,11504],{"class":127,"line":159},[125,11505,387],{"emptyLinePlaceholder":386},[125,11507,11508,11510,11513,11515,11517,11520,11522,11525,11527,11529],{"class":127,"line":170},[125,11509,422],{"class":398},[125,11511,11512],{"class":332}," handleChange",[125,11514,428],{"class":328},[125,11516,901],{"class":328},[125,11518,11519],{"class":708},"field",[125,11521,867],{"class":328},[125,11523,11524],{"class":708}," value",[125,11526,712],{"class":328},[125,11528,715],{"class":398},[125,11530,412],{"class":328},[125,11532,11533,11536,11538,11541,11543,11545,11547,11549,11551,11553,11555,11557,11559,11561,11563,11565],{"class":127,"line":181},[125,11534,11535],{"class":405}," setForm",[125,11537,703],{"class":437},[125,11539,11540],{"class":708},"prev",[125,11542,715],{"class":398},[125,11544,901],{"class":437},[125,11546,2315],{"class":328},[125,11548,6500],{"class":328},[125,11550,11540],{"class":332},[125,11552,867],{"class":328},[125,11554,861],{"class":437},[125,11556,11519],{"class":332},[125,11558,873],{"class":437},[125,11560,1898],{"class":328},[125,11562,11524],{"class":332},[125,11564,336],{"class":328},[125,11566,7139],{"class":437},[125,11568,11569],{"class":127,"line":192},[125,11570,938],{"class":328},[125,11572,11573],{"class":127,"line":203},[125,11574,387],{"emptyLinePlaceholder":386},[125,11576,11577,11579,11581,11583,11585,11587],{"class":127,"line":211},[125,11578,422],{"class":398},[125,11580,896],{"class":332},[125,11582,428],{"class":328},[125,11584,5815],{"class":328},[125,11586,715],{"class":398},[125,11588,412],{"class":328},[125,11590,11591,11594,11596,11598],{"class":127,"line":225},[125,11592,11593],{"class":405}," onSave",[125,11595,703],{"class":437},[125,11597,955],{"class":332},[125,11599,885],{"class":437},[125,11601,11602],{"class":127,"line":237},[125,11603,938],{"class":328},[125,11605,11606],{"class":127,"line":249},[125,11607,387],{"emptyLinePlaceholder":386},[125,11609,11610,11612],{"class":127,"line":29},[125,11611,447],{"class":324},[125,11613,450],{"class":437},[125,11615,11616,11618,11620,11622,11624,11626],{"class":127,"line":272},[125,11617,455],{"class":328},[125,11619,955],{"class":332},[125,11621,958],{"class":332},[125,11623,565],{"class":328},[125,11625,963],{"class":332},[125,11627,966],{"class":328},[125,11629,11630,11632,11635,11637,11639,11642,11644,11646,11649,11651,11654,11656,11658,11660,11662,11664,11666,11668,11671,11673,11675],{"class":127,"line":281},[125,11631,466],{"class":328},[125,11633,11634],{"class":332},"Input",[125,11636,11524],{"class":332},[125,11638,565],{"class":328},[125,11640,11641],{"class":437},"form.",[125,11643,8179],{"class":332},[125,11645,2619],{"class":328},[125,11647,11648],{"class":332}," onChange",[125,11650,565],{"class":328},[125,11652,11653],{"class":708},"v",[125,11655,715],{"class":398},[125,11657,11512],{"class":405},[125,11659,703],{"class":437},[125,11661,1677],{"class":328},[125,11663,8179],{"class":141},[125,11665,1677],{"class":328},[125,11667,867],{"class":328},[125,11669,11670],{"class":332}," v",[125,11672,712],{"class":437},[125,11674,2619],{"class":328},[125,11676,543],{"class":328},[125,11678,11679,11681,11683,11685,11687,11689,11692,11694,11696,11698,11700,11702,11704,11706,11708,11710,11712,11714,11716,11718,11720],{"class":127,"line":290},[125,11680,466],{"class":328},[125,11682,11634],{"class":332},[125,11684,11524],{"class":332},[125,11686,565],{"class":328},[125,11688,11641],{"class":437},[125,11690,11691],{"class":332},"email",[125,11693,2619],{"class":328},[125,11695,11648],{"class":332},[125,11697,565],{"class":328},[125,11699,11653],{"class":708},[125,11701,715],{"class":398},[125,11703,11512],{"class":405},[125,11705,703],{"class":437},[125,11707,1677],{"class":328},[125,11709,11691],{"class":141},[125,11711,1677],{"class":328},[125,11713,867],{"class":328},[125,11715,11670],{"class":332},[125,11717,712],{"class":437},[125,11719,2619],{"class":328},[125,11721,543],{"class":328},[125,11723,11724,11726,11729,11731,11733,11735,11737,11739,11741,11744,11746,11748],{"class":127,"line":555},[125,11725,466],{"class":328},[125,11727,11728],{"class":332},"Button",[125,11730,5349],{"class":332},[125,11732,494],{"class":328},[125,11734,497],{"class":328},[125,11736,1080],{"class":141},[125,11738,497],{"class":328},[125,11740,472],{"class":328},[125,11742,11743],{"class":332},"Save",[125,11745,478],{"class":328},[125,11747,11728],{"class":332},[125,11749,461],{"class":328},[125,11751,11752,11754,11756],{"class":127,"line":574},[125,11753,587],{"class":328},[125,11755,955],{"class":332},[125,11757,461],{"class":328},[125,11759,11760],{"class":127,"line":584},[125,11761,597],{"class":437},[125,11763,11764],{"class":127,"line":594},[125,11765,603],{"class":328},[99,11767,11769],{"id":11768},"migration-guide","Migration Guide",[301,11771,11773],{"id":11772},"step-1-enable-react-compiler","Step 1: Enable React Compiler",[115,11775,11777],{"className":117,"code":11776,"language":119,"meta":120,"style":120},"# Install compiler\nnpm install babel-plugin-react-compiler\n\n# Update Babel config\n// babel.config.js\nmodule.exports = {\n plugins: ['react-compiler']\n}\n",[122,11778,11779,11784,11795,11799,11804,11812,11820,11837],{"__ignoreMap":120},[125,11780,11781],{"class":127,"line":128},[125,11782,11783],{"class":145},"# Install compiler\n",[125,11785,11786,11789,11792],{"class":127,"line":135},[125,11787,11788],{"class":131},"npm",[125,11790,11791],{"class":141}," install",[125,11793,11794],{"class":141}," babel-plugin-react-compiler\n",[125,11796,11797],{"class":127,"line":16},[125,11798,387],{"emptyLinePlaceholder":386},[125,11800,11801],{"class":127,"line":159},[125,11802,11803],{"class":145},"# Update Babel config\n",[125,11805,11806,11809],{"class":127,"line":170},[125,11807,11808],{"class":131},"//",[125,11810,11811],{"class":141}," babel.config.js\n",[125,11813,11814,11816,11818],{"class":127,"line":181},[125,11815,5560],{"class":131},[125,11817,428],{"class":141},[125,11819,412],{"class":141},[125,11821,11822,11825,11827,11829,11832,11834],{"class":127,"line":192},[125,11823,11824],{"class":131}," plugins:",[125,11826,861],{"class":332},[125,11828,1677],{"class":328},[125,11830,11831],{"class":141},"react-compiler",[125,11833,1677],{"class":328},[125,11835,11836],{"class":332},"]\n",[125,11838,11839],{"class":127,"line":203},[125,11840,603],{"class":332},[301,11842,11844],{"id":11843},"step-2-remove-manual-memoization","Step 2: Remove Manual Memoization",[115,11846,11848],{"className":8012,"code":11847,"language":8014,"meta":120,"style":120},"// Before\nconst value = useMemo(() => compute(a, b), [a, b])\n\n// After\nconst value = compute(a, b)\n",[122,11849,11850,11855,11893,11897,11902],{"__ignoreMap":120},[125,11851,11852],{"class":127,"line":128},[125,11853,11854],{"class":145},"// Before\n",[125,11856,11857,11859,11862,11864,11866,11868,11870,11872,11875,11878,11880,11883,11885,11888,11890],{"class":127,"line":135},[125,11858,5506],{"class":398},[125,11860,11861],{"class":332}," value ",[125,11863,494],{"class":328},[125,11865,8125],{"class":405},[125,11867,703],{"class":332},[125,11869,409],{"class":328},[125,11871,715],{"class":398},[125,11873,11874],{"class":405}," compute",[125,11876,11877],{"class":332},"(a",[125,11879,867],{"class":328},[125,11881,11882],{"class":332}," b)",[125,11884,867],{"class":328},[125,11886,11887],{"class":332}," [a",[125,11889,867],{"class":328},[125,11891,11892],{"class":332}," b])\n",[125,11894,11895],{"class":127,"line":16},[125,11896,387],{"emptyLinePlaceholder":386},[125,11898,11899],{"class":127,"line":159},[125,11900,11901],{"class":145},"// After\n",[125,11903,11904,11906,11908,11910,11912,11914,11916],{"class":127,"line":170},[125,11905,5506],{"class":398},[125,11907,11861],{"class":332},[125,11909,494],{"class":328},[125,11911,11874],{"class":405},[125,11913,11877],{"class":332},[125,11915,867],{"class":328},[125,11917,11918],{"class":332}," b)\n",[301,11920,11922],{"id":11921},"step-3-test-performance","Step 3: Test Performance",[115,11924,11926],{"className":8012,"code":11925,"language":8014,"meta":120,"style":120},"// Use React DevTools Profiler\n// Compare before/after metrics\n",[122,11927,11928,11933],{"__ignoreMap":120},[125,11929,11930],{"class":127,"line":128},[125,11931,11932],{"class":145},"// Use React DevTools Profiler\n",[125,11934,11935],{"class":127,"line":135},[125,11936,11937],{"class":145},"// Compare before/after metrics\n",[99,11939,11941],{"id":11940},"best-practices","Best Practices",[301,11943,11945],{"id":11944},"_1-write-idiomatic-code","1. Write Idiomatic Code",[115,11947,11949],{"className":8012,"code":11948,"language":8014,"meta":120,"style":120},"// ✅ Good: Clear, readable code\nfunction Component({ items }) {\n const filtered = items.filter(item => item.active)\n const sorted = filtered.sort((a, b) => a.name.localeCompare(b.name))\n\n return \n}\n\n// ❌ Avoid: Over-optimization\nfunction Component({ items }) {\n const memoized = useMemo(() => {\n return items.filter(item => item.active)\n }, [items])\n\n return \n}\n",[122,11950,11951,11956,11970,11999,12049,12053,12074,12078,12082,12087,12102,12122,12146,12156,12160,12175],{"__ignoreMap":120},[125,11952,11953],{"class":127,"line":128},[125,11954,11955],{"class":145},"// ✅ Good: Clear, readable code\n",[125,11957,11958,11960,11962,11964,11966,11968],{"class":127,"line":135},[125,11959,8026],{"class":398},[125,11961,10650],{"class":405},[125,11963,846],{"class":328},[125,11965,11042],{"class":708},[125,11967,852],{"class":328},[125,11969,412],{"class":328},[125,11971,11972,11974,11976,11978,11980,11982,11984,11986,11988,11990,11992,11994,11997],{"class":127,"line":16},[125,11973,422],{"class":398},[125,11975,10675],{"class":332},[125,11977,428],{"class":328},[125,11979,11042],{"class":332},[125,11981,697],{"class":328},[125,11983,10684],{"class":405},[125,11985,703],{"class":437},[125,11987,10689],{"class":708},[125,11989,715],{"class":398},[125,11991,10694],{"class":332},[125,11993,697],{"class":328},[125,11995,11996],{"class":332},"active",[125,11998,885],{"class":437},[125,12000,12001,12003,12005,12007,12009,12011,12013,12015,12017,12019,12021,12023,12025,12027,12029,12031,12033,12035,12038,12040,12043,12045,12047],{"class":127,"line":159},[125,12002,422],{"class":398},[125,12004,10826],{"class":332},[125,12006,428],{"class":328},[125,12008,10675],{"class":332},[125,12010,697],{"class":328},[125,12012,10835],{"class":405},[125,12014,703],{"class":437},[125,12016,703],{"class":328},[125,12018,10842],{"class":708},[125,12020,867],{"class":328},[125,12022,10847],{"class":708},[125,12024,712],{"class":328},[125,12026,715],{"class":398},[125,12028,10854],{"class":332},[125,12030,697],{"class":328},[125,12032,8179],{"class":332},[125,12034,697],{"class":328},[125,12036,12037],{"class":405},"localeCompare",[125,12039,703],{"class":437},[125,12041,12042],{"class":332},"b",[125,12044,697],{"class":328},[125,12046,8179],{"class":332},[125,12048,7139],{"class":437},[125,12050,12051],{"class":127,"line":170},[125,12052,387],{"emptyLinePlaceholder":386},[125,12054,12055,12057,12059,12062,12064,12066,12068,12070,12072],{"class":127,"line":181},[125,12056,447],{"class":324},[125,12058,1402],{"class":328},[125,12060,12061],{"class":131},"List",[125,12063,11042],{"class":131},[125,12065,565],{"class":328},[125,12067,10938],{"class":437},[125,12069,2619],{"class":328},[125,12071,9933],{"class":437},[125,12073,461],{"class":328},[125,12075,12076],{"class":127,"line":192},[125,12077,603],{"class":437},[125,12079,12080],{"class":127,"line":203},[125,12081,387],{"emptyLinePlaceholder":386},[125,12083,12084],{"class":127,"line":211},[125,12085,12086],{"class":437},"// ❌ Avoid: Over-optimization\n",[125,12088,12089,12092,12094,12096,12098,12100],{"class":127,"line":225},[125,12090,12091],{"class":437},"function Component(",[125,12093,2315],{"class":328},[125,12095,11042],{"class":332},[125,12097,336],{"class":328},[125,12099,1976],{"class":437},[125,12101,1979],{"class":328},[125,12103,12104,12107,12110,12112,12114,12116,12118,12120],{"class":127,"line":237},[125,12105,12106],{"class":437}," const ",[125,12108,12109],{"class":332},"memoized",[125,12111,428],{"class":328},[125,12113,8125],{"class":405},[125,12115,703],{"class":437},[125,12117,409],{"class":328},[125,12119,715],{"class":398},[125,12121,412],{"class":328},[125,12123,12124,12126,12128,12130,12132,12134,12136,12138,12140,12142,12144],{"class":127,"line":249},[125,12125,2335],{"class":324},[125,12127,11042],{"class":332},[125,12129,697],{"class":328},[125,12131,10684],{"class":405},[125,12133,703],{"class":437},[125,12135,10689],{"class":708},[125,12137,715],{"class":398},[125,12139,10694],{"class":332},[125,12141,697],{"class":328},[125,12143,11996],{"class":332},[125,12145,885],{"class":437},[125,12147,12148,12150,12152,12154],{"class":127,"line":29},[125,12149,3727],{"class":328},[125,12151,861],{"class":437},[125,12153,11071],{"class":332},[125,12155,8110],{"class":437},[125,12157,12158],{"class":127,"line":272},[125,12159,387],{"emptyLinePlaceholder":386},[125,12161,12162,12165,12167,12169,12171,12173],{"class":127,"line":281},[125,12163,12164],{"class":437}," return {result}\n}\n",[122,12187,12188,12193,12207,12212,12230,12234,12255],{"__ignoreMap":120},[125,12189,12190],{"class":127,"line":128},[125,12191,12192],{"class":145},"// Let compiler handle optimization\n",[125,12194,12195,12197,12199,12201,12203,12205],{"class":127,"line":135},[125,12196,8026],{"class":398},[125,12198,10650],{"class":405},[125,12200,846],{"class":328},[125,12202,1383],{"class":708},[125,12204,852],{"class":328},[125,12206,412],{"class":328},[125,12208,12209],{"class":127,"line":16},[125,12210,12211],{"class":145}," // Compiler will memoize if beneficial\n",[125,12213,12214,12216,12219,12221,12224,12226,12228],{"class":127,"line":159},[125,12215,422],{"class":398},[125,12217,12218],{"class":332}," result",[125,12220,428],{"class":328},[125,12222,12223],{"class":405}," expensiveCalculation",[125,12225,703],{"class":437},[125,12227,1412],{"class":332},[125,12229,885],{"class":437},[125,12231,12232],{"class":127,"line":170},[125,12233,387],{"emptyLinePlaceholder":386},[125,12235,12236,12238,12240,12242,12244,12246,12249,12251,12253],{"class":127,"line":181},[125,12237,447],{"class":324},[125,12239,1402],{"class":437},[125,12241,458],{"class":131},[125,12243,472],{"class":437},[125,12245,2315],{"class":328},[125,12247,12248],{"class":332},"result",[125,12250,1576],{"class":328},[125,12252,458],{"class":332},[125,12254,461],{"class":328},[125,12256,12257],{"class":127,"line":192},[125,12258,603],{"class":328},[301,12260,12262],{"id":12261},"_3-focus-on-logic","3. Focus on Logic",[115,12264,12266],{"className":8012,"code":12265,"language":8014,"meta":120,"style":120},"// Focus on business logic\nfunction ShoppingCart({ items, onCheckout }) {\n const total = items.reduce((sum, item) => sum + item.price, 0)\n const tax = total * 0.1\n const final = total + tax\n\n return (\n
\n

Total: ${final}

\n \n
\n )\n}\n",[122,12267,12268,12273,12293,12343,12360,12376,12380,12386,12394,12421,12450,12458,12462],{"__ignoreMap":120},[125,12269,12270],{"class":127,"line":128},[125,12271,12272],{"class":145},"// Focus on business logic\n",[125,12274,12275,12277,12280,12282,12284,12286,12289,12291],{"class":127,"line":135},[125,12276,8026],{"class":398},[125,12278,12279],{"class":405}," ShoppingCart",[125,12281,846],{"class":328},[125,12283,11042],{"class":708},[125,12285,867],{"class":328},[125,12287,12288],{"class":708}," onCheckout",[125,12290,852],{"class":328},[125,12292,412],{"class":328},[125,12294,12295,12297,12300,12302,12304,12306,12309,12311,12313,12316,12318,12320,12322,12324,12327,12330,12332,12334,12336,12338,12341],{"class":127,"line":16},[125,12296,422],{"class":398},[125,12298,12299],{"class":332}," total",[125,12301,428],{"class":328},[125,12303,11042],{"class":332},[125,12305,697],{"class":328},[125,12307,12308],{"class":405},"reduce",[125,12310,703],{"class":437},[125,12312,703],{"class":328},[125,12314,12315],{"class":708},"sum",[125,12317,867],{"class":328},[125,12319,10694],{"class":708},[125,12321,712],{"class":328},[125,12323,715],{"class":398},[125,12325,12326],{"class":332}," sum",[125,12328,12329],{"class":328}," +",[125,12331,10694],{"class":332},[125,12333,697],{"class":328},[125,12335,10859],{"class":332},[125,12337,867],{"class":328},[125,12339,12340],{"class":1910}," 0",[125,12342,885],{"class":437},[125,12344,12345,12347,12350,12352,12354,12357],{"class":127,"line":159},[125,12346,422],{"class":398},[125,12348,12349],{"class":332}," tax",[125,12351,428],{"class":328},[125,12353,12299],{"class":332},[125,12355,12356],{"class":328}," *",[125,12358,12359],{"class":1910}," 0.1\n",[125,12361,12362,12364,12367,12369,12371,12373],{"class":127,"line":170},[125,12363,422],{"class":398},[125,12365,12366],{"class":332}," final",[125,12368,428],{"class":328},[125,12370,12299],{"class":332},[125,12372,12329],{"class":328},[125,12374,12375],{"class":332}," tax\n",[125,12377,12378],{"class":127,"line":181},[125,12379,387],{"emptyLinePlaceholder":386},[125,12381,12382,12384],{"class":127,"line":192},[125,12383,447],{"class":324},[125,12385,450],{"class":437},[125,12387,12388,12390,12392],{"class":127,"line":203},[125,12389,455],{"class":437},[125,12391,458],{"class":131},[125,12393,461],{"class":437},[125,12395,12396,12398,12400,12402,12405,12407,12410,12412,12415,12417,12419],{"class":127,"line":211},[125,12397,466],{"class":437},[125,12399,104],{"class":131},[125,12401,472],{"class":437},[125,12403,12404],{"class":708},"Total",[125,12406,1898],{"class":328},[125,12408,12409],{"class":131}," $",[125,12411,2315],{"class":328},[125,12413,12414],{"class":332},"final",[125,12416,1576],{"class":328},[125,12418,104],{"class":332},[125,12420,461],{"class":328},[125,12422,12423,12425,12427,12429,12431,12434,12436,12438,12441,12444,12446,12448],{"class":127,"line":225},[125,12424,466],{"class":328},[125,12426,1112],{"class":332},[125,12428,3987],{"class":332},[125,12430,565],{"class":328},[125,12432,12433],{"class":437},"() => onCheckout",[125,12435,703],{"class":328},[125,12437,11071],{"class":708},[125,12439,12440],{"class":328},")}>",[125,12442,12443],{"class":332},"Checkout",[125,12445,478],{"class":328},[125,12447,1112],{"class":332},[125,12449,461],{"class":328},[125,12451,12452,12454,12456],{"class":127,"line":237},[125,12453,587],{"class":328},[125,12455,458],{"class":332},[125,12457,461],{"class":328},[125,12459,12460],{"class":127,"line":249},[125,12461,597],{"class":437},[125,12463,12464],{"class":127,"line":29},[125,12465,603],{"class":328},[99,12467,12469],{"id":12468},"common-patterns","Common Patterns",[301,12471,12473],{"id":12472},"_1-list-rendering","1. List Rendering",[115,12475,12477],{"className":8012,"code":12476,"language":8014,"meta":120,"style":120},"function ItemList({ items, onSelect }) {\n // Automatically optimized\n const sorted = [...items].sort((a, b) => a.name.localeCompare(b.name))\n\n return (\n
    \n {sorted.map(item => (\n
  • onSelect(item)}>\n {item.name}\n
  • \n ))}\n
\n )\n}\n",[122,12478,12479,12498,12503,12557,12561,12567,12575,12593,12624,12636,12644,12650,12658,12662],{"__ignoreMap":120},[125,12480,12481,12483,12486,12488,12490,12492,12494,12496],{"class":127,"line":128},[125,12482,8026],{"class":398},[125,12484,12485],{"class":405}," ItemList",[125,12487,846],{"class":328},[125,12489,11042],{"class":708},[125,12491,867],{"class":328},[125,12493,10810],{"class":708},[125,12495,852],{"class":328},[125,12497,412],{"class":328},[125,12499,12500],{"class":127,"line":135},[125,12501,12502],{"class":145}," // Automatically optimized\n",[125,12504,12505,12507,12509,12511,12513,12515,12517,12519,12521,12523,12525,12527,12529,12531,12533,12535,12537,12539,12541,12543,12545,12547,12549,12551,12553,12555],{"class":127,"line":16},[125,12506,422],{"class":398},[125,12508,10826],{"class":332},[125,12510,428],{"class":328},[125,12512,861],{"class":437},[125,12514,3490],{"class":328},[125,12516,11071],{"class":332},[125,12518,873],{"class":437},[125,12520,697],{"class":328},[125,12522,10835],{"class":405},[125,12524,703],{"class":437},[125,12526,703],{"class":328},[125,12528,10842],{"class":708},[125,12530,867],{"class":328},[125,12532,10847],{"class":708},[125,12534,712],{"class":328},[125,12536,715],{"class":398},[125,12538,10854],{"class":332},[125,12540,697],{"class":328},[125,12542,8179],{"class":332},[125,12544,697],{"class":328},[125,12546,12037],{"class":405},[125,12548,703],{"class":437},[125,12550,12042],{"class":332},[125,12552,697],{"class":328},[125,12554,8179],{"class":332},[125,12556,7139],{"class":437},[125,12558,12559],{"class":127,"line":159},[125,12560,387],{"emptyLinePlaceholder":386},[125,12562,12563,12565],{"class":127,"line":170},[125,12564,447],{"class":324},[125,12566,450],{"class":437},[125,12568,12569,12571,12573],{"class":127,"line":181},[125,12570,455],{"class":437},[125,12572,7919],{"class":131},[125,12574,461],{"class":437},[125,12576,12577,12579,12581,12583,12585,12587,12589,12591],{"class":127,"line":192},[125,12578,691],{"class":328},[125,12580,10938],{"class":708},[125,12582,697],{"class":437},[125,12584,700],{"class":708},[125,12586,703],{"class":437},[125,12588,10689],{"class":708},[125,12590,715],{"class":328},[125,12592,450],{"class":437},[125,12594,12595,12597,12599,12601,12603,12606,12608,12610,12612,12614,12617,12619,12621],{"class":127,"line":203},[125,12596,509],{"class":328},[125,12598,7771],{"class":332},[125,12600,728],{"class":332},[125,12602,565],{"class":328},[125,12604,12605],{"class":437},"item.",[125,12607,737],{"class":332},[125,12609,2619],{"class":328},[125,12611,3987],{"class":332},[125,12613,565],{"class":328},[125,12615,12616],{"class":437},"() => onSelect",[125,12618,703],{"class":328},[125,12620,10689],{"class":708},[125,12622,12623],{"class":328},")}>\n",[125,12625,12626,12628,12630,12632,12634],{"class":127,"line":211},[125,12627,3484],{"class":328},[125,12629,10689],{"class":708},[125,12631,697],{"class":437},[125,12633,8179],{"class":708},[125,12635,603],{"class":328},[125,12637,12638,12640,12642],{"class":127,"line":225},[125,12639,548],{"class":328},[125,12641,7771],{"class":332},[125,12643,461],{"class":328},[125,12645,12646,12648],{"class":127,"line":237},[125,12647,754],{"class":437},[125,12649,603],{"class":328},[125,12651,12652,12654,12656],{"class":127,"line":249},[125,12653,587],{"class":328},[125,12655,7919],{"class":332},[125,12657,461],{"class":328},[125,12659,12660],{"class":127,"line":29},[125,12661,597],{"class":437},[125,12663,12664],{"class":127,"line":272},[125,12665,603],{"class":328},[301,12667,12669],{"id":12668},"_2-form-handling","2. Form Handling",[115,12671,12673],{"className":8012,"code":12672,"language":8014,"meta":120,"style":120},"function Form({ onSubmit }) {\n const [values, setValues] = useState({})\n\n const handleChange = (field, value) => {\n setValues(prev => ({ ...prev, [field]: value }))\n }\n\n const handleSubmit = (e) => {\n e.preventDefault()\n onSubmit(values)\n }\n\n return (\n
\n handleChange('name', e.target.value)} />\n \n \n )\n}\n",[122,12674,12675,12690,12717,12721,12743,12778,12782,12786,12804,12814,12825,12829,12833,12839,12853,12897,12924,12932,12936],{"__ignoreMap":120},[125,12676,12677,12679,12682,12684,12686,12688],{"class":127,"line":128},[125,12678,8026],{"class":398},[125,12680,12681],{"class":405}," Form",[125,12683,846],{"class":328},[125,12685,958],{"class":708},[125,12687,852],{"class":328},[125,12689,412],{"class":328},[125,12691,12692,12694,12696,12699,12701,12704,12706,12708,12710,12712,12715],{"class":127,"line":135},[125,12693,422],{"class":398},[125,12695,861],{"class":328},[125,12697,12698],{"class":332},"values",[125,12700,867],{"class":328},[125,12702,12703],{"class":332}," setValues",[125,12705,873],{"class":328},[125,12707,428],{"class":328},[125,12709,818],{"class":405},[125,12711,703],{"class":437},[125,12713,12714],{"class":328},"{}",[125,12716,885],{"class":437},[125,12718,12719],{"class":127,"line":16},[125,12720,387],{"emptyLinePlaceholder":386},[125,12722,12723,12725,12727,12729,12731,12733,12735,12737,12739,12741],{"class":127,"line":159},[125,12724,422],{"class":398},[125,12726,11512],{"class":332},[125,12728,428],{"class":328},[125,12730,901],{"class":328},[125,12732,11519],{"class":708},[125,12734,867],{"class":328},[125,12736,11524],{"class":708},[125,12738,712],{"class":328},[125,12740,715],{"class":398},[125,12742,412],{"class":328},[125,12744,12745,12748,12750,12752,12754,12756,12758,12760,12762,12764,12766,12768,12770,12772,12774,12776],{"class":127,"line":170},[125,12746,12747],{"class":405}," setValues",[125,12749,703],{"class":437},[125,12751,11540],{"class":708},[125,12753,715],{"class":398},[125,12755,901],{"class":437},[125,12757,2315],{"class":328},[125,12759,6500],{"class":328},[125,12761,11540],{"class":332},[125,12763,867],{"class":328},[125,12765,861],{"class":437},[125,12767,11519],{"class":332},[125,12769,873],{"class":437},[125,12771,1898],{"class":328},[125,12773,11524],{"class":332},[125,12775,336],{"class":328},[125,12777,7139],{"class":437},[125,12779,12780],{"class":127,"line":181},[125,12781,938],{"class":328},[125,12783,12784],{"class":127,"line":192},[125,12785,387],{"emptyLinePlaceholder":386},[125,12787,12788,12790,12792,12794,12796,12798,12800,12802],{"class":127,"line":203},[125,12789,422],{"class":398},[125,12791,896],{"class":332},[125,12793,428],{"class":328},[125,12795,901],{"class":328},[125,12797,904],{"class":708},[125,12799,712],{"class":328},[125,12801,715],{"class":398},[125,12803,412],{"class":328},[125,12805,12806,12808,12810,12812],{"class":127,"line":211},[125,12807,915],{"class":332},[125,12809,697],{"class":328},[125,12811,920],{"class":405},[125,12813,438],{"class":437},[125,12815,12816,12819,12821,12823],{"class":127,"line":225},[125,12817,12818],{"class":405}," onSubmit",[125,12820,703],{"class":437},[125,12822,12698],{"class":332},[125,12824,885],{"class":437},[125,12826,12827],{"class":127,"line":237},[125,12828,938],{"class":328},[125,12830,12831],{"class":127,"line":249},[125,12832,387],{"emptyLinePlaceholder":386},[125,12834,12835,12837],{"class":127,"line":29},[125,12836,447],{"class":324},[125,12838,450],{"class":437},[125,12840,12841,12843,12845,12847,12849,12851],{"class":127,"line":272},[125,12842,455],{"class":328},[125,12844,955],{"class":332},[125,12846,958],{"class":332},[125,12848,565],{"class":328},[125,12850,963],{"class":332},[125,12852,966],{"class":328},[125,12854,12855,12857,12859,12861,12863,12865,12867,12869,12871,12873,12875,12877,12879,12882,12884,12886,12888,12891,12893,12895],{"class":127,"line":281},[125,12856,466],{"class":328},[125,12858,5346],{"class":332},[125,12860,11648],{"class":332},[125,12862,565],{"class":328},[125,12864,904],{"class":708},[125,12866,715],{"class":398},[125,12868,11512],{"class":405},[125,12870,703],{"class":437},[125,12872,1677],{"class":328},[125,12874,8179],{"class":141},[125,12876,1677],{"class":328},[125,12878,867],{"class":328},[125,12880,12881],{"class":332}," e",[125,12883,697],{"class":328},[125,12885,1022],{"class":332},[125,12887,697],{"class":328},[125,12889,12890],{"class":332},"value",[125,12892,712],{"class":437},[125,12894,2619],{"class":328},[125,12896,543],{"class":328},[125,12898,12899,12901,12903,12905,12907,12909,12911,12913,12915,12918,12920,12922],{"class":127,"line":290},[125,12900,466],{"class":328},[125,12902,1112],{"class":332},[125,12904,5349],{"class":332},[125,12906,494],{"class":328},[125,12908,497],{"class":328},[125,12910,1080],{"class":141},[125,12912,497],{"class":328},[125,12914,472],{"class":328},[125,12916,12917],{"class":332},"Submit",[125,12919,478],{"class":328},[125,12921,1112],{"class":332},[125,12923,461],{"class":328},[125,12925,12926,12928,12930],{"class":127,"line":555},[125,12927,587],{"class":328},[125,12929,955],{"class":332},[125,12931,461],{"class":328},[125,12933,12934],{"class":127,"line":574},[125,12935,597],{"class":437},[125,12937,12938],{"class":127,"line":584},[125,12939,603],{"class":328},[301,12941,12943],{"id":12942},"_3-data-fetching","3. Data Fetching",[115,12945,12947],{"className":8012,"code":12946,"language":8014,"meta":120,"style":120},"function DataComponent({ id }) {\n const { data, isLoading } = useQuery(['item', id], fetchItem)\n\n if (isLoading) return \n if (!data) return
No data
\n\n return \n}\n",[122,12948,12949,12964,13006,13010,13032,13062,13066,13087],{"__ignoreMap":120},[125,12950,12951,12953,12956,12958,12960,12962],{"class":127,"line":128},[125,12952,8026],{"class":398},[125,12954,12955],{"class":405}," DataComponent",[125,12957,846],{"class":328},[125,12959,1746],{"class":708},[125,12961,852],{"class":328},[125,12963,412],{"class":328},[125,12965,12966,12968,12970,12972,12974,12977,12979,12981,12984,12987,12989,12991,12993,12995,12997,12999,13001,13004],{"class":127,"line":135},[125,12967,422],{"class":398},[125,12969,329],{"class":328},[125,12971,1383],{"class":332},[125,12973,867],{"class":328},[125,12975,12976],{"class":332}," isLoading",[125,12978,336],{"class":328},[125,12980,428],{"class":328},[125,12982,12983],{"class":405}," useQuery",[125,12985,12986],{"class":437},"([",[125,12988,1677],{"class":328},[125,12990,10689],{"class":141},[125,12992,1677],{"class":328},[125,12994,867],{"class":328},[125,12996,1746],{"class":332},[125,12998,873],{"class":437},[125,13000,867],{"class":328},[125,13002,13003],{"class":332}," fetchItem",[125,13005,885],{"class":437},[125,13007,13008],{"class":127,"line":16},[125,13009,387],{"emptyLinePlaceholder":386},[125,13011,13012,13014,13016,13019,13021,13023,13025,13028,13030],{"class":127,"line":159},[125,13013,1960],{"class":324},[125,13015,901],{"class":437},[125,13017,13018],{"class":332},"isLoading",[125,13020,1976],{"class":437},[125,13022,10080],{"class":324},[125,13024,1402],{"class":328},[125,13026,13027],{"class":131},"Spinner",[125,13029,9933],{"class":437},[125,13031,461],{"class":328},[125,13033,13034,13037,13039,13041,13043,13045,13047,13049,13051,13054,13056,13058,13060],{"class":127,"line":170},[125,13035,13036],{"class":437}," if (",[125,13038,1965],{"class":328},[125,13040,1412],{"class":332},[125,13042,1976],{"class":437},[125,13044,10080],{"class":332},[125,13046,1402],{"class":437},[125,13048,458],{"class":131},[125,13050,472],{"class":437},[125,13052,13053],{"class":332},"No",[125,13055,1383],{"class":332},[125,13057,478],{"class":328},[125,13059,458],{"class":332},[125,13061,461],{"class":328},[125,13063,13064],{"class":127,"line":181},[125,13065,387],{"emptyLinePlaceholder":386},[125,13067,13068,13070,13072,13075,13077,13079,13081,13083,13085],{"class":127,"line":192},[125,13069,447],{"class":324},[125,13071,1402],{"class":328},[125,13073,13074],{"class":131},"ItemDisplay",[125,13076,10694],{"class":131},[125,13078,565],{"class":328},[125,13080,1412],{"class":437},[125,13082,2619],{"class":328},[125,13084,9933],{"class":437},[125,13086,461],{"class":328},[125,13088,13089],{"class":127,"line":203},[125,13090,603],{"class":437},[99,13092,8391],{"id":8390},[301,13094,13096],{"id":13095},"_1-opt-out-of-memoization","1. Opt Out of Memoization",[115,13098,13100],{"className":8012,"code":13099,"language":8014,"meta":120,"style":120},"function Component({ value }) {\n // Force no memoization\n 'use no forget'\n\n const result = expensive(value)\n return
{result}
\n}\n",[122,13101,13102,13116,13121,13132,13136,13153,13173],{"__ignoreMap":120},[125,13103,13104,13106,13108,13110,13112,13114],{"class":127,"line":128},[125,13105,8026],{"class":398},[125,13107,10650],{"class":405},[125,13109,846],{"class":328},[125,13111,11524],{"class":708},[125,13113,852],{"class":328},[125,13115,412],{"class":328},[125,13117,13118],{"class":127,"line":135},[125,13119,13120],{"class":145}," // Force no memoization\n",[125,13122,13123,13126,13129],{"class":127,"line":16},[125,13124,13125],{"class":328}," '",[125,13127,13128],{"class":141},"use no forget",[125,13130,13131],{"class":328},"'\n",[125,13133,13134],{"class":127,"line":159},[125,13135,387],{"emptyLinePlaceholder":386},[125,13137,13138,13140,13142,13144,13147,13149,13151],{"class":127,"line":170},[125,13139,422],{"class":398},[125,13141,12218],{"class":332},[125,13143,428],{"class":328},[125,13145,13146],{"class":405}," expensive",[125,13148,703],{"class":437},[125,13150,12890],{"class":332},[125,13152,885],{"class":437},[125,13154,13155,13157,13159,13161,13163,13165,13167,13169,13171],{"class":127,"line":181},[125,13156,447],{"class":324},[125,13158,1402],{"class":437},[125,13160,458],{"class":131},[125,13162,472],{"class":437},[125,13164,2315],{"class":328},[125,13166,12248],{"class":332},[125,13168,1576],{"class":328},[125,13170,458],{"class":332},[125,13172,461],{"class":328},[125,13174,13175],{"class":127,"line":192},[125,13176,603],{"class":328},[301,13178,13180],{"id":13179},"_2-force-memoization","2. Force Memoization",[115,13182,13184],{"className":8012,"code":13183,"language":8014,"meta":120,"style":120},"function Component({ data }) {\n // Ensure memoization\n 'use forget'\n\n const result = process(data)\n return
{result}
\n}\n",[122,13185,13186,13200,13205,13214,13218,13234,13254],{"__ignoreMap":120},[125,13187,13188,13190,13192,13194,13196,13198],{"class":127,"line":128},[125,13189,8026],{"class":398},[125,13191,10650],{"class":405},[125,13193,846],{"class":328},[125,13195,1383],{"class":708},[125,13197,852],{"class":328},[125,13199,412],{"class":328},[125,13201,13202],{"class":127,"line":135},[125,13203,13204],{"class":145}," // Ensure memoization\n",[125,13206,13207,13209,13212],{"class":127,"line":16},[125,13208,13125],{"class":328},[125,13210,13211],{"class":141},"use forget",[125,13213,13131],{"class":328},[125,13215,13216],{"class":127,"line":159},[125,13217,387],{"emptyLinePlaceholder":386},[125,13219,13220,13222,13224,13226,13228,13230,13232],{"class":127,"line":170},[125,13221,422],{"class":398},[125,13223,12218],{"class":332},[125,13225,428],{"class":328},[125,13227,2776],{"class":405},[125,13229,703],{"class":437},[125,13231,1412],{"class":332},[125,13233,885],{"class":437},[125,13235,13236,13238,13240,13242,13244,13246,13248,13250,13252],{"class":127,"line":181},[125,13237,447],{"class":324},[125,13239,1402],{"class":437},[125,13241,458],{"class":131},[125,13243,472],{"class":437},[125,13245,2315],{"class":328},[125,13247,12248],{"class":332},[125,13249,1576],{"class":328},[125,13251,458],{"class":332},[125,13253,461],{"class":328},[125,13255,13256],{"class":127,"line":192},[125,13257,603],{"class":328},[99,13259,13261],{"id":13260},"performance-comparison","Performance Comparison",[9684,13263,13264,13277],{},[9687,13265,13266],{},[9690,13267,13268,13271,13274],{},[9693,13269,13270],{},"Metric",[9693,13272,13273],{},"Manual Memoization",[9693,13275,13276],{},"React Compiler",[9709,13278,13279,13289,13300,13311],{},[9690,13280,13281,13283,13286],{},[9714,13282,9701],{},[9714,13284,13285],{},"Larger",[9714,13287,13288],{},"Smaller",[9690,13290,13291,13294,13297],{},[9714,13292,13293],{},"Dev Time",[9714,13295,13296],{},"More",[9714,13298,13299],{},"Less",[9690,13301,13302,13305,13308],{},[9714,13303,13304],{},"Runtime Perf",[9714,13306,13307],{},"Good",[9714,13309,13310],{},"Better",[9690,13312,13313,13316,13319],{},[9714,13314,13315],{},"Code Quality",[9714,13317,13318],{},"Variable",[9714,13320,13321],{},"Consistent",[99,13323,13325],{"id":13324},"future-of-react-optimization","Future of React Optimization",[301,13327,13329],{"id":13328},"_1-server-components-integration","1. Server Components Integration",[115,13331,13333],{"className":8012,"code":13332,"language":8014,"meta":120,"style":120},"// RSC + Compiler = Maximum optimization\nasync function Page({ id }) {\n const data = await fetchData(id)\n\n return \n}\n",[122,13334,13335,13340,13356,13375,13379,13399],{"__ignoreMap":120},[125,13336,13337],{"class":127,"line":128},[125,13338,13339],{"class":145},"// RSC + Compiler = Maximum optimization\n",[125,13341,13342,13344,13346,13348,13350,13352,13354],{"class":127,"line":135},[125,13343,620],{"class":398},[125,13345,402],{"class":398},[125,13347,9366],{"class":405},[125,13349,846],{"class":328},[125,13351,1746],{"class":708},[125,13353,852],{"class":328},[125,13355,412],{"class":328},[125,13357,13358,13360,13362,13364,13366,13369,13371,13373],{"class":127,"line":16},[125,13359,422],{"class":398},[125,13361,1383],{"class":332},[125,13363,428],{"class":328},[125,13365,431],{"class":324},[125,13367,13368],{"class":405}," fetchData",[125,13370,703],{"class":437},[125,13372,737],{"class":332},[125,13374,885],{"class":437},[125,13376,13377],{"class":127,"line":159},[125,13378,387],{"emptyLinePlaceholder":386},[125,13380,13381,13383,13385,13387,13389,13391,13393,13395,13397],{"class":127,"line":170},[125,13382,447],{"class":324},[125,13384,1402],{"class":328},[125,13386,9922],{"class":131},[125,13388,1383],{"class":131},[125,13390,565],{"class":328},[125,13392,1412],{"class":437},[125,13394,2619],{"class":328},[125,13396,9933],{"class":437},[125,13398,461],{"class":328},[125,13400,13401],{"class":127,"line":181},[125,13402,603],{"class":437},[301,13404,13406],{"id":13405},"_2-automatic-code-splitting","2. Automatic Code Splitting",[115,13408,13410],{"className":8012,"code":13409,"language":8014,"meta":120,"style":120},"// Compiler suggests splits\nfunction HeavyComponent() {\n // Automatically split\n return \n}\n",[122,13411,13412,13417,13428,13433,13446],{"__ignoreMap":120},[125,13413,13414],{"class":127,"line":128},[125,13415,13416],{"class":145},"// Compiler suggests splits\n",[125,13418,13419,13421,13424,13426],{"class":127,"line":135},[125,13420,8026],{"class":398},[125,13422,13423],{"class":405}," HeavyComponent",[125,13425,409],{"class":328},[125,13427,412],{"class":328},[125,13429,13430],{"class":127,"line":16},[125,13431,13432],{"class":145}," // Automatically split\n",[125,13434,13435,13437,13439,13442,13444],{"class":127,"line":159},[125,13436,447],{"class":324},[125,13438,1402],{"class":328},[125,13440,13441],{"class":131},"ExpensiveFeature",[125,13443,9933],{"class":437},[125,13445,461],{"class":328},[125,13447,13448],{"class":127,"line":170},[125,13449,603],{"class":437},[99,13451,7763],{"id":7762},[104,13453,13454],{},"React Compiler represents a paradigm shift in React development. By automating memoization, it allows developers to focus on writing clear, maintainable code while the compiler handles optimization. This results in better performance, smaller bundles, and improved developer experience.",[104,13456,13457],{},"Embrace the compiler, write idiomatic code, and let React handle the optimization. The future of React is automatic, and it's here now.",[10149,13459],{},[104,13461,13462,13465],{},[7774,13463,13464],{},"Ready to try React Compiler?"," Start with a new component and write it without manual memoization. The compiler will handle the rest.",[7812,13467,13468],{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}",{"title":120,"searchDepth":135,"depth":135,"links":13470},[13471,13472,13476,13481,13486,13491,13496,13501,13505,13506,13510],{"id":10212,"depth":135,"text":10207},{"id":10225,"depth":135,"text":10226,"children":13473},[13474,13475],{"id":10232,"depth":16,"text":10233},{"id":10467,"depth":16,"text":10468},{"id":10628,"depth":135,"text":10629,"children":13477},[13478,13479,13480],{"id":10632,"depth":16,"text":10633},{"id":10784,"depth":16,"text":10785},{"id":11019,"depth":16,"text":11020},{"id":11137,"depth":135,"text":11138,"children":13482},[13483,13484,13485],{"id":11141,"depth":16,"text":11142},{"id":11322,"depth":16,"text":11323},{"id":11445,"depth":16,"text":11446},{"id":11768,"depth":135,"text":11769,"children":13487},[13488,13489,13490],{"id":11772,"depth":16,"text":11773},{"id":11843,"depth":16,"text":11844},{"id":11921,"depth":16,"text":11922},{"id":11940,"depth":135,"text":11941,"children":13492},[13493,13494,13495],{"id":11944,"depth":16,"text":11945},{"id":12181,"depth":16,"text":12182},{"id":12261,"depth":16,"text":12262},{"id":12468,"depth":135,"text":12469,"children":13497},[13498,13499,13500],{"id":12472,"depth":16,"text":12473},{"id":12668,"depth":16,"text":12669},{"id":12942,"depth":16,"text":12943},{"id":8390,"depth":135,"text":8391,"children":13502},[13503,13504],{"id":13095,"depth":16,"text":13096},{"id":13179,"depth":16,"text":13180},{"id":13260,"depth":135,"text":13261},{"id":13324,"depth":135,"text":13325,"children":13507},[13508,13509],{"id":13328,"depth":16,"text":13329},{"id":13405,"depth":16,"text":13406},{"id":7762,"depth":135,"text":7763},"2026-02-17","Discover how React Compiler in 2026 eliminates manual memoization with automatic optimization, making React apps faster with less code.",{"readingTime":9082},"/blog/32-react-compiler-auto-memoization-2026",{"title":10207,"description":13512},"React Advanced","Advanced React patterns and performance optimization",{"src":13519,"mime":7873,"alt":13520,"width":7875,"height":7876},"/img/blog/32-react-compiler-auto-memoization-2026/banner.svg","React Compiler Auto-Memoization - React logo with automatic optimization gears on purple gradient","blog/32-react-compiler-auto-memoization-2026",[7880,9092,9093,9095,9094],"Tprx2HZRTjlOP-QIsqQK7Jt0TofwMQ1kqqUYaGVml7g",["Reactive",13525],{"$scolor-mode":13526,"$snuxt-seo-utils:routeRules":13528,"$stoasts":13529,"$ssite-config":13530},{"preference":13527,"value":13527,"unknown":386,"forced":7865},"system",{"head":-1,"seoMeta":-1},[],{"_priority":13531,"defaultLocale":7698,"description":13534,"env":13535,"indexable":386,"name":13536,"url":13537},{"env":13532,"indexable":13533,"url":13533,"name":13533,"description":13533,"defaultLocale":13533},-15,-3,"Senior Software Engineer specializing in modern web technologies. Crafting scalable web applications and browser extensions for startups and founders.","production","Muhammad Ubaid Raza - Full Stack Engineer","https://mubaidr.js.org",["Set"],["ShallowReactive",13540],{"blog-post-/blog/10-nextjs-14-app-router-guide":-1,"profile-data":-1,"related-posts-/blog/10-nextjs-14-app-router-guide":-1}]