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

@shapeshift-labs/frontier-dom

v0.1.0

Published

Patch-native DOM and host rendering primitives for Frontier state sources.

Readme

@shapeshift-labs/frontier-dom

Patch-native DOM and host rendering primitives for Frontier state sources.

This package owns the host-neutral patch binding runtime, DOM binding table, manifest hydration, JSX manifest helpers, an optional TSX compiler, focused fuzzers, and package-local benchmarks for the rendering experiment. DOM-free virtualization lives in @shapeshift-labs/frontier-virtual. Competitor comparisons live in root benchmark artifacts, not this README.

Related Packages

The published Frontier package family is generated from one shared package catalog so READMEs stay in sync across packages:

Package source repositories:

Install

npm install @shapeshift-labs/frontier-dom @shapeshift-labs/frontier-state

Current Surface

import { createDomRenderer, fromStateEngine } from '@shapeshift-labs/frontier-dom';

const renderer = createDomRenderer({ source: fromStateEngine(state) });

renderer.text('/user/name', nameNode);
renderer.prop('/todos/0/done', checkbox, 'checked');
renderer.each('/todos/*', {
  container: list,
  keyBy: 'id',
  fields: ['text', 'done'],
  create(row) {
    const item = document.createElement('li');
    item.textContent = String(row?.text ?? '');
    return item;
  },
  update(node, row) {
    node.textContent = String(row?.text ?? '');
  }
});

renderer.when('/session/userId', {
  container: sessionSlot,
  create() {
    return renderSignedInPanel();
  },
  fallback: {
    create() {
      return renderSignedOutPanel();
    }
  }
});

Durable DOM state should use a serializable manifest plus an app registry for local functions:

import { hydrateDomRenderer } from '@shapeshift-labs/frontier-dom';

hydrateDomRenderer({
  source: fromStateEngine(state),
  target: document.getElementById('app'),
  manifest: {
    version: 1,
    source: { kind: 'state', basis: state.getBasis() },
    bindings: [
      { id: 'b:user', kind: 'text', path: '/user/name', target: { anchor: 'user-name' } },
      {
        id: 'b:session',
        kind: 'when',
        path: '/session/userId',
        target: { anchor: 'session-slot' },
        template: 'signed-in.v1',
        fallbackTemplate: 'signed-out.v1'
      },
      {
        id: 'b:todos',
        kind: 'each',
        path: '/todos/*',
        fields: ['text', 'done'],
        keyBy: 'id',
        container: { anchor: 'todos' },
        template: 'todo-row.v1'
      },
      { id: 'a:add', kind: 'event', event: 'click', action: 'todo.add', target: { anchor: 'add-todo' } }
    ]
  },
  templates: {
    'todo-row.v1': {
      create(todo) {
        const item = document.createElement('li');
        item.textContent = String(todo?.text ?? '');
        return item;
      }
    }
  },
  actions: {
    'todo.add': ({ source }) => {
      const todos = (source.get() as any)?.todos ?? [];
      source.commitPatch?.([[6, ['todos'], todos.length, 0, [{ id: 'new', text: 'New todo', done: false }]]]);
    }
  },
  actionRegistry: actions
});

actionRegistry is structural, so it can be a @shapeshift-labs/frontier-mutation action registry or an app-owned adapter with the same dispatch(actionId, input, options) method. Manifest events use local actions first, then fall back to the registry:

import { createActionRegistry } from '@shapeshift-labs/frontier-mutation';

const actions = createActionRegistry({ state: fromStateEngine(state), actor: 'local-user' });

actions.register({
  id: 'todo.toggle',
  reads: ['/todos/*/done'],
  writes: ['/todos/*/done'],
  run(ctx, input) {
    const todo = ctx.query('/todos/*', { id: input.payload.id });
    if (todo) ctx.commit([[0, ['todos', todo.index, 'done'], !todo.value.done]]);
  }
});

The same patch graph can drive non-DOM hosts through ./core:

import { createPatchRenderer, fromStateEngine, syncPatchScheduler } from '@shapeshift-labs/frontier-dom/core';

