Skip to content

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Frontend Development

20 min read

Local Inference & Edge AI: Why Front‑End AI Is the Next Battlefield

Edge AI runs AI models directly in browsers or devices, offering zero latency, zero API cost, and full privacy, and the article explains the three technical breakthroughs that make it possible, compares WebLLM, Transformers.js and Ollama, and provides a hybrid architecture with concrete engineering challenges and solutions that can cut total AI costs by 40‑55% for typical front‑end applications.

12 min read

Mastering Pretext: A Practical Frontend Guide for Precise Text Measurement

This article explains how the open‑source Pretext library enables fast, accurate multi‑line text measurement and layout in pure JavaScript/TypeScript, outlines the problems it solves, lists ideal front‑end scenarios, provides step‑by‑step API usage, and warns when the library should be avoided.

10 min read

Boost AI‑Generated UI Consistency with the Awesome DESIGN.md Repository

The article introduces the open‑source VoltAgent/awesome-design‑md GitHub repository, explains how its DESIGN.md markdown design system enables AI‑friendly, zero‑cost reuse of major‑brand UI specifications, outlines its nine core modules, categorizes templates for various product types, and provides step‑by‑step guidance for quick integration into frontend projects.

10 min read

How a Former React Core Engineer’s Pretext Library Solves a 30‑Year‑Old Browser Text Layout Problem

Front‑end developers struggle to measure text height without rendering, causing performance issues in virtual scrolling, chat bubbles, and masonry layouts, but the TypeScript‑based Pretext library bypasses the DOM, uses Canvas measureText, and delivers order‑of‑magnitude speedups while offering line‑level layout APIs.

7 min read

How Pretext Eliminates DOM Reflows for Ultra‑Fast Text Measurement

Pretext, a zero‑DOM, high‑performance text measurement engine created by React core contributor chenglou, uses Canvas‑based calculations and a two‑stage prepare/layout workflow to avoid layout reflows, delivering up to 500× speed gains for virtual scrolling, rich‑text rendering, and AI‑driven UI layout predictions.

6 min read

Master Hugo: Build Fast Static Sites with Real‑World Examples

This guide walks you through using Hugo, a popular static‑site generator, covering typical applications such as documentation, blogs and corporate sites, its core features like live preview, multilingual support and theme management, step‑by‑step installation on Windows, macOS and Linux, and a quick‑start workflow to create, preview and publish a site.

6 min read

How Cheng Lou’s Pretext Library Powers the Viral Bad Apple Text‑Wrap Effect

The article introduces Pretext, a pure JavaScript/TypeScript text‑layout engine that measures and renders text without touching the DOM, claims speed hundreds of times faster than traditional methods, and showcases its use in the viral Bad Apple animation and several interactive demos, while highlighting its AI‑friendly API, tiny footprint, and open‑source impact.

5 min read

Solving the 20‑Year Front‑End Text‑Layout Nightmare with Pretext (10k Stars in One Day)

Pretext, a TypeScript‑based text layout engine, eliminates the need for DOM measurements by using canvas.measureText and Intl.Segmenter, delivering sub‑0.05 ms height calculations, preventing layout thrashing, and simplifying scenarios like chat bubbles, masonry grids, AI interfaces, and virtual lists.