Skip to content
StackPractices

frontend

Practical resources about frontend for software engineers.

63 results

Building Fast and Accessible User Interfaces

Frontend development is more than component libraries. Performance budgets, accessibility compliance, state management, and progressive enhancement determine whether users stay or leave.

This topic covers patterns for web components, state management strategies, accessibility audits with WCAG, and performance optimization techniques. Resources include both framework-agnostic principles and specific implementations for modern stacks.

intermediate

Express.js Middleware Composition Patterns

Build maintainable Express applications using middleware composition patterns for authentication, validation, error handling, request context propagation, and async route wrappers

intermediate

Server-Sent Events with Node.js and Express

Implement real-time server-to-client push using Server-Sent Events in Node.js with Express, covering connection management, event types, reconnection logic, and backpressure handling

intermediate

Build a Bidirectional Chat with WebSocket and Node.js

How to build a real-time bidirectional chat application using WebSocket with room-based messaging, presence tracking, and message persistence

beginner

Deep Clone Objects in JavaScript: Beyond JSON.parse

Compare deep clone strategies including JSON.parse, structuredClone, manual recursion, and library approaches for copying nested objects with circular references and special types

intermediate

Prevent Race Conditions in JavaScript Async Code

Identify and fix race conditions in asynchronous JavaScript using proper sequencing, atomic operations, locks, and Promise patterns for predictable concurrent execution

beginner

URL Encoding and Decoding

Master URL encoding in JavaScript and other languages with encodeURI, encodeURIComponent, plus-safe handling, RFC 3986 compliance, and decoding edge cases

intermediate

Container Queries for Component Responsiveness

How to use CSS container queries for component-level responsive layouts that adapt to their container size instead of the viewport.

intermediate

Design Tokens with CSS Custom Properties

How to build a design token system using CSS custom properties, including color scales, spacing, typography, themes, and responsive scaling.

intermediate

Dark Mode with prefers-color-scheme and CSS Variables

How to implement dark mode using CSS prefers-color-scheme media query, CSS custom properties, and manual toggle with localStorage persistence.

beginner

Build Responsive Email Templates with MJML

Create cross-client responsive email templates using MJML markup, live Handlebars variables, and inline CSS for reliable rendering across Gmail, Outlook, and Apple Mail

beginner

JavaScript Clipboard Copy and Paste

Copy text to clipboard programmatically in JavaScript with fallback

intermediate

Debounce and Throttle Functions in JavaScript

Control function execution rate with debounce and throttle. Covers leading/trailing edge, cancelable timers, and real-world use cases.

intermediate

JavaScript Event Loop

Understand how the JavaScript event loop works internally and how to write non-blocking code.

intermediate

JavaScript Infinite Scroll Pagination with

Implement scroll-based data loading in JavaScript with IntersectionObserver

beginner

JavaScript LocalStorage with TTL Expiration

Store data with TTL expiration in browser localStorage

intermediate

JavaScript Service Worker Offline Caching for PWA

Cache assets for offline PWA support with Service Workers and Cache API

intermediate

Form Validation with react-hook-form and Zod

How to build type-safe forms in React using react-hook-form with Zod schema validation, including nested fields, async validation, and dynamic fields.

intermediate

When to Use useMemo and useCallback

How and when to use React's useMemo and useCallback hooks for performance optimization, and when they add unnecessary overhead.

intermediate

Virtualize Long Lists with react-window

How to render large lists efficiently in React using react-window for DOM virtualization, including fixed and variable height rows and grid layouts.

intermediate

Server-Side Rendering

Improve performance and SEO with server-side rendering using Next.js, Nuxt, Astro, and other frameworks with hydration strategies.

intermediate

Reactive State Management with Svelte Stores

How to manage reactive state in Svelte using writable, readable, derived stores, and custom stores with contract-based updates.

intermediate

Exhaustive Type Checking with Discriminated Unions

How to use TypeScript discriminated unions for exhaustive type checking, ensuring all cases are handled at compile time with never type assertions.

advanced

Build Reusable Utility Types with Generics

