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

@aurumjs/rendering

v0.10.2

Published

Renderer-independent component model and rendering primitives for Aurum

Readme

@aurumjs/rendering

The component model and renderer-facing primitives for Aurum. Its JSX factory accepts components but deliberately exposes no implicit intrinsic tags.

Renderable recursively describes primitives, nested arrays, promises, scalar sources, collection sources, and element models. Component prerender results are generic, allowing renderer extensions to declare their native intermediate model without falling back to any. Browser node types and the DOM marker runtime live in @aurumjs/html, not this package.

Custom rendering hosts

renderToTree evaluates Aurum components into a persistent, host-neutral RenderTree. Reactive values update that tree in place, collection entries retain identity across incremental mutations, and onPatch reports inserts, removals, moves, text changes, and property changes.

import { renderToTree } from '@aurumjs/rendering';

const tree = renderToTree(application, { cancellationToken: lifetime });
tree.onPatch.subscribe((patch) => terminalRenderer.apply(patch), lifetime);

Extensions that already expose host mutation primitives can implement RendererHost<Node> and use renderToHost. The core renderer owns component evaluation, reactive subscriptions, promises, and subtree disposal; the host only creates and mutates its native nodes.

Properties remain host-neutral values. Renderer packages can provide resolveProperty to normalize concepts such as HTML classes and styles without introducing those semantics into the component renderer.

Component handles

For imperative APIs that need to return values, a component can explicitly expose a typed public contract. Handles are populated after attachment and cleared automatically on detach; ordinary state and one-way commands should continue to use streams.

interface EditorHandle {
    focus(): void;
    getSelection(): string;
}

const editor = createComponentHandle<EditorHandle>();

function Editor(props: { handle: ComponentHandle<EditorHandle> }, children, api: AurumComponentAPI) {
    let input!: HTMLTextAreaElement;
    api.expose(props.handle, {
        focus: () => input.focus(),
        getSelection: () => input.value
    });
    return <textarea onAttach={(node) => (input = node)} />;
}

const editorAPI = await editor.awaitValue(cancellationToken);
editorAPI.focus();

Developer-tool graph

In an Aurum debug build, component evaluations are registered as inspectable instances. Parent/child component edges and links from reactive sources to render ranges are removed with the same cancellation scopes that own the rendered content. Production builds omit these renderer-level records while retaining the lightweight source graph supplied by @aurumjs/streams.

Custom hosts built with renderToTree or renderToHost receive this behavior automatically. A renderer with its own mutation loop can call registerAurumRenderBinding to associate a source with its native output.