0.4.0-alpha.5 • Published 4 years ago

@glibjs/core v0.4.0-alpha.5

Weekly downloads
21
License
MIT
Repository
github
Last release
4 years ago

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

ModuleStatusDescription
elementsnpmDeclaratives HTML elements
routernpmDeclaratives 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

0.4.0-alpha.5

4 years ago

0.4.0-alpha.4

4 years ago

0.4.0-alpha.2

4 years ago

0.4.0-alpha.1

4 years ago

0.4.0-alpha.0

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.8

4 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.2.2

4 years ago

0.1.0

4 years ago