How to create reusable TypeScript utility types using conditional types, mapped types, template literals, and generic constraints for type-safe APIs.

intermediate

Data Fetching with Vue 3 Composition API

How to fetch and manage data in Vue 3 using the Composition API with ref, computed, watch, and composables for reusable data logic.

intermediate

WebSockets for Real-Time Communication

Build bidirectional real-time communication with WebSockets, handling connection management, reconnection, and fallbacks.

beginner

Enable Brotli Compression in Nginx for Faster Asset Delivery

How to configure Brotli compression in Nginx to reduce transfer sizes for JavaScript, CSS, and HTML assets with better ratios than Gzip

intermediate

SPA Performance: Code Splitting and Lazy Loading

Improve single-page application load times by splitting bundles at route and component level, implementing lazy loading with React.lazy and live imports

intermediate

Abstract Factory for Cross-Platform UI Component Families

Create families of related objects without specifying concrete classes, enabling platform-specific implementations that share a common interface

intermediate

Bridge Pattern for Decoupling UI Components from Themes

Separate an abstraction from its implementation so both can vary independently using the Bridge pattern for pluggable UI themes and rendering engines

intermediate

Composite Pattern for UI Component Trees in React

Use the Composite pattern to compose objects into tree structures, letting clients treat individual objects and compositions uniformly in UI component hierarchies

intermediate

Mediator Pattern for Loose Component Coupling in

Reduce chaotic dependencies between UI components by introducing a mediator that centralizes communication, preventing explicit references between peers

beginner

MVC Pattern in Modern Frontend Applications

Apply the Model-View-Controller pattern to React and Vue applications to separate data, UI, and interaction logic for maintainable component architecture

beginner

Static Content Hosting Pattern

Deploy static files to a dedicated content delivery network or object storage to offload origin servers, reduce latency, and improve availability for assets like images, CSS, and JavaScript.

intermediate

Container-Presenter: Separate Data Logic from Rendering

How to separate data-fetching logic from rendering in React using the container-presenter pattern. Covers hooks migration, testing benefits, and trade-offs.

intermediate

CSS Architecture: Utility-First with Component-Scoped Layers

How to organize CSS with utility-first classes and component-scoped layers. Covers Tailwind CSS, CSS layers, BEM, CSS modules, and design tokens.

intermediate

Custom Hook Composition

How to compose reusable logic with custom React hooks. Covers hook composition patterns, dependency arrays, context integration, and testing strategies.

advanced

Islands Architecture

How to ship interactivity only where needed using islands architecture. Covers Astro islands, partial hydration, React islands, and performance benefits.

intermediate

Optimistic Update: Update UI Immediately, Reconcile on

How to update UI immediately and reconcile on server response in React. Covers rollback on error, conflict resolution, and React Query integration.

intermediate

Progressive Enhancement

How to build a functional HTML baseline and progressively enhance with JavaScript. Covers core functionality, feature detection, graceful degradation, and accessibility.

advanced

State Machine UI: Finite State Machines for UI

How to model UI state transitions with finite state machines in React. Covers XState, statecharts, guarded transitions, and preventing impossible states.

advanced

Suspense Boundary: Declarative Loading States with React

How to use React Suspense boundaries for declarative loading states. Covers data fetching, streaming SSR, nested boundaries, and error boundaries.

intermediate

Core Web Vitals Audit Checklist

Checklist for auditing Core Web Vitals per page: LCP optimization steps, INP interaction tuning, CLS layout stability fixes, field data vs lab data analysis, CrUX integration, and remediation tracking with code examples for images, fonts, JavaScript, and CSS.

intermediate

Performance Budget Template

Template for defining and enforcing web performance budgets: LCP, INP, CLS targets, resource budgets for JS, CSS, images, fonts, third-party scripts, CI/CD integration with Lighthouse CI, and alerting thresholds with examples for Next.js, Astro, and SPA architectures.

intermediate

Feature Flags: Progressive Release and Safe Experimentation

A practical guide to feature flags: implementation patterns, progressive rollouts, kill switches, A/B testing integration, and managing feature flag lifecycle at scale.