const bridge = createPatchRenderer({
  source: fromStateEngine(state),
  scheduler: syncPatchScheduler
});

bridge.bind({
  path: '/player/position',
  apply({ value }) {
    playerSprite.position.set(value.x, value.y);
  }
});

createDomSchedulerFromRuntime() and createPatchSchedulerFromRuntime() adapt any structural work scheduler into the renderer flush scheduler. That lets DOM and non-DOM host updates share action, cache, logging, and game-loop lanes without making frontier-dom import the scheduler package.

JSX helpers are available from ./jsx-runtime; they create real DOM nodes with data-frontier-* metadata and createJsxManifest() turns that metadata into the same manifest shape. Build-time TSX compilation is available from ./compiler:

import { compileFrontierJsx } from '@shapeshift-labs/frontier-dom/compiler';

const compiled = await compileFrontierJsx(`
  const view = (
    <main frId="app">
      <span frId="name" $text="/user/name" />
      {virtualEach("/messages/*", {
        frId: "messages",
        keyBy: "id",
        template: "message-row.v1",
        viewport: { offset: 0, size: 640 },
        layout: textLayout({ field: "body", font: "14px Inter", lineHeight: 20, width: 420 }),
        overscan: 8
      })}
    </main>
  );
`);

compiled.html;
compiled.manifest;

Render trace events can be sent to Frontier logging through ./logging:

import { createRenderLogSink } from '@shapeshift-labs/frontier-dom/logging';

createDomRenderer({
  source: fromStateEngine(state),
  trace: createRenderLogSink(logger)
});

First-class range/materialization lives in @shapeshift-labs/frontier-virtual, a DOM-free package shared by DOM renderers, canvas/WebGL hosts, and game cameras:

import { createFixedLayout, virtualize, virtualizeFrustum } from '@shapeshift-labs/frontier-virtual';

const visibleRows = virtualize({
  items: state.get().messages,
  keyBy: 'id',
  viewport: { offset: scrollTop, size: viewportHeight },
  layout: createFixedLayout(28),
  overscan: 8
});

const visibleObjects = virtualizeFrustum(sceneObjects, cameraFrustum);

DOM materialization uses the same range engine:

renderer.virtualEach('/messages/*', {
  container: list,
  keyBy: 'id',
  viewport: (source) => source.get().viewport,
  viewportWatch: '/viewport',
  layout: createFixedLayout(28),
  overscan: 8,
  create(message) {
    return renderMessage(message);
  },
  update(node, message) {
    updateMessage(node, message);
  }
});

JSX helpers now lower to the same manifest shape:

import { text, textLayout, virtualEach, when } from '@shapeshift-labs/frontier-dom/jsx-runtime';

const view = (
  <main>
    {text('/user/name', { frId: 'user-name' })}
    {when('/session/userId', {
      frId: 'session-slot',
      template: 'signed-in.v1',
      fallbackTemplate: 'signed-out.v1'
    })}
    {virtualEach('/messages/*', {
      frId: 'messages',
      keyBy: 'id',
      template: 'message-row.v1',
      viewport: { offset: 0, size: 640 },
      layout: textLayout({ field: 'body', font: '14px Inter', lineHeight: 20, width: 420 }),
      overscan: 8
    })}
  </main>
);

The root DOM renderer also has opt-in event delegation and composition-aware form binding:

renderer.delegate(app, 'click', '[data-action]', (event, target) => {
  renderer.commitPatch([[0, ['lastAction'], target.getAttribute('data-action')]]);
});

renderer.formValue('/profile/name', input, { preserveSelection: true });

Optional SSR/devtools helpers stay behind subpaths:

import { createDomDevtoolsSink } from '@shapeshift-labs/frontier-dom/devtools';
import { renderDomStateScript } from '@shapeshift-labs/frontier-dom/ssr';

Benchmarks

These are Frontier-only package measurements, not competitor comparisons.

Run package-local Frontier measurements:

npm run bench

Run the root competitor harness:

npm run bench:frontier-dom:competitors