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·10 min read·Web Development

TypeScript Asynchronous Programming and Iterators

Async/await is only the beginning. Advanced features such as for await...of, AsyncIterator, and generators handle streaming data elegantly. This article covers Promise combinators, async iterators, generators, AbortController cancellation, and concurrency control with p-limit, making JS/TS async code elegant and controllable.

#AI #TypeScript♥ 560 comments
@admin·12 min read·Web Development

REST API Pagination Design: Offset vs. Cursor

Pagination looks simple, but a poor design becomes slow, skips records, and eventually stops paging. This article compares offset pagination—simple but vulnerable to performance and consistency problems—with cursor pagination—fast and stable but more complex—then covers use cases, infinite scroll, and metadata such as total, hasMore, and cursor.

#TypeScript #DevOps♥ 580 comments
@admin·12 min read·Web Development

React Testing Strategy: From Unit Tests to E2E

React testing is not about testing everything; it is about testing the right things. Learn the React testing pyramid, what to unit-test, component-test, and cover with E2E, how to choose Vitest, Testing Library, and Playwright, and why behavior matters more than implementation.

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

CSS Architecture Patterns: BEM, CSS Modules, and CSS-in-JS

CSS gets messy at scale: naming collisions, global pollution, specificity wars. This article clarifies the mainstream CSS architecture patterns: BEM (naming conventions), CSS Modules (local scoping), CSS-in-JS (styled-components/emotion), and the rise of Tailwind/atomic CSS, with guidance on when and how to choose.

#React #TypeScript♥ 610 comments
@admin·10 min read·Web Development

WebSocket and Real-Time Web Applications

Chat, collaboration, push notifications, and real-time dashboards need server-initiated delivery, which HTTP handles poorly. This article explains WebSocket fundamentals, when to use it versus SSE or polling, connection management, broadcasts and rooms, Redis Pub/Sub scaling across instances, and common real-time architecture choices.

#Next.js #TypeScript♥ 640 comments
@admin·15 min read·Web Development

SSO and OAuth 2.0 in Practice

Authentication and authorization underpin every product, yet many developers remain unclear about how OAuth, OIDC, JWT, and sessions relate. This article explains sessions vs. JWTs, OAuth 2.0 flows, OIDC's authentication layer, SSO implementation, token storage, and security so the concepts no longer feel tangled.

#React #DevOps♥ 670 comments
@admin·11 min read·Web Development

GraphQL Production Practices and Pitfalls

GraphQL is flexible and powerful, but production brings pitfalls: N+1 queries, complex-query attacks, difficult caching, and overly coarse authorization. This article covers DataLoader, depth and complexity limits, persisted queries, caching strategies, and field-level authorization.

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

REST API Versioning Strategies

APIs inevitably become hard to change. How can they evolve without breaking existing clients? This article explains URL path, header, query parameter, and content-negotiation versioning; their tradeoffs; when breaking changes are necessary; deprecation strategies; and a practical "forward compatibility first, major versions when necessary" approach.

#TypeScript #DevOps♥ 730 comments