npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mana-ts

v1.0.7

Published

A high-performance, O(1) reactive state engine and type-governance ecosystem for deeply nested trees.

Readme

⚡ mana-ts

Fine-grained, $\mathcal{O}(1)$ reactivity loops built directly inside standard React.

mana-ts is a high-performance state and rendering engine that brings SolidJS-style, surgical DOM updates straight into your React application. It completely cuts out the Virtual DOM bottleneck for high-frequency state updates (60Hz telemetry, real-time tracking, mouse dragging vectors, canvas data feeds) while allowing your parent components to remain completely static.

npm version bundle size License: MIT


🛑 The Problem with Standard React

When a state value changes in standard React, it forces a top-down virtual DOM reconciliation loop. If you are updating a telemetry coordinate 60 times a second, React diffs your entire component tree. This results in dropped frames, visual stuttering, UI lag, and massive garbage collection strain.

Putting high-frequency streams into global state managers like Redux or Zustand only spreads this lag across your whole layout.

🚀 The Mana Solution

mana-ts implements a low-level, type-safe pub-sub dependency graph. Your parent dashboard container renders exactly once and remains completely frozen.

When a sub-property shifts, it bypasses React's virtual DOM reconciliation entirely and updates only the specific HTML text nodes, styles, or canvas pixels tied to that exact key.


💻 Quick Start

1. Installation

npm install mana-ts

2. Instantiate Your Mapped State Container

Create state objects using ObjectState or ArrayState. These act as fine-grained data envelopes that do not trigger React re-renders automatically.

import { Manager } from 'mana-ts';
import ObjectState = Manager.ObjectState;

interface Aircraft {
  id: string;
  lat: number;
  lon: number;
  altitude: number;
}

// Instantiate an isolated state manager
const flightTracker = new ObjectState<Aircraft>({
  id: "flight-777",
  lat: 32.7767,
  lon: -96.7970,
  altitude: 35000
});

3. Surgical Rendering via <MultiDyn />

Wrap your performance-critical UI elements inside <MultiDyn />. Pass it an array of dependencies using .dep(). The component accepts a render prop function (val) that stays completely dormant until the observed keys change.

import React, { useId } from 'react';
import { MultiDyn } from 'mana-ts';

export function RadarScreen() {
  const uniqueId = useId();

  return (
    <div className="radar-container">
      {/* The parent container never re-renders when the flight moves! */}
      <h1>Live Radar Feed</h1>
      
      <MultiDyn 
        dep={[flightTracker.dep("lat"), flightTracker.dep("lon"), flightTracker.dep("altitude")]}
        val={(lat, lon, altitude) => (
          <div 
            className="aircraft-blip" 
            style={{ transform: `translate(${lon * 10}px, ${lat * 10}px)` }}
          >
            ✈️ Flight 777 ({altitude} ft)
          </div>
        )}
        eventKey={uniqueId}
      />
    </div>
  );
}

4. Push High-Frequency Updates Seamlessly

Update the state properties natively at 60Hz. Updates run in strict constant $\mathcal{O}(1)$ time execution loops.

// Bypasses React's Virtual DOM loop entirely.
// Fires localized DOM node mutations instantly.
setInterval(() => {
  const currentAlt = flightTracker.getValue("altitude");
  flightTracker.set("altitude", currentAlt + 10);
}, 16); // ~60 FPS animation loop

🎯 Advanced Features

⚡ <CondMemo /> — Visual Layout Buffering

When dealing with massive datasets, you might want to skip UI refreshes unless structural layout parameters change. <CondMemo /> adds an inline validation barrier to your rendering loops:

import { CondMemo } from 'mana-ts';
import _ from 'lodash';

<CondMemo 
  dep={[mapData.dep("tiles")]}
  diff={(next, prev) => !_.isEqual(next, prev)} // Skip frames if values remain functionally identical
  val={(tiles) => <BackgroundGrid maps={tiles} />}
/>

🔒 Built-in Memory Leak Protection

Manual pub-sub architectures are highly vulnerable to memory leaks if a developer forgets to unsubscribe a dead layout element. mana-ts handles this automatically.

Hooks like useDep, useMultiVal, and useRawDepMonitor tie subscription lifecycles directly into React's component mounting trees. The exact millisecond an element unmounts or leaves the screen, its internal callbacks trigger automatic un-subscription routines, instantly cleaning up your application's memory footprint.


⚙️ Core Architecture Blueprint

                      ┌─────────────────────────────────┐
                      │    Your Standard React App      │
                      │  (Renders exactly once: Static) │
                      └────────────────┬────────────────┘
                                       │
                          Mounts dynamic leaf boundaries
                                       ▼
                      ┌─────────────────────────────────┐
                      │       mana-ts <MultiDyn />      │
                      │  (Isolated Local Hook Handlers) │
                      └────────────────┬────────────────┘
                                       │
                      Intercepts high-frequency raw updates
                                       ▼
            ┌───────────────────────────────────────────────────────┐
            │       Surgical Browser DOM In-Place Mutation          │
            │  (Updates only the affected innerText / style nodes)  │
            └───────────────────────────────────────────────────────┘

⚖️ License

MIT © Bryce Gredig (The64bitdude)