WordPress Developer Ukraine, Kyiv
JavaScript Explicit Resource Management: using and Symbol.dispose

JavaScript Explicit Resource Management: using and Symbol.dispose

Explicit resource management in JavaScript: using and Symbol.dispose Cleanup code is easy to forget on the error path: an event listener that is never removed, an IntersectionObserver that keeps running, a lock that stays taken because an exception jumped over the release(). try/finally solves it, but nested finally blocks for three resources are hard to…
JavaScript Set Methods: union, intersection, difference in ES2025

JavaScript Set Methods: union, intersection, difference in ES2025

Set methods in JavaScript: union, intersection, difference Comparing two lists of IDs is everyday work in admin scripts: which posts are selected but not yet saved, which tags two posts share, which users were added since the last sync. Until recently, every project wrote the same helpers with filter() and includes(). ES2025 added the set…
JavaScript Iterator Helpers: Lazy Transformations on Large Datasets

JavaScript Iterator Helpers: Lazy Transformations on Large Datasets

Iterator helpers: map, filter and take without building arrays array.filter().map().slice( 0, 10 ) is readable, but on a large list it does all the work for every element and builds two full intermediate arrays, only to keep ten items at the end. ES2025’s iterator helpers add map(), filter(), take(), drop(), flatMap() and friends to iterators.…
WordPress Multisite Security: Capabilities, Roles, and Audit Logging

WordPress Multisite Security: Capabilities, Roles, and Audit Logging

Multisite permissions: super admins, site admins and what they can do In a single WordPress site, an administrator can do everything. In a Multisite network, there are two levels: super admins manage the network (themes, plugins, sites, users), site administrators manage their own site but cannot install code or add unfiltered HTML. Misunderstanding these levels…
JavaScript WeakRef and FinalizationRegistry: Memory-Safe Caches

JavaScript WeakRef and FinalizationRegistry: Memory-Safe Caches

WeakRef and FinalizationRegistry: caches that do not leak memory A cache in a long-living admin page (a block editor plugin, a dashboard that runs all day) easily becomes a memory leak: every object put into a Map stays alive as long as the map does, even when nothing else uses it. WeakMap solves this for…
requestIdleCallback and requestAnimationFrame for Non-Blocking JavaScript in WordPress

requestIdleCallback and requestAnimationFrame for Non-Blocking JavaScrip ...

requestAnimationFrame and requestIdleCallback in WordPress scripts The browser has one main thread for JavaScript, layout and painting. A loop that inserts 2,000 table rows, or a scroll handler that reads and writes layout on every event, takes that thread away from everything else, and the page stops reacting. Two scheduling functions help: requestAnimationFrame() runs code…