
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
atlas-relax
Advanced tools
A minimal, powerful declarative VDOM and reactive programming framework.
Relax is a minimal, powerful declarative VDOM and reactive programming library.
This tiny 2.5KB (.min.gz) engine lets you define data-driven apps using declarative components. Relax combines ideas from Meteor, Mithril and Preact into one simple library. Relax supports:
render
<li key="key1">
) for efficient diffingshouldComponentUpdate
Relax gives you what you need to build not only simple todo apps, but also rapidly-updating apps like stock tickers.
Meteor.Tracker.autorun
in a few lines of code on top of Relax.render
called.Relax isn't a "framework", it's a small library that helps you avoid huge frameworks. Relax abstracts out the heavy lifting associated with common UI and state management tasks (reconciliation, efficient data flow propagation, reactive functions, etc.). Build your own framework: Many frameworks can be built in a few lines of code with Relax's primitives:
Relax's inner-diff (instance-level diff
) API is inspired by Mithril's redraw
. If you prefer React syntax, hooks and other React-like APIs can also be built pretty easily with Relax's primitives:
setState
setState
useEffect
useLayoutEffect
useState
useRef
afterAll
, after
, before
, beforeAll
, afterMount
, beforeUnmount
, afterUpdate
If you've ever tinkered with Meteor, you've probably been obsessed with Tracker.autorun
at some point. Nobody blames you -- it is awesome. If you wanted to, you could implement the exact same API using Relax nodes as Relax supports dependency graphs out-of-the-box. Relax makes it easy to implement reactive patterns such as:
Meteor.Tracker
Meteor.ReactiveVar
Meteor.ReactiveDict
Meteor.Collection
(reactive collection)Meteor.Collection.find
that supports sort, filter, and multiple listeners per querynpm install --save atlas-relax
You are assumed to be familiar with transpiling code (babel, webpack, etc.). In the future, I may make a dist/
folder containing various transpiled-minified code for quick installment.
Relax is an experimental library and your feedback is greatly appreciated! If Relax has piqued your interest 👀 then read the source code! I've included implementation comments for your reference. If you are curious how some things were implemented, check out the development history. There are a few things I want to implement in the future:
dist/
files
Meteor, Mithril, Preact and physics analogies. MIT License.
The gif above was made with the help of Paul Falstad's atomic dipole transition applet. Check out his other amazing interactive physics playgrounds over at his website: http://www.falstad.com/mathphysics.html.
FAQs
A minimal, powerful declarative VDOM and reactive programming framework.
The npm package atlas-relax receives a total of 18 weekly downloads. As such, atlas-relax popularity was classified as not popular.
We found that atlas-relax demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.