Programming

Programming

Exploring Various Coding Languages

Programming LanguagesSoftware DevelopmentAlgorithms and Data StructuresSoftware EngineeringWeb and Mobile Programming

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

nextjs-font-optimization-next-font-google-local-tailwind

Fonts are the outfit of your page — and next/font makes them fast, secure, and beautiful. With automatic optimization, zero external requests, and no layout shift, next/font lets you load Google or local fonts with ease. This article shows how to use next/font with Tailwind CSS, organize font definitions, preload fonts, and follow best practices.

/persian/article-fa/nextjs-font-optimization-next-font-google-local-tailwind

default.js in Next.js — Graceful Fallbacks for Parallel and Dynamic Routes

In Next.js, the default.js file provides a fallback for Parallel Routes when the active state of a slot cannot be recovered after a full-page load. This article explains how to use default.js, access dynamic route parameters, handle catch-all segments, and generate static paths with generateStaticParams.

/persian/article-fa/nextjs-parallel-routes-default-js-dynamic-segments-catch-all

Managing Errors, Forbidden Access, and Observability in Next.js — Graceful Recovery and Smart Monitoring

nextjs-error-boundary-global-error-forbidden-instrumentation-observability

/persian/article-fa/Managing Errors, Forbidden Access, and Observability in Next.js — Graceful Recovery and Smart Monitoring

instrumentation-client.js and Intercepting Routes in Next.js — Early Monitoring and Smart Navigation

The instrumentation-client.js file in Next.js lets you run monitoring, analytics, and polyfills before your app becomes interactive. Combined with Intercepting Routes, you can display content like modals without changing the page context. This article explains how to use both features with practical examples.

/persian/article-fa/nextjs-instrumentation-client-intercepting-routes-performance-monitoring-modal-navigation

layout.js in Next.js — Structuring Pages with Flexibility and Intelligence

The layout.js file in Next.js defines the structure of your pages. Layouts can be local or root-level and receive props like children and params. This article explains how to use layouts, handle dynamic parameters, integrate with Client Components, and optimize performance through caching and reusability.

/persian/article-fa/nextjs-layout-root-layout-dynamic-params-client-components

loading.js and not-found.js in Next.js — Streaming UI, Instant Feedback, and Graceful 404s

Next.js supports streaming UI with React Suspense using loading.js, and provides graceful error handling with not-found.js and global-not-found.js.. This article explains how to create instant loading states, define custom 404 pages, and optimize user experience and SEO with these special files.

/persian/article-fa/nextjs-loading-not-found-global-not-found-suspense-streaming-ui

page.js in Next.js — Building Dynamic Pages with Route and Search Parameters

The page.js file in Next.js defines the unique UI for a route. It can receive dynamic route parameters (params) and query string parameters (searchParams), and is a Server Component by default. This article explains how to use page.js to build dynamic, filterable, and personalized pages.

/persian/article-fa/nextjs-page-dynamic-params-searchparams-client-server-components

Parallel Routes in Next.js — Rendering Dynamic Pages with Named Slots

Parallel Routes in Next.js allow you to render multiple pages simultaneously or conditionally within the same layout. This is ideal for dynamic sections like dashboards, modals, and tabbed interfaces. This article explains how to define named slots, use default.js for fallbacks, manage modals with intercepting routes, and build independent tab groups.

/persian/article-fa/nextjs-parallel-routes-slots-default-modal-tabs-conditional-layout

proxy.ts in Next.js — The Silent Guardian at the Edge

The proxy.ts file in Next.js replaces middleware.ts and acts as an edge-level gatekeeper before your app renders. It can rewrite or redirect routes, set headers and cookies, block access, and run background tasks. This article explains how to use proxy.ts, define precise matchers, and implement real-world scenarios like authentication, A/B testing, CORS, and geo-based redirects.

/persian/article-fa/nextjs-proxy-edge-redirect-auth-cors-security-headers

The public Folder in Next.js — Serving Static Files with Direct Paths

The public folder in Next.js is used to serve static files like images, fonts, and text documents. Files placed in this folder are accessible via direct URLs and can be rendered in the browser without special imports. This article explains how to use the public folder, display images, and understand its caching behavior.

/persian/article-fa/nextjs-public-folder-static-assets-image-serving-cache-control

template.tsx in Next.js — Resetting Client State with Unique Keys

The template.tsx file in Next.js behaves like a layout but remounts on every navigation due to its unique key. Unlike layouts that persist across routes, templates reset the state of child Client Components, re-run effects like useEffect, and show Suspense fallbacks on every route change. This makes them ideal for input resets, effect resynchronization, and dynamic UI transitions.

/persian/article-fa/nextjs-template-component-remount-reset-client-state-navigation-key

unauthorized.tsx in Next.js — Custom 401 UI for Unauthenticated Access

The unauthorized.tsx file in Next.js is an experimental feature used to render a custom UI when the unauthorized() function is called during authentication. It allows you to display a login prompt or message for unauthenticated users, and automatically returns a 401 status code. This article explains how to use unauthorized.tsx to improve user experience during access control.

/persian/article-fa/nextjs-unauthorized-component-authentication-401-login-ui
Programming | دکتر شاهین صیامی