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

@3sln/dodo

v0.1.0

Published

A minimal, configurable virtual DOM library.

Downloads

430

Readme

Dodo

[!WARNING] This is a work-in-progress project and is not yet ready for production use.

A minimal, configurable virtual DOM library.

Documentation

For detailed documentation, live demos, and advanced usage examples, please check out the Dodo Deck.

Quick Start

Installation:

npm install @3sln/dodo
# or
bun add @3sln/dodo
# or
yarn add @3sln/dodo

Basic usage:

import { reconcile, h1, p, div } from '@3sln/dodo';

const container = document.getElementById('root');

// Use helper functions like h1(), p(), etc. for standard elements.
// A tag is followed by its children, and nothing else.
const myVdom = div(
  h1('Hello, dodo!'),
  p('This is a paragraph.').classes('lede')
).props({ id: 'app' });

// Reconcile the virtual DOM with the real DOM.
reconcile(container, [myVdom]);

Everything about an element — its properties included — is chained onto the vnode, and every setter returns the vnode:

div('content')
  .props({ id: 'card' })
  .style({ 'background-color': 'white', padding: '1em' })
  .classes('card', isActive && 'active')
  .attrs({ role: 'group' })
  .data({ cardId: id })
  .key(id)
  .on({ click: onClick });

Each map is compared in its own right rather than by identity, so an object literal rebuilt every render compares equal when its contents have not changed.

Optional modules

Five modules ship alongside the core. Dodo's core does not import any of them, so they cost nothing if you do not use them.

Reactivity — @3sln/dodo/reactive

Reactive rendering built on a two method Cell protocol:

{ onDirty(fn) -> unsubscribe, getValue() -> any }

Dodo does not depend on the observable protocol, on signals, or on any other library — it depends on this. Adapters bridge the rest (fromObservable, fromSubscribe, fromSignal), and cell() is there if you would rather not bring anything at all.

import {reconcile, p} from '@3sln/dodo';
import {cell, watch} from '@3sln/dodo/reactive';

const name = cell('world');

reconcile(container, [watch(name, value => p(`hello ${value}`))]);

name.setValue('dodo'); // re-renders on the next frame

Context — @3sln/dodo/context

DOM-scoped context, so data reaches a descendant without passing through every component in between. Providers respect shadow DOM boundaries, and consumers name the keys they care about so unrelated changes do not re-render them.

import {withContext, useContext} from '@3sln/dodo/context';

withContext({theme: 'dark'},
  someDeeplyNestedTree(
    useContext(['theme'], ({theme}) => p(`theme is ${theme}`)),
  ),
)

Observing elements — @3sln/dodo/observe

ResizeObserver and IntersectionObserver as Cells, plus two components built on them. Observers connect on the first listener and disconnect on the last, so a detached watch takes its observer with it.

import {withElementSize, withVisibility} from '@3sln/dodo/observe';

withElementSize(size => canvas().props({width: size.width, height: size.height}))

withVisibility(visible => (visible ? chart() : skeleton()), {root: '.scroller'})

The underlying elementSize / elementVisibility cells are plain functions of an element with no dependency on dodo, usable on their own.

Enter and exit animation — @3sln/dodo/animate

Holds an element on screen long enough to animate out, reporting which phase of appearing or disappearing it is in. Reversing mid-animation aborts whatever was in flight, so a stale completion cannot land later and win.

import {withPresence} from '@3sln/dodo/animate';

withPresence(isOpen, phase => panel({phase}), {
  spawn: {classes: ['fade-in']},
  despawn: {classes: ['fade-out']},
  mode: 'remove',
})

Durations are read from computed style rather than waited on with transitionend, so a transition that never fires cannot leave a phase stuck.

Scoped styling — @3sln/dodo/style

Renders a subtree into a shadow root with constructable stylesheets adopted, so its CSS genuinely cannot leak in either direction.

import {css, scoped} from '@3sln/dodo/style';

const styles = css`p { color: rebeccapurple; }`;

scoped({styleSheets: [styles]}, p('scoped'))

css is memoised per call site, so writing it inline in a render function does not rebuild the sheet every time.

Baking your own

The modules follow the same factory pattern as the rest of the project. If you use a custom dodo instance, or want to replace the scheduler or the error view, build your own. Context renders through a watch, so it requires the reactive API to be injected — build it once and pass it in:

import reactive from '@3sln/dodo/src/reactive.js';
import context from '@3sln/dodo/src/context.js';

const userSettings = {dodo: myDodo, schedule: fn => fn()};

const {watch} = reactive(userSettings);
const {withContext, useContext} = context({...userSettings, reactive: {watch}});