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

@unframework.dev/ir

v0.5.0

Published

The Unframework intermediate representation: plain-data types, builders, visitors and the JSON Schema that every IR snapshot is validated against.

Readme

@unframework.dev/ir

The Unframework intermediate representation: what the analyser knows about a .uf.tsx module, as plain, versioned, schema-validated JSON (plan §5.3).

  • Types: UfModule (its components, exports and the local type declarations their props, events and setup use), UfComponent (props, the props parameter, the events defineEmits declares, bindings, the setup and a render root that is an element or a root Fragment), the render nodes (Element, Text, Interpolation, If, For) and the attribute kinds (Static, Bound, Class, Style, Spread, the listeners and template refs, Event and Ref, and an element's markup, RawHtml, ADR-0097). A binding is a prop, a loop variable, a ref (state), a computed (derived), a template ref, a setup const, function or let, or emit, by its name@offset id. The setup is a list of items in source order (State, Derived, TemplateRef, Id, Const, Variable, Function, Watch, WatchEffect, Lifecycle, ADR-0045, and DevCheck, a top-level if (isDev) { … }, ADR-0117). An Expression is a template's source text at its span, with every identifier resolved to a binding or an allowed global; setup Code also resolves writes, emits, nextTick, isDev as an if's test (Dev) and a handler's event members, and a FunctionCode keeps a function's parameters, flags and body apart, for the targets that print it from its parts. A ref's value is read as count.value, which its reference spans.
  • Composition (ADR-0055): a module's imports of other .uf.tsx modules, each with the ModuleApi the compiler's resolver returned (ADR-0053), and its injection keys; a component's slots, exposes and inheritAttrs, a slot repeated where the component may render it more than once at a time, and inFill where it renders it inside a fill a child renders, in its declaration and its API (ADR-0126, ADR-0128); the render nodes Component, SlotOutlet and Dynamic (<component is>, with only, the attributes only some of its tags take, ADR-0119), a ComponentApi.root of "dynamic" with its rootTags, the render node Teleport (<Teleport to>, one element mounted elsewhere, ADR-0098), the render node Transition (<Transition name appear>, Vue's classes on one element or one conditional of elements, ADR-0100), the Directive attribute and a module's directives, each with its hooks' code (v-focus-trap={open.value}, ADR-0099), a list's body that is a component, a component's attributes (Prop, Listener, ModelBinding, Class, Style, Ref) and fills, an element's v-model (Model), the setup items Model, Provide and Inject, the binding kinds model, slots, slotScope, context and component, and a slot's presence (Slot references). The analyser lowers none of it yet: M3's lanes do.
  • Async setup (ADR-0101): the setup item Await (const user = await loadUser(props.id)), whose value is the awaited expression without await, its binding kind awaited, a read-only constant, and ComponentApi.async, set when a component's setup awaits, so a parent in another file knows.
  • Styles (ADR-0063): a component's styles, the sibling stylesheets it imports, each with its specifier, its text and its span, and its scopeId; a child's ComponentApi.styles, its scope id and whether its sheets use :slotted(); a module's passThroughImports, of any module that is neither relative nor absolute (a styling engine's virtual: modules, ADR-0064), whose names a template reads through Import references; and the forms ADR-0038 and ADR-0039 defer: a style bound to one value (StyleAttribute.value), a class part that may be an array or an object (DynamicClass.collection), a spread's style key and vendor-prefixed properties, which the analyser lowers since ADR-0065.
  • Cross-file types, generics, composables and shared modules (ADR-0067 to ADR-0070): a module's typeImports and typeExports (type re-exports, and exported types no component reaches), its moduleImports of values from relative .ts modules and its top-level constants, which components read through import and moduleConst bindings, and a .uf.ts module's composables (UfComposable: type parameters, parameters of a value, getter or callback kind read through argument bindings, a setup and the members it returns); a component's typeParameters, and a child's in ComponentApi.typeParameters; a prop's declaredBy, where another declaration declares the member, whose type is then that file's text at the props annotation's span; the names a slot's props, an API member and a key reference (references), and the literals of a child's prop whose alias names a union of them (ApiMember.literals), for UF3039; a .uf.ts module's ModuleApi.composables (ComposableApi, with hasEffects), imported by Composable names; and the Use setup item, a composable's call whose members are usedState, usedDerived, usedFn and usedConst bindings. Every new field is absent when empty. The analyser fills all of them, and every target emits them, each composable through the target's emitComposable.
  • Builders: one per type (createModule, createComponent, createElement, createFor, createExpression, createCode, createWriteReference, createFunctionCode, createStateItem, createEventAttribute, …). They write keys in the order of the types, which is the order of every ir.json snapshot, and leave an absent optional field out.
  • Visitors: walk (every container, the root fragment included), childrenOf, collectFeatures (node, attribute, binding, setup item, handler, watch source and code reference kinds, which the coverage gate reads), expressionsOf (every template expression of a component with its JSON Pointer), codeOf and functionsOf (the setup's and the handlers' code and functions, each with the context it runs in: pure for what the setup evaluates, client for what runs in the browser), and spansOf (every span of a module). summarize says what each local function does, itself and through the functions it calls (writes, emits, reads, calls, nextTick, await, template refs, setup lets, client-only globals, whether it escapes as a value): the analyser, the invariants and every target judge a call by it, and the IR holds no summary a plugin could falsify. summarizeTracked leaves out the references marked later (in a function client code hands to a timer, then, addEventListener or onCleanup, ADR-0048): what a watchEffect tracks, which every target lists as its dependencies.
  • Schema: irSchema (also @unframework.dev/ir/schema.json), generated from the types with pnpm --filter @unframework.dev/ir generate. A test fails when it is stale. validateModule checks a value against it without dependencies (the compiler checks what plugins return with it): a node's kind picks its branch of a union, and a key set to undefined is absent, as in JSON.
  • Invariants: checkInvariants checks what the types document and the schema cannot say: component and export names every target can write; HTML elements a component can render, and SVG elements inside an <svg>; an element's own attributes, set once across every kind (a spread's class merges with the element's); true for exactly the HTML boolean attributes; a canonical class and a style whose declarations do not overlap; nothing the targets render differently (portability.ts), bound or static; no code or document the compiler cannot analyse (srcdoc, javascript: URLs, data: URLs a frame loads); text where every target renders it alike, with only characters HTML keeps; props every target can declare, with static defaults, and a local Props only as the props type of every component its props reach; stylesheets only in a one-component module, with a scope id exactly when there are any, and pass-through imports whose names no other import binds and only a template reads; bindings in scope, and code that fills its span (a prop in the object form as the parameter's member, a ref's value as name.value); a read's narrowed paths (narrowed, ADR-0046), each the read or a member path off it, narrowed by the template only in a handler's code and across a closure only as a destructured prop's own read, and a write's narrowed target only where its operator reads it (+=, ++); the shapes of conditionals, lists and fragments; and loop variables no target's rewrite captures, keyed by their own list's item or index. For the setup (ADR-0045 to ADR-0049): items in source order, each declaring one binding of its kind, named apart from the component's other names and from what the targets reserve; code that runs where it may (templates and what the setup evaluates write, emit and await nothing, read no template ref or setup let, call only pure local functions, a getter only those that read static values, and read only what is declared before them); writes of a state, a model or a let, emits of a declared event with as many arguments as it takes, in client code only; an immediate watcher safe on the server, and DOM reads only after the DOM updates; functions with the parameters their role takes; listeners of an event of the vocabulary, with one option at most, whose handlers use only the event members every target's event carries and list their leading preventDefault() and stopPropagation() calls; and each template ref attached by one element outside any list and Angular's literal region. For composition (ADR-0055): a component element names exactly one imported or local component, and each prop, listener, model and fill a declaration of its API; a slot outlet, a slot's presence and a forwarded fill name a declared slot; a model's binding is a state's or a model's .value; an injected value is never written; a Dynamic node's candidates are all tags, whose attributes and children each tag keeps as an element, or all components; a Teleport (ADR-0098) holds exactly one element, outside SVG, and its to is not empty; a Transition (ADR-0100) holds one element, or one If whose every branch holds one element or nothing, outside a list's body, and its name has no whitespace; no Await follows another setup item, and an Await's value reads only props, module values, globals and earlier awaited bindings (ADR-0101); a Directive names a directive the module declares or imports, once per element, in a list's body too (ADR-0108), and a directive's hooks read their own names, client globals and the bindings it lists (ADR-0099); slots, exposed functions and models are declared once, a model named apart from the props; provide and inject name a key the module declares or imports, and a key of a ref (InjectionKey<Ref<number>>, ADR-0054) is provided, or injected with a fallback, as a state, derived or model binding by its name, and its injected binding read as x.value; and a v-model's control is one its element has. For M5's contract (ADR-0067 to ADR-0070): a prop another file declares is exempt from the source-slice rule; type parameters, a slot's references, and the names the type and value imports, exports and constants bind are identifiers, each once; a constant's code reads only pure globals, the other constants and the value imports; an import or moduleConst binding is one the module declares, and only a composable declares an argument; a Use item calls an imported composable with an argument of each parameter's kind, destructures members its API returns into bindings of their kinds and copies hasEffects; a composable's ref is read as x.value, and its function where the setup evaluates code only when pure; and a composable's setup keeps a component's rules, with its arguments, its items and the members it returns. The compiler emits from no module that breaks one, a plugin's included, and checks itself that a plugin's code is the analyser's.
  • Portability facts: what the targets render differently from the same markup (portability.ts): elements Vue does not know, template syntax, attributes a framework acts on or sets as state, contenteditable with children, empty URLs React drops, whitespace Svelte drops, attributes Angular cannot bind, text the parser moves or drops, and the root elements tied to their parent that Angular's host breaks (CONTEXTUAL_ROOT_ELEMENTS). The analyser reports each at its source, and the invariants reject them in any IR; but for a bound value that may be nullish where some targets set the property (NULLISH_VALUE_ELEMENTS), which the analyser alone can tell: the IR holds no kinds.
  • Vocabulary: the HTML elements, attributes and content-model facts the analyser validates against, and the printers and targets lay out by (html.ts), with the boolean attributes a value can be bound to and the attributes React and Qwik type as numbers; the SVG elements and attributes, case-exact (svg.ts); CSS facts: unitless properties, shorthands as Chromium expands them, and what a static value may hold (css.ts); the DOM events a listener may take with their interfaces, the window's and the unsupported ones apart, the events a listener may be passive on, and the event members every target's event object carries for each (events.ts: DOM_EVENTS, PORTABLE_EVENT_MEMBERS, PORTABLE_EVENT_INTERFACES); the globals each context may read (ALLOWED_GLOBALS in templates, PURE_GLOBALS in what the setup evaluates, CLIENT_GLOBALS in client code: every name lib.dom declares, LIB_DOM_GLOBALS in browser.ts, but the window members read only through window, WINDOW_MEMBER_GLOBALS; with the BROWSER_GLOBALS and SCHEDULING_GLOBALS a server-safe watcher may not, and readsDom, the reads that see what a render changes) and the reserved prop, parameter and setup binding names (names.ts). Its tables are maps, read with names from the source. ID_REFERENCE_ATTRIBUTES and idReferencesIn are how the analyser and the tests' normaliser both find id references (the generated-id prefix, ADR-0031). listBoxSize reads a <select> as HTML does: a single-selection list box with an option a drop-down would select starts with none selected (the listbox capability), and what is known only at run time counts as one.

The IR has no dependencies and imports nothing from TypeScript: it is pure data. The tables say where each comes from; the analyser's conformance tests check them against the frameworks and parse5.