August 26th, 2024

Show HN: Ayr.js – a reactivity model designed for simplicity

Ayr.js is a lightweight reactivity model enabling developers to create reactive components without build tools. It features state management, effects, and derived state, but is still in early development.

Read original articleLink Icon
Show HN: Ayr.js – a reactivity model designed for simplicity

Ayr.js is a lightweight reactivity model designed for simplicity, allowing developers to create reactive components without the need for build tools or templating engines. It can be installed via npm or imported directly from a CDN. The core of Ayr.js revolves around the Ayr Component (AC), which consists of three main elements: root, state, and effects. The root specifies where the component mounts in the DOM, state holds reactive variables, and effects are functions that modify these state variables. An example of an Ayr component demonstrates how to create a counter with increment functionality. Ayr.js also supports derived state through dependants, conditional rendering with the y-if directive, and looping with the y-for directive. The framework is still in early development, and users are cautioned that the API may undergo significant changes. Contributions to the project are encouraged, and it is inspired by frameworks like Solid.js and Alpine.js.

- Ayr.js is a simple reactivity model for HTML and JavaScript.

- It allows for the creation of reactive components without build tools.

- Key features include state management, effects, and derived state.

- The framework is still in early development and not recommended for production use.

- Contributions to the project are welcome, and it draws inspiration from other frameworks.

Link Icon 3 comments
By @breck - 8 months
I would consider changing the name. Also, this oil field seems to have been milked dry (but I could always be missing something!)

My user test: https://www.loom.com/share/4d2078b9e6ed45eb83331c8f97460fdb

By @meiraleal - 8 months
Very interesting! Makes me happy to see JS projects not using build tools and low/no dependencies
By @nesarkvechnep - 8 months
As DJ Khaled would say - another one.