@glibjs/core v0.4.0-alpha.5
Features
- Virtual DOM
- Components
- Fast performance
- Easy to use
- Scalable
- Typescript support
Instalation
You can install it from npm
npm install @glibjs/core @glibjs/elements
or clone the template to get started immediately
git clone https://github.com/glibjs/template.git && cd template && npm install
Ecosystem
Module | Status | Description |
---|---|---|
elements | Declaratives HTML elements | |
router | Declaratives Routes for SPA |
Examples
Let's create a heading in a container
import Glib from "@glibjs/core";
import { h1 } from "@glibjs/elements";
Glib.start(h1("Hello world"), document.getElementById("root"));
as you saw glib it is very easy to use, now let's create a component.
import Glib, { createComponent, watch, onMounted } from '@glibjs/core';
import { h1 } from "@glibjs/elements";
const Clock = createComponent(() => {
const state = watch({ seconds: 0 });
onMounted(() => {
setInterval(() => state.seconds++, 1000);
});
return () => (
h1(`Component created ${state.seconds} seconds ago`);
)
});
Glib.start(Clock(), document.getElementById("root"));
this component shows the seconds since it was mounted
if you notice, the component updates automatically when it detects a change
More examples are comming soon.
Motivation
I love SwiftUI, React, and Vue, which is why I decided to create my own framework that brought together the 3 best features.
FAQ
Why didn't you use JSX? Because i dont like working with 'HTML Syntax' inside javascript and i like how SwiftUI works with Elements or 'Components' as if they were functions
License
glib is MIT licensed
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago