
Security News
PHP Foundation Says Chainguard Broke Security Embargo Ahead of Emergency Patches
The PHP Foundation says Chainguard broke a security embargo ahead of critical RCE patches, as leaks disrupted the coordinated release.
use-web-kit
Advanced tools
Zero-dependency, frame-perfect performance toolkit for React 19 and Next.js 15. Global singleton observers, RAF-batched state, and hydration-safe BOM hooks.
14 hooks. Zero dependencies. One philosophy: never let a hook library become the bottleneck in your production application.
use-web-kit replaces naive per-component observer patterns with global singletons, RAF-batched state updates, and React 19 ref callback cleanup. Built for senior engineers shipping enterprise-scale React and Next.js applications.
Most hook libraries create one IntersectionObserver per component, one BroadcastChannel per instance, one addEventListener per render. At scale, these patterns cause measurable performance degradation.
use-web-kit enforces four non-negotiable constraints:
| Constraint | How |
|---|---|
| Zero memory leaks | React 19 ref cleanup, ref-counted singletons, explicit disposal of timers, Blob URLs, and channels |
| O(1) observer cost | Single global IntersectionObserver shared by all components |
| No render thrashing | useReducer for multi-value state, requestAnimationFrame batching for intersection events |
| Perfect SSR hydration | useSyncExternalStore with stable server snapshots for all BOM and storage hooks |
useSmartIntersection -- Global singleton observer with RAF batching and startTransition supportuseIntersection -- Per-instance observer pool with configurable rootMargin and thresholduseMediaControls -- Unidirectional state for <audio> and <video> elementsuseWorkerPool -- Ephemeral Web Worker pool from pure functions via Blob URL serializationuseIdleQueue -- Background task scheduling via requestIdleCallbackuseAdaptivePolling -- Interval polling that adapts to page visibilityuseDebouncedStorage -- Hydration-safe storage with debounced writes and cross-tab syncuseStorage -- Basic localStorage/sessionStorage persistenceuseBroadcastState -- Cross-tab state sharing via ref-counted BroadcastChannel singletonuseEventPipeline -- Composable event processing with AbortController cancellationuseActionPipeline -- FormData processing for React 19 <form action> and Server ActionsuseNetworkStatus -- Online/offline state and Network Information API telemetryusePageLifecycle -- Page visibility, focus, and frozen state trackingusePermission -- Permissions API monitoring with legacy fallbacksimport { useSmartIntersection, useWorkerPool, useDebouncedStorage } from 'use-web-kit';
// Lazy-load images with a single global observer
function LazyImage({ src }: { src: string }) {
const { ref, isIntersecting } = useSmartIntersection({ lowPriority: true });
return <img ref={ref} src={isIntersecting ? src : undefined} />;
}
// Offload computation to a Web Worker
const sort = (arr: number[]) => [...arr].sort((a, b) => a - b);
function SortButton({ data }: { data: number[] }) {
const { run, isRunning } = useWorkerPool(sort, { maxWorkers: 2 });
return (
<button disabled={isRunning} onClick={async () => {
const [promise] = run(data);
console.log(await promise);
}}>
Sort off-thread
</button>
);
}
// Persistent state with instant UI and debounced disk writes
function DraftEditor() {
const { value, setValue, flush } = useDebouncedStorage('draft', '', { debounceMs: 500 });
return <textarea value={value} onChange={e => setValue(e.target.value)} onBlur={flush} />;
}
npm install use-web-kit
src/
bom/ -- useNetworkStatus, usePageLifecycle, usePermission
concurrency/ -- useWorkerPool, useIdleQueue, useAdaptivePolling
dom/ -- useSmartIntersection, useIntersection, useMediaControls
pipelines/ -- useEventPipeline, useActionPipeline
state/ -- useDebouncedStorage, useStorage, useBroadcastState
core/ -- shared TypeScript interfaces
See CONTRIBUTING.md.
MIT
FAQs
A zero-cost performance toolkit for React 19. Global singletons, RAF-batched updates, and perfect hydration without external dependencies.
The npm package use-web-kit receives a total of 0 weekly downloads. As such, use-web-kit popularity was classified as not popular.
We found that use-web-kit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
The PHP Foundation says Chainguard broke a security embargo ahead of critical RCE patches, as leaks disrupted the coordinated release.

Security News
PHP releases emergency patches for two critical RCE vulnerabilities as agencies urge organizations to take unpatched sites offline.

Threat Research
/Security News
A supply chain attack compromised LiteLLM 1.107.0 on PyPI and Docker, spreading malware that steals cloud credentials, developer secrets, and AI provider keys.