前端开发

Webpack Plugin to Auto-Rename Variables

I previously built a webpack loader called domain-replace-loader to replace domains in frontend JS, e.g., swapping to a new domain or a global window property, avoiding manual edits across repos. Sometimes the requirement isn’t about domains. A colleague recently asked to rename variables in code automatically. For example, rename T_PROJECT to P_PROJECT. I updated the plugin to support automatic variable renaming.

Feb 14, 2025

Add Global Constants to a Frontend Project

Expose config from package.json into the built app via webpack DefinePlugin, with typing in TS and pitfalls to avoid.

Jan 25, 2022

Dockerizing Frontend Build and Deployment

Make frontend build/package/deploy reproducible with Docker and docker-compose: images, services, reverse proxy, TLS, and tips.

Sep 5, 2021

Frontend Code Security

Ways to raise the barrier against source theft: build modes, minification, hashing, obfuscation, and more.

Mar 12, 2021

Optimize Table Performance in Frontend

Using virtualized tables for large datasets (hundreds of rows), with notes on DOM complexity and profiling.

Jan 18, 2021

Frontend Storage Options

Browser storage choices (cookie, sessionStorage, localStorage, IndexedDB), differences, and when to use which.

Jan 10, 2021

Frontend Basics — P2

Frontend fundamentals: MVC/MVP/MVVM, how browsers work, React Fiber, and how Redux triggers updates.

Dec 27, 2020

Frontend Basics — P1

Notes from frontend interview questions to reinforce fundamentals: TCP handshake, number precision, storage, hoisting, etc.

Dec 27, 2020

Understanding Error Boundaries

React Error Boundaries: what they solve (UI exceptions), what they don’t (non-UI errors), and how to use them in practice.

Oct 4, 2020

Governing the Frontend API Layer

From ad‑hoc exported functions to an OO API layer with clear namespaces, shared base paths, and naming conventions.

Oct 16, 2019