# patrick-steele-idem/morphdom

Fast and lightweight DOM diffing/patching (no virtual DOM needed)

Repository: https://github.com/patrick-steele-idem/morphdom
Canonical: https://ross.abutalabs.com/products/morphdom
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2026-01-24T05:16:21+00:00

## Health v2 (maintenance only)
Score: 61/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 64, release rhythm 35, longevity 100
- inputs: {"age_days": 4087, "days_push": 221, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3574, forks 148 (observed 2026-08-28T04:08:10.770991+00:00)

## What it is
morphdom is a lightweight JavaScript library that efficiently morphs an existing real DOM node tree to match a target DOM tree with minimal changes, without requiring a virtual DOM. It preserves internal DOM state like scroll positions, input caret positions, and CSS transition states during updates.

## Use cases
- update the DOM after rerendering a UI component without losing input focus or scroll position
- morph an existing DOM tree to match new HTML from any templating language
- apply minimal DOM patches instead of replacing innerHTML wholesale
- diff and patch the real DOM against a virtual DOM tree
- efficiently sync server-rendered HTML into a live page

## When to choose
- you rerender HTML strings or templates and want minimal, state-preserving DOM updates
- you want DOM diffing without adopting a full virtual DOM framework
- your code manually manipulates the DOM and you need updates to stay compatible
- you need a small, fast, dependency-free browser library

## When to avoid
- you are building a large app that benefits from a full framework with state management and components
- you need fine-grained reactive updates rather than full-tree rerendering
- you need to diff non-DOM data structures

## Facets
- artifact type: library
- maturity: stable
- function: ui-components, frontend-framework
- domain: web-development, frontend, developer-tools
- platform: browser
- tags: dom-diffing, dom-patching, no-virtual-dom, rerendering, lightweight, nodejs

## Member repositories
- patrick-steele-idem/morphdom (main) score 61

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:10.770991+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:34:04.388479+00:00, confidence not recorded.
  - readme: https://github.com/patrick-steele-idem/morphdom (fetched 2026-08-28T04:08:10.770991+00:00, sha 3af7765ddeee)
  - registry_npm: https://registry.npmjs.org/morphdom (fetched 2026-08-29T09:27:54.400988+00:00, sha ee524926ba2b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
