Hadi Mobarra

Notes

Short and unpolished: one thing I found out, usually with a link. RSS for notes

No chart tool mirrored by default

A peer-reviewed study tested seven popular chart tools with Arabic data and interviewed eleven practitioners. None of the tools produced a mirrored chart by default, and Eastern numerals were often read as text. Designing Within the Lines is worth reading if you build dashboards.

Font preloading works per CSS chunk

Two root layouts, one next/font each, and the build merged their CSS. Result: every English page preloaded the Persian fonts, and the other way around. Nothing in the code looks wrong. The network panel shows it at once.

Next.js metadata replaces, it doesn't merge

Set openGraph in a page and you lose the layout's social image. Set alternates and you lose the RSS link. And a page that sets neither inherits the layout's canonical URL, so my blog index told search engines it was the homepage. One function that returns everything fixed all three.

Two Pagefind instances share one memory

Persian pages here search a Persian and an English index. Creating two instances from one Pagefind bundle made the Persian search fail in 8 of 15 test runs: they share one WebAssembly state. Building two separate bundles, one per language, passed 30 of 30.

Yielding is not a frame

await scheduler.yield() lets the browser do something else. It doesn't promise that the something is a paint. In a demo that only yielded, the next frame came after all the work, 435 ms later. Wait for requestAnimationFrame first, then yield.