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

@page-engine/page-runtime-browser

v0.5.1

Published

Browser runtime host and trusted renderer ABI for PageEngine execution plans.

Readme

@page-engine/page-runtime-browser

Browser runtime and trusted renderer ABI for the PageEngine declarative front-end engine.

Consumes page.execution-plan/v1 (never Page Source or Runtime Manifests), mounts trusted web-component renderers, and runs the engine's closed interaction loop: event routing, the read-only Query Gateway, the Command Gateway write path, context state, and the standard collection query semantics. Renderer assets integrate through the TrustedRendererHandle ABI (light-DOM, framework-agnostic from the engine's perspective) — the renderer-adapter-react and renderer-adapter-vue3 packages implement it for their frameworks.

  • Depends only on @page-engine/page-contracts and @page-engine/page-runtime-core.
  • Browser-safe synchronous SHA-256 verification; no network or clock access inside the runtime.

Install

npm install @page-engine/page-runtime-browser

Requires Node >= 22.12 (for tooling); the runtime itself targets browsers. ESM only.

Minimal example

import { mountPageRuntime } from "@page-engine/page-runtime-browser";

const controller = new AbortController();
const mounted = await mountPageRuntime({
  plan, root,
  dependencies: { rendererRegistry, queryGateway, correlationIdFactory },
  signal: controller.signal,       // optional; also destroys a ready runtime
  rendererConcurrency: 4,          // optional; integer 1–16, default 4
});
if (!mounted.ok) console.warn(mounted.diagnostics);

// On host invalidation/unload, even while mountPageRuntime is still pending:
controller.abort();
// The existing mounted.handle.destroy() path remains available and idempotent.

Renderer preparation and cancellation

Independent rendererRegistry.resolve(binding) calls run with bounded concurrency. A session deduplicates the complete module identity (rendererRef, rendererDigest, entryAsset, entryAssetDigest, elementName, protocol), then checks every module before creating page DOM. Widget DOM order and the plan's mountOrder stay deterministic. The old call without new options still works; set rendererConcurrency: 1 if an existing loader needs serial resolution.

Resolve describes a module, not widget state. Its createHandle() must return a fresh handle for each widget, including multiple widgets sharing the same module. Modules/promises shared across sessions remain host-owned. The optional preload hint still only warms bytes: it must not execute modules or register elements. Concurrent imports happen through resolve.

An aborted mount returns ok: false with runtime.mount-aborted, stops starting new resolves and releases the root without waiting for pending imports. Late results cannot create handles, mount or release a replacement runtime's root. Aborting a ready runtime is equivalent to destroy() and cancels its queries, commands, listeners and refresh subscriptions. Synchronous renderer/host callbacks finish before their returned resources are cleaned up. Native module evaluation itself cannot be undone.

Failure/destroy releases all returned handles, including handles never mounted and handles whose mount threw. Unattempted handles are released in reverse creation order, then attempted mounts in reverse attempt order. unmount() must tolerate an unmounted or partially mounted handle. Factories that throw before returning a handle own cleanup of their unreturned resources. The React and Vue adapters already support this cleanup contract.

Mount diagnostics

Existing runtime.renderer-mount-failed and /runtime/mount are preserved. RuntimeMountDiagnostic and telemetry add optional stage, widgetId, rendererRef and causeCode fields. Stages are renderer-resolve, renderer-identity, renderer-create-handle, renderer-mount and runtime-initialize; cause codes distinguish loader, identity, factory, mount and initialization failures. Raw exceptions, stacks, asset URLs and business data are not copied to diagnostics/telemetry. A throwing telemetry sink does not affect cleanup or the result.

runtime.renderer-concurrency-invalid rejects invalid concurrency options before the root is claimed. See docs/page-engine-eng01-eng02.md in the repository for tests, measurements and isolated integration instructions.

Applications should usually install @page-engine/page-standalone-host (which builds on this runtime) and framework adapters, not this package alone. See the monorepo README for the runtime contract details and docs/ for the phase design documents.