Home/Categories/Web 开发

Web 开发

Next.js、React、TypeScript、前端工程化

Collection

This collection features articles and community discussions in the Web 开发 space, focusing on real-world engineering scenarios, tool selection, practical paths, and risk boundaries.

The page is continuously updated and serves as a learning roadmap, technology selection reference, and technical review entry point.

@admin·11 min read·Web Development

Next.js Server Actions, In Depth

Server Actions let you write server-side functions directly in components and call them from the frontend like async functions, without API routes. Learn how they work, what 'use server' means, progressive-enhancement form patterns, revalidation, security boundaries, and when to use Route Handlers.

#Next.js #React♥ 1000 comments
@admin·12 min read·Web Development

Web Push Notifications: From Subscription to Delivery

Want to send push notifications to web users without an app? The Web Push API, Service Workers, and push services make it possible. This article explains the full flow (subscription → server push → SW display), VAPID keys, notification permissions and UX, and support in iOS Safari 16.4+.

#React #TypeScript♥ 1020 comments
@admin·11 min read·Web Development

Edge Computing and CDNs: Moving Compute Closer to Users

Users in Asia, servers in the US, and 300 ms of latency? CDNs cache static assets, while Edge Functions run logic at the edge so requests are handled nearby. This article explains CDN caching, Edge Functions (Cloudflare Workers/Vercel Edge), when to move logic from the origin to the edge, and the limits of doing so.

#Next.js #DevOps♥ 1040 comments
@admin·9 min read·Web Development

ORM vs Query Builder vs Raw SQL: How to Choose

ORMs are convenient but may generate bad SQL; raw SQL is flexible but boilerplate-heavy. This article objectively compares the philosophies and fit of Prisma/Drizzle/Kysely/raw SQL: type safety, migrations, N+1, performance, and learning curve, with an opinionated "which project should use which" conclusion.

#TypeScript #DevOps♥ 1050 comments
@admin·11 min read·Web Development

React Error Boundaries and Exception Handling

Does one component throw and blank the screen? Error Boundaries contain crashes locally. Learn Error Boundary usage (class components + getDerivedStateFromError), errors it cannot catch (events, async code, SSR), react-error-boundary, and a complete frontend exception-handling strategy.

#Next.js #React♥ 1060 comments
@admin·12 min read·Web Development

WebAuthn and Passkeys: Passwordless Authentication

Passwords are the largest security vulnerability: weak credentials, reuse, phishing, and leaks. Passkeys use WebAuthn and device biometrics to replace passwords securely and seamlessly. This article explains the public-key model, registration and authentication flows, platform support, and a practical rollout path.

#React #DevOps♥ 1090 comments
@admin·8 min read·Web Development

N+1 Queries: The Hidden Performance Killer in ORMs

One list query plus one query for each of N related records means N+1 queries and can make an endpoint 10x slower. This article explains how ORM lazy loading causes N+1, how to detect it with logs and ORM explain tools, how to fix it with eager loading, include, or joins, and how to prevent it with eager defaults and query reviews.

#TypeScript #DevOps♥ 1100 comments
@admin·9 min read·Web Development

React Suspense and Data Fetching

Suspense makes components waiting for data declarative: instead of manually managing loading state, boundaries show fallbacks automatically. Learn how it works with TanStack Query, streaming SSR with Server Components, boundary design, Error Boundaries, and when imperative async work should not use Suspense.

#Next.js #React♥ 1110 comments
@admin·9 min read·Web Development

Real-Time Web: An In-Depth Comparison of SSE and WebSocket

Choosing between SSE and WebSocket for server push? This article explains their fundamental differences, ideal use cases, proxy and firewall compatibility, connection limits, and provides clear guidance on when to use each.

#Next.js #TypeScript♥ 1130 comments
@admin·12 min read·Web Development

React Context Performance Pitfalls and Optimization

Context is easy to use, but when its value changes, every consumer rerenders. In high-frequency scenarios, that is a performance killer. This article explains Context rerendering, why putting all state into one Context is an anti-pattern, how to split it, and when to switch to Zustand.

#Next.js #React♥ 1160 comments