Programming

Programming

Exploring Various Coding Languages

Programming LanguagesSoftware DevelopmentAlgorithms and Data StructuresSoftware EngineeringWeb and Mobile Programming

مقالات این بخش

Client-side Transitions in Next.js – Optimizing Navigation with Prefetching, Loading States, and History API

Next.js uses client-side transitions to deliver fast, seamless navigation between pages. This article explores how the Link component works, what causes slow transitions, how to use loading.tsx, hover-based prefetching, and the History API to update URLs without full reloads.

/persian/article-fa/nextjs-client-side-transitions-prefetch-loading-history-api

Server and Client Components in Next.js – Rendering, Data Flow, and Bundle Optimization

Next.js combines Server and Client Components to build fast, interactive applications. This article explains how React Server Component Payloads work, how hydration enables interactivity, how to pass data between components, and how to optimize JavaScript bundles using the "use client" directive. It also covers context usage, third-party integration, and environment safety.

/persian/article-fa/nextjs-server-client-components-rendering-data-transfer-optimization

Cache Components in Next.js – Partial Prerendering, Streaming, and Fine-Grained Caching

Cache Components introduce a new rendering model in Next.js that balances dynamic freshness with static speed. By combining Suspense boundaries, streaming, and the use cache directive, developers can cache parts of their UI and data while still delivering personalized, real-time experiences. This article explains how Cache Components work, how to use them effectively, and how to tag and revalidate cached content.

/persian/article-fa/nextjs-cache-components-partial-prerendering-streaming-caching

Enabling Cache Components in Next.js – Migrating from Legacy Config and Controlling Dynamic Rendering

Cache Components in Next.js offer a modern way to combine dynamic rendering with fast performance. Once enabled, all pages are treated as dynamic by default, and developers can selectively cache parts of the UI using use cache and Suspense boundaries. This article explains how to enable the feature, migrate from legacy config options like dynamic and revalidate, and use new tools like cacheLife and cacheTag for precise control.

/persian/article-fa/enable-cache-components-nextjs-migrate-config-dynamic-rendering

Fetching Data in Next.js – Server Components, Client Components, Streaming, and Smart Caching

Next.js offers powerful tools for fetching data in both Server and Client Components. This article explores how to use fetch, ORM/database queries, the use hook, community libraries like SWR, and streaming techniques with Suspense and loading.tsx.. It also covers request deduplication and smart caching strategies for optimized performance.

/persian/article-fa/nextjs-fetching-data-server-client-streaming-caching

Creating Meaningful Loading States in Next.js – Streaming, Preloading, and Parallel Data Fetching

Next.js enables developers to design meaningful loading states using Suspense boundaries, parallel data fetching, and smart preloading. This article explores how to show instant fallback UI, avoid blocking renders, and use techniques like Promise.all and preload to improve user experience and responsiveness.

/persian/article-fa/nextjs-meaningful-loading-states-streaming-preloading-parallel-fetching

Updating Data in Next.js – Server Functions, Actions, and UI Revalidation

Next.js enables data updates through Server Functions, also known as Server Actions. These asynchronous functions run on the server and can be invoked from forms, buttons, or event handlers in Client Components. This article explains how to define Server Functions, invoke them, show pending states, revalidate cache, redirect users, and manage cookies—all while keeping the UI responsive and consistent.

/persian/article-fa/nextjs-updating-data-server-functions-actions-revalidation

Caching and Revalidating Data in Next.js – Optimizing Performance with fetch, unstable_cache, and Smart Tags

Next.js provides powerful tools for caching and revalidating data. This article explains how to cache fetch requests, use unstable_cache for async functions, and apply revalidatePath, revalidateTag, and updateTag to selectively refresh data. These techniques help improve performance and deliver fresh content without rebuilding entire routes.

/persian/article-fa/nextjs-caching-revalidation-unstable-cache-revalidatepath-revalidatetag

Error Handling in Next.js – Expected Errors, Uncaught Exceptions, and Error Boundaries

Next.js categorizes errors into expected errors and uncaught exceptions. This article explains how to handle form errors with useActionState, show custom 404 pages with notFound, and define error boundaries for unexpected exceptions. It also covers event handler errors, startTransition exceptions, and global error handling in the root layout.

/persian/article-fa/nextjs-error-handling-expected-errors-boundaries-404-global

Styling in Next.js – Tailwind, CSS Modules, Global Styles, and CSS Ordering

Next.js offers multiple ways to style your application, including Tailwind CSS, CSS Modules, global stylesheets, external packages, Sass, and CSS-in-JS. This article walks through how to set up each method, manage stylesheet ordering, and understand the differences between development and production behavior.

/persian/article-fa/nextjs-css-styling-tailwind-modules-global-ordering

Image Optimization in Next.js – Local and Remote Images with the <Image> Component

Next.js provides a powerful <Image> component that extends the native <img> element with built-in optimization features. This article explores how to use the component for local and remote images, prevent layout shifts, enable lazy loading, and configure remote image domains securely.

/persian/article-fa/nextjs-image-optimization-local-remote-blur-placeholder

Font Optimization in Next.js – Self-Hosting Google and Local Fonts with next/font

The next/font module in Next.js enables automatic font optimization by self-hosting Google and local fonts. This eliminates external requests, improves privacy, and prevents layout shift. This article explains how to use next/font with Google fonts, local font files, and multiple font variants for better performance and design flexibility.

/persian/article-fa/nextjs-font-optimization-google-local-self-hosting-performance