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

@opentf/afw

v0.38.0

Published

The AFW runtime: signals and zero-VDOM DOM bindings, with routing and server rendering.

Readme

@opentf/afw

The AFW runtime: signals and zero-VDOM DOM bindings

Docs | Reactivity | Changelog | GitHub

An Open Tech Foundation project

You write .jsx components; the AFW compiler lowers them to plain DOM code that imports its helpers from this package. Each component becomes a self-registering Custom Element, and each {expression} becomes one binding to one signal.

import { onMount } from "@opentf/afw";

export default function Clock() {
  let now = $state(null);

  onMount(() => {
    now = new Date();
    const id = setInterval(() => (now = new Date()), 1000);
    return () => clearInterval(id);
  });

  return <time>{now ? now.toLocaleTimeString() : "Loading clock…"}</time>;
}

Every second, one text node changes; nothing else on the page is touched. Returning a function from onMount registers its cleanup.

[!NOTE] Alpha. The API can change between minor versions; see the changelog.

Install

pnpm add @opentf/afw
pnpm add -D @opentf/esdev-plugin-afw

Components compile through @opentf/esdev-plugin-afw on esdev 0.17 or newer. To start from a working app instead, run esdev create my-app --template=spa.

What's inside

| Area | Contents | | --- | --- | | Reactivity | A signal / computed / effect core, written from scratch | | DOM bindings | bindText, bindAttr, bindList, bindChild, setProp, spread, clsx: the targets the compiler emits | | Components | Context, Portal, ErrorBoundary, event dispatch with emit | | Routing | mountApp, the reactive router, <Link>, guards, loaders, locale prefixes | | Server | DOM-free SSR/SSG rendering, API routes, middleware, cookies, a Node adapter |

Macros and hooks

Written in your components and resolved by the compiler; nothing to import for the $ macros.

| Macro / hook | Purpose | | --- | --- | | $state(value) | Reactive local state; assign to it like a variable | | $derived(expr) | A value recomputed when its inputs change | | $effect(fn) | Run side effects when their inputs change | | $ref() | A reference to a rendered element or component | | $context(Context) | Read the nearest provided context value | | $expose({ … }) | Methods a parent can call through a ref | | onMount, onCleanup | Lifecycle of the component's host element | | onResize, onVisibilityChange, onMediaQuery | Observers that clean up with the component |

Entry points

| Import | Contents | | --- | --- | | @opentf/afw | Runtime, reactivity and Link: what compiled components import | | @opentf/afw/signals | The reactivity core on its own | | @opentf/afw/runtime | DOM helpers, Context, Portal, ErrorBoundary | | @opentf/afw/server | DOM-free rendering, route registration, API and middleware helpers | | @opentf/afw/server/adapters/node | toNodeListener for node:http servers | | @opentf/afw/jsx-runtime | JSX type definitions for TypeScript |

TypeScript

Declarations ship with the package. Keep JSX for the AFW compiler and point jsxImportSource at this package:

{
  "compilerOptions": {
    "jsx": "preserve",
    "jsxImportSource": "@opentf/afw",
    "moduleResolution": "bundler",
    "lib": ["ESNext", "DOM", "DOM.Iterable"],
    "strict": true,
    "noEmit": true
  }
}

esdev create my-app --language=ts generates this configuration together with the macro declarations.

Documentation

| Topic | Link | | --- | --- | | Components and JSX | Core concepts | | Reactivity | Signals, derived values and effects | | Routing | Pages, layouts, guards and API routes | | Deployment | Static generation, hydration and servers |

License

MIT — see LICENSE.