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

@elumixor/react-message-renderer

v0.2.5

Published

Custom React reconciler that turns JSX (with hooks, state, effects) into a streaming, diff-aware tree of messages. Bring-your-own target.

Readme

@elumixor/react-message-renderer

npm version CI License: ISC

A custom React reconciler that turns JSX (with hooks, state, effects, context) into a tree of messages — and lets you stream those messages into any mutable target.

The reconciler is target-agnostic. To do something useful, pair it with a target package such as @elumixor/react-telegram, or implement your own (Discord, Slack, console, log file, anything where messages can be edited in place).

Why

Most "JSX → X" libraries are transformers — they turn JSX once into a payload. This is a real reconciler: hooks work, state changes trigger re-renders, the diff is committed to the target via mutation primitives. If your target is mutable (an editable Telegram message, a Discord message, a re-printed terminal frame), React's reconciliation maps onto it surprisingly well — and you get streaming UI for free.

Install

bun add @elumixor/react-message-renderer
# or: npm install / pnpm add / yarn add

Peer dependency: react >= 19.

The 30-second tour

import { Message, Renderer, type ElementNode } from "@elumixor/react-message-renderer";
import { useEffect, useState } from "react";

class MyRenderer extends Renderer {
  protected async renderMessages(messageNodes: ElementNode[]) {
    // Called on every (throttled) commit. Send / edit / delete in your target.
    for (const node of messageNodes) {
      console.log("commit:", node);
    }
  }
}

function Counter() {
  const [n, setN] = useState(0);
  useEffect(() => {
    const id = setInterval(() => setN((v) => v + 1), 200);
    return () => clearInterval(id);
  }, []);
  return <Message>Tick {n}</Message>;
}

const r = new MyRenderer({ throttleMs: 800 });
await r.render(<Counter />);

The Renderer base class:

  • Owns the React fiber root and the output tree.
  • Schedules renderMessages(...) calls on a throttle so you don't hammer your target.
  • Flushes on useFinishRender() so your final state always lands.
  • Warns when content is rendered outside <Message> and won't be displayed.

What's in the box

  • Renderer — abstract base; implement renderMessages for your target.
  • Message — root element for a single sendable message; supports repliesTo, linkPreview.
  • LinkPreviewProvider / useLinkPreviewOptions — context-driven link preview opts.
  • FinishRenderProvider / useFinishRender — let the tree signal "we're done" so the renderer can flush + unmount.
  • serialize(node) — generic HTML-like serializer (escapes, renders all built-in element types).
  • ConsoleRenderer — built-in target that prints serialized messages to stdout. Useful for tests.
  • GroupRenderer — fans a single render call out to multiple target renderers in parallel.
  • reconciler — the underlying react-reconciler instance, in case you want to plug in directly.

Built-in JSX intrinsics

<Message>, <b>, <i>, <u>, <s>, <a href>, <code>, <pre>, <blockquote>, <br>, <div>, <p>. They map onto a small typed OutputNode tree your renderer walks.

Target packages

Status

0.x — API is settled enough to use, but expect minor breakage as targets evolve.

License

ISC