esor
Version:
Lightweight JavaScript framework for dynamic Web applications based on Web Components with auto-batching and optimized reconciliation
105 lines (69 loc) β’ 3.65 kB
Markdown
<p align="center">
<a href="https://github.com/esorjs/esor/wiki" target="_blank">
<img src="./assets/esor_logo.png" alt="Esor Logo" width="200" />
</a>
</p>
<p align="center"><strong>Fast, light and modern</strong></p>
<p align="center"><strong>All the power of Web Components and more in just 3 KB.</strong></p>
**Esor** is a lightweight and efficient JavaScript framework for building reactive user interfaces, leveraging native Web Components, signal-based reactivity, and an optimized templating engine.
### π₯ Main Features
- **Native Web Components:** Encapsulated components using Shadow DOM.
- **Signal-based Reactivity:** Inspired by SolidJS, with functions like `signal`, `effect`, and `computed`.
- **Declarative Templating:** Template syntax similar to lit-html.
- **Efficient DOM Reconciliation:** Optimized updates without a Virtual DOM.
- **Lifecycle & Events:** Modular hooks and event management.
- **Optimal Speed:** Performance-centric architecture.
- **Simple API:** Familiar patterns from React and SolidJS.
- **No Compilation Required.**
### π More Information
Learn more on our [Esor Website β](https://github.com/esorjs/esor/wiki).
### π Badges
[](https://www.npmjs.com/package/esor)
[](https://github.com/esorjs/esor/blob/main/LICENSE)
[](https://www.npmjs.com/package/esor)
[](https://unpkg.com/esor/dist/esor.min.js)
[](https://unpkg.com/esor/dist/esor.min.js)
[](https://www.webcomponents.org/element/esorjs/esor)
[](https://twitter.com/intent/follow?screen_name=esor_js)
[](https://discord.com/channels/1334318737704357930/1334318738140299354)
You can also check out some awesome libraries in the [awesome-esor list](https://github.com/esorjs/awesome-esor) π.
### π¦ Installation
Install Esor using npm or yarn:
```bash
npm install esor
# or
yarn add esor
```
### βοΈ Basic Usage
Below is an example of a counter using the new API:
```javascript
import { component, html, signal } from "esor";
component("my-counter", () => {
const count = signal(0);
return html`
<div>
<p>Counter: ${count()}</p>
<button onclick=${() => count(count() + 1)}>Increment</button>
</div>
`;
});
```
> **Note:**
> In the new API, the `signal` function is used to create reactive values. To retrieve the current value, call `count()`, and to update it, call `count(newValue)`.
Use it in your HTML like this:
```html
<my-counter></my-counter>
```
### π Documentation
For more detailed information about the API, please check the [official documentation](https://github.com/esorjs/esor/wiki).
### π«Άπ» Contribute
Contributions are welcome! Please review our [Contribution Guidelines](https://github.com/esorjs/esor/blob/main/CONTRIBUTING.md) before submitting a pull request.
### π License
This project is distributed under the MIT license. See the [LICENSE](https://github.com/esorjs/esor/blob/main/LICENSE) file for more details.