All articles

VIBEFIX GUIDES

AI Coding Guides

Practical knowledge for tools, deployment, workflows, and building projects.

Real photo: two baristas working side by side behind a cafe counter, one pouring steamed milk into a white cup, the other operating an espresso machine
Guide
Don't let the main thread carry it all: Web Workers, handing heavy work to another thread

The main thread has to draw the page and do the accounts, so it freezes the moment the work gets heavy. A worker is another thread in another global context, and the two sides talk only through messages. Following MDN's Using Web Workers and Worker docs: new Worker, postMessage and onmessage, structured-clone copying, what a worker can and cannot do, onerror and terminate(), SharedWorker, and transferable zero-copy — with a 100-mistake breakdown from a fictional cafe order page.

Tool TipsFrontend EngineeringLearning & Career
Real photo: a barista in a dark apron pouring steamed milk from a pitcher into a white cup, a heart-shaped latte art pattern forming, an espresso machine behind him
Guide
Don't compute everything up front: JavaScript generators and iterators — function*, yield, and one value at a time

An array has to be computed all at once; a generator hands out one value at a time, only when asked. Following MDN's Iterators and generators, function*, and Generator docs: the next() protocol, function* and yield, for...of consumption, Symbol.iterator, yield* delegation, sending values in with next(x), throw() and return(), and when to use a generator at all — with a 100-mistake breakdown from a fictional cafe order page.

Tool TipsFrontend EngineeringLearning & Career