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-scene

v0.1.0

Published

Patch-native 2D/3D scene graph and transform propagation primitives for Frontier hosts.

Readme

@shapeshift-labs/frontier-scene

Patch-native scene graph primitives for Frontier hosts. The package stores scene state as JSON, accepts Frontier patch tuples for mutation, and keeps hot transform/bounds state in typed-array caches.

API Shape

import { createSceneGraph, sceneNode2d, sceneNode3d } from '@shapeshift-labs/frontier-scene';

const scene = createSceneGraph({
  nodes: [
    sceneNode2d('root', { local: { x: 10, y: 20 } }),
    sceneNode2d('sprite', {
      parent: 'root',
      local: { x: 4, y: 8, rotation: 0.2 },
      bounds: { minX: 0, minY: 0, maxX: 32, maxY: 32 }
    }),
    sceneNode3d('camera', {
      local: { x: 0, y: 2, z: 8 },
      bounds: { minX: -1, minY: -1, minZ: -1, maxX: 1, maxY: 1, maxZ: 1 }
    })
  ]
});

scene.commit([[0, ['nodes', 'sprite', 'local', 'x'], 12]], {
  origin: { actionId: 'sprite.move', causeId: 'pointer-drag' }
});

scene.updateWorld();
scene.readWorld2d('sprite');
scene.queryAabb2d({ minX: 0, minY: 0, maxX: 128, maxY: 128 });
scene.toVirtualSpatialItems();

Design Notes

frontier-scene deliberately does not own a renderer. DOM, Canvas, WebGL, WebGPU, and game engines can all consume the same serialized graph, world matrices, bounds queries, and virtual-item adapters.

The internal model follows the same direction as the rest of Frontier:

  • JSON snapshot is the durable state.
  • Frontier patch tuples are the mutation format.
  • Dirty nodes are inferred from patch paths.
  • 2D and 3D local transforms are recomputed only for locally dirty nodes.
  • World matrix propagation is subtree-dirty, while world bounds are materialized lazily on bounds reads and culling queries.
  • Scheduler integration is structural, so frontier-scheduler can queue scene updates without becoming a dependency.
  • toVirtualSpatialItems() and toVirtualAabb3Items() return shapes that can feed frontier-virtual spatial and frustum culling.

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-scene

Benchmarks

Run the package-local benchmark:

npm run bench

Current benchmark coverage is Frontier-only and focuses on package-local behavior. These are Frontier-only package measurements, not competitor comparisons:

  • scene creation for mixed 2D/3D graphs
  • single-node patch plus dirty transform propagation
  • batch patch application plus world update
  • 2D AABB culling
  • 3D frustum culling
  • JSON snapshot serialize/rehydrate

Latest local run on Node v26.1.0, darwin arm64, 10000 mixed nodes:

scene:create-10k-mixed: 58 ops/sec (17.2112 ms/op, p95 25.3264 ms)
scene:patch-update-2d-leaf: 22514 ops/sec (0.0444 ms/op, p95 0.0756 ms)
scene:patch-update-3d-leaf: 29511 ops/sec (0.0339 ms/op, p95 0.0532 ms)
scene:batch-128-patches-update: 8636 ops/sec (0.1158 ms/op, p95 0.2654 ms)
scene:cull-2d-aabb: 15440 ops/sec (0.0648 ms/op, p95 0.0836 ms)
scene:cull-3d-frustum: 16448 ops/sec (0.0608 ms/op, p95 0.0746 ms)
scene:serialize-rehydrate: 58 ops/sec (17.3770 ms/op, p95 26.8814 ms)