/morphlite

DOM morphing in < 100 LoC

Primary LanguageJavaScriptMIT LicenseMIT

MorphLite

Morphlite is an attempt to create a DOM morphing function in less than 100 lines of code with no runtime dependencies, to use with HTMZ in small projects. It is still very much a work-in-progress.

Current status

We have a basic sketch of the morphing function in src/morphlite.ts that can handle simple cases. Now, we’re copying tests from Morphdom, Idiomorph, Alpine Morph, and nanomorph.

Run tests

  • npm install
  • npm watch
  • in another tab npm run "test:watch"

Usage

import { morph } from "morphlite";

morph(currentNode, guideNode);