a.js is a lightweight and versatile JavaScript Flexwork/library designed for building reactive and dynamic web components. It extends the power of native web components by introducing custom tags (<a-script>
, <a-closure>
, and <a-tagDef>
) that simplify complex operations such as state management, reactivity, and scoped behavior. These custom tags integrate seamlessly with modern JavaScript, allowing developers to create dynamic user interfaces with ease.
This documentation is targeted at developers familiar with JavaScript. Knowledge about web components and proxies is useful to understand what's going one behind the scene. If you are unfamiliar with these concepts, refer to the following resources for a brief primer:
<a-tagDef>
.a.js introduces three primary custom tags to enhance web development:
<a-script>
<script>
tag with additional functionality, including scoped execution and integration with a.js features.<a-closure>
<a-tagDef>
currentScript
and currentElement
:
<script>
or target element within a.js tags, streamlining access to DOM elements.<let>
blocks use JavaScript proxies for fine-grained reactivity, enabling automatic updates to UI elements.<let>
blocks allow you to maintain state inside a component or between several of them without triggering reactivity.<import>
tag:
<a-xxx>
tags.<forEachOf>
tags to create dynamically reactive lists.