intermediate

WCAG 2.2 Accessibility: A Developer Guide

A practical guide to WCAG 2.2 compliance: perceivable, operable, understandable, and reliable principles with code examples for web accessibility.

intermediate

Complete Guide to Web Accessibility: WCAG 2.2 Compliance

Master web accessibility with WCAG 2.2: ARIA roles, keyboard navigation, screen reader support, color contrast, focus management, and accessible forms.

advanced

Complete Guide to Bundle Size Optimization

Reduce JavaScript bundle size. Covers tree shaking, code splitting, dynamic imports, dependency analysis, module federation, lazy loading, compression, polyfill management, and bundle monitoring with practical webpack, Vite, and Rollup examples.

intermediate

Complete Guide to CSS Grid and Flexbox

Master modern CSS layout with Grid and Flexbox. Covers grid templates, areas, subgrid, responsive layouts, flexbox alignment, wrapping, gap, container queries, and when to use Grid vs Flexbox with practical examples and patterns.

intermediate

CSS Modern Layout: Grid, Flexbox, Container Queries

Master modern CSS layout: CSS Grid, Flexbox, container queries, subgrid, logical properties, and responsive design patterns without media queries.

intermediate

Complete Guide to Mobile Responsive Design

Build responsive layouts that work on every device. Covers CSS Grid, Flexbox, container queries, fluid typography, mobile-first breakpoints, and responsive images.

advanced

Complete Guide to React 19 Features

Master React 19 features. Covers server components, use() hook, actions, form actions, useActionState, useOptimistic, useFormStatus, ref as prop, document metadata, asset loading, and React Compiler with practical code examples.

intermediate

Complete Guide to React Performance Optimization

Optimize React apps for speed. Covers memoization, virtualization, code splitting, bundle analysis, React Profiler, concurrent features, and Core Web Vitals.

advanced

Complete Guide to React Server Components: RSC Architecture

Master React Server Components: RSC architecture, data loading, streaming, server actions, and client component boundaries in Next.js App Router.

intermediate

React State Management: Context, Zustand, TanStack Query

Master React state management: Context API, Zustand, Jotai, and TanStack Query for server state. Covers patterns, persistence, optimistic updates, and when to use each.

advanced

Complete Guide to TypeScript Advanced Types

Master TypeScript advanced types: conditional types, mapped types, template literal types, infer, distributive types, and type-level programming patterns.

advanced

Complete Guide to Web Performance and Core Web Vitals

Optimize Core Web Vitals. Covers LCP, INP, CLS measurement and improvement, image optimization, font loading, render-blocking resources, lazy loading, caching strategies, and performance monitoring with practical code examples.

intermediate

Progressive Web Apps (PWA) — Complete Guide

A thorough guide to building Progressive Web Apps: service workers, offline support, Web App Manifest, push notifications, and installability.

intermediate

Web Components — Custom Elements, Shadow DOM & Templates

A practical guide to Web Components: creating reusable custom elements, encapsulating styles with Shadow DOM, and composing with HTML templates.

advanced

Content Security Policy: CSP Headers, Nonces, Hashes

Master Content Security Policy: CSP directives, nonces, hashes, reporting, strict-dynamic, nonce-based CSP, hash-based CSP, and production deployment patterns for web security.

intermediate

CORS Security: Origins, Headers, Preflight, Credentials

Master CORS security: same-origin policy, CORS headers, preflight requests, credential handling, common misconfigurations, and production security patterns for web APIs.

intermediate

Complete Guide to Web Security Headers

Implement CSP, HSTS, X-Frame-Options, and secure headers. Covers content security policy, CORS, referrer policy, permissions policy, and testing with security scanners.

intermediate

OWASP Top 10: Explained with Mitigations

A developer-focused guide to the OWASP Top 10 security risks: how each vulnerability works, real-world examples, and practical mitigations for web applications.

intermediate

Vitest for React: Component, Hook, and Integration Testing

Master Vitest for React testing: component tests with Testing Library, hook tests with renderHook, integration tests, mocking, snapshot testing, and parallel execution.