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

v0.1.0

Published

DOM-neutral logical route, scene, and location graph primitives for Frontier apps and games.

Readme

@shapeshift-labs/frontier-route

DOM-neutral route, scene, and location graph primitives for Frontier apps and games. The package treats app routes, game scenes, rooms, panels, overlays, and other navigable resources as first-class registry entries so DOM renderers, Playwright harnesses, migrations, cache loaders, effects, telemetry, and replay tooling can all talk about the same touched resource ids.

API Shape

import {
  createRouteManifest,
  createRouteRegistryGraph,
  createRouteSession,
  explainRoute,
  matchRoute,
  planRouteTransition,
  queryRouteManifest,
  resolveRoute,
  traceRouteImpact
} from '@shapeshift-labs/frontier-route';

const manifest = createRouteManifest({
  routes: [
    {
      id: 'app',
      pattern: 'route:/',
      exact: false,
      reads: ['app.boot']
    },
    {
      id: 'todo.detail',
      parentId: 'app',
      pattern: 'route:/todos/:id',
      feature: 'todos',
      reads: [['entities', 'todo']],
      writes: ['ui.selection'],
      loads: [{ id: 'todo.loader', resource: 'query:todo/:id' }],
      guards: ['auth.required'],
      emits: ['route.enter.todo'],
      source: { file: 'src/routes/todo.ts', symbol: 'TodoRoute' }
    },
    {
      id: 'scene.overworld',
      kind: 'scene',
      pattern: 'scene:overworld/:zone?',
      reads: ['save.current'],
      writes: ['game.scene'],
      loads: ['asset:overworld']
    }
  ],
  transitions: [
    {
      from: 'app',
      to: 'todo.detail',
      kind: 'push',
      reads: ['auth.user'],
      guards: ['auth.required']
    }
  ]
});

const resolved = resolveRoute(manifest, 'todo.detail', { id: '123' });
const match = matchRoute(manifest, resolved.resource);
const plan = planRouteTransition(manifest, 'app', { id: 'todo.detail', params: { id: '123' } });

const session = createRouteSession(manifest, { initial: 'app' });
session.navigate({ id: 'todo.detail', params: { id: '123' } }, 'push');

const graph = createRouteRegistryGraph(manifest, {
  package: '@app/todos',
  feature: 'todos'
});
const byFeature = queryRouteManifest(manifest, { features: ['todos'] });
const impact = traceRouteImpact(manifest, { resources: ['route:/todos/123'] });
const explanation = explainRoute(manifest, 'todo.detail');

void match;
void plan;
void graph;
void byFeature;
void impact;
void explanation;

Design Notes

frontier-route deliberately does not own rendering, history APIs, React hooks, DOM events, browser storage, scene graph transforms, game replication, or Playwright. It owns stable logical navigation ids and the dependency metadata around them.

  • Resource ids use a scheme form such as route:/todos/:id, scene:overworld/:zone?, room:/dungeon/:roomId/boss, modal:settings, or panel:inventory.
  • Matching supports static segments, :param, :param?, *splat, *splat?, Next.js-style [param], [...splat], and [[...splat]].
  • Specificity ranking prefers static segments, then dynamic params, then optional params, then splats, with route rank/order as deterministic tie-breakers.
  • Manifests build lazy internal indexes for route ids, compiled route patterns, leading static prefixes, parent chains, children, resources, and transition targets while keeping the serialized manifest plain JSON-like data.
  • Parent ids model app route layouts, game scene stacks, room hierarchies, modal ownership, or any other logical containment.
  • Transition plans report shared, leaving, and entering route chains plus declared reads, writes, loaders, guards, and emitted events.
  • Route queries find entries by route id, concrete or symbolic resource, kind, package, feature, owner, tag, source file, state path, loader, guard, and emitted event. Filters are union-style so a harness can ask "anything touching this feature or this file or this state path" in one pass.
  • Route impact tracing expands query seeds through ancestors, descendants, and transition edges to produce the complete route ids, scene ids, resources, reads, writes, loaders, guards, emits, files, packages, features, and tags a migration, replay, telemetry span, or AI feature task should inspect.
  • Route explanations produce a compact per-route view with the symbolic target resource, chain, optional descendants, related transitions, and dependency/source metadata without requiring concrete params.
  • Route sessions provide a small serializable runtime for active app routes, game scenes, overlays, pause/resume, sleep/wake, stop/start, stack history, and replay snapshots.
  • Registry graph output turns every route and transition into Frontier registry entries with touches, declares-read, declares-write, handles, produces, emits, declared-in, package, feature, owner, and tag edges.
  • Pattern resources stay symbolic for manifests and registry output, while resolved concrete resources URL-encode parameter values.

App And Game Use

App routing and game routing use the same model because both are logical navigation through named resources.

  • Apps can represent pages, nested layouts, loaders/actions, modals, tabs, panels, route-state reads, cache keys, and DOM hydration roots.
  • Games can represent active scenes, rooms, levels, zones, overlays, pause menus, transition gates, asset loads, save-state reads, scene writes, and replication-visible resources.
  • Test and AI harnesses can query route:/todos/:id or scene:overworld/:zone? as touched resources without importing a DOM renderer or a game engine.
  • Migrations can tag route or scene entries so schema changes can find the route-state/cache/effect/test surfaces that need review.
  • Telemetry can attach route transition plans to structured logs without the logging package depending on this package directly.

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

Benchmarks

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

Run package-local measurements:

npm run bench

The benchmark covers manifest creation, dynamic matching, catchall matching, scene optional-param matching, route resolution, transition planning, route query, impact tracing, route explanation, session navigation, and registry graph generation.

Latest local package benchmark on Node v26.1.0, darwin arm64, 2k routes and 50 rounds:

| Fixture | Median | p95 | | --- | ---: | ---: | | create-manifest-2000 | 3.65 ms | 6.07 ms | | match-dynamic-2000 | 1.61 us | 3.30 us | | match-catchall-2000 | 1.56 us | 2.74 us | | match-scene-optional-2000 | 0.77 us | 1.36 us | | resolve-dynamic-2000 | 0.61 us | 0.90 us | | plan-transition-2000 | 1.77 us | 4.05 us | | query-resource-2000 | 91.62 us | 139.51 us | | impact-route-2000 | 787.62 us | 880.14 us | | explain-route-2000 | 175.19 us | 184.49 us | | session-replace-2000 | 1.29 us | 1.65 us | | registry-graph-2000 | 5.85 ms | 9.48 ms |