New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

morphlex

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

morphlex

A safe, tiny (less than 1KB minified & gzipped), optimal DOM morphing library written in TypeScript.

  • 0.0.8
  • npm
  • Socket score

Version published
Weekly downloads
11K
increased by8.92%
Maintainers
1
Weekly downloads
 
Created
Source

Morphlex

Morphlex is a tiny, safe, optimal DOM morphing library written in TypeScript. It uses IdSets, inspired by Idiomorph.

Why are we doing this?

We were massively impressed by what HTMZ made possible in just 166 bytes, and we think there’s huge potential combining the HTMZ iframe proxy technique with a tiny DOM morphing function. Our goal is to combine this into a new powerful way to build web applications.

There are three parts:

  1. iframe proxies for prepend, append, morph and replace operations, targeted by normal HTML links and forms;
  2. a tiny DOM morphing function that can handle complex cases;
  3. a protocol for requesting the server return a specific fragment of a view by DOM id.

Initially, we will build support for rendering fragments into phlex and phlex-rails.

Usage

import { morph } from "morphlex";

morph(currentNode, referenceNode);

The currentNode will be morphed into the state of the referenceNode. The referenceNode will not be mutated in this process.

Run tests

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

FAQs

Package last updated on 29 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc