Skip to content

Latest commit

 

History

History
87 lines (67 loc) · 2.24 KB

README.md

File metadata and controls

87 lines (67 loc) · 2.24 KB

Hussar - Framework for developers that wants to work with JavaScript only

hussar-logo
Framework for those who would like to stick to JS only (no HTML nor CSS)
and produce relatively fast and fairly small sized web apps.

https://danielmazurkiewicz.github.io/hussar/

Submit an Issue

Goals of this framework

  • Pure JavaScript only, everything is a valid JavaScript code
  • Produce small output code
  • Produce fast output code
  • Currently no external dependencies and keeping it that way
  • No need for additional transpillers or compillers, only a bundler necesarry

NOTE

This is Work In Progress (WIP), anything might be subject of change at any time.

At current stage it starts to be usable:

  • you can create components
  • you can create and attach styles
  • you can do two-way bindings
  • you can use efficient lifecycle events
  • there are included libraries with usefull generic JS functionalities

Examples:

"static" components

import { body, div, span } from 'hussar/core.mjs';

// === DATA ===
const list = [
    {name: "John", surname: "Kowalski"},
    {name: "Andrew", surname: "Nowak"}
];

// === STYLES ===
const surnameStyle = style({
    text: {
        color: 'blue'
    }
});

// === COMPONENTS ===
const nameSurname = ({name, surname}) =>
    div(
        'Name and surname: ', name, span(surnameStyle, surname)
    );

const namesList = list =>
    div(
        ...list.map(nameSurname)
    );

// === MAIN ===
body(
    namesList(list)
);

Documentation

Documentation is available here (also a VERY WIP version at the moment): https://danielmazurkiewicz.github.io/hussar/

Documentation itself uses this framework so for now it can give you a glympse of how to use it. Look especially at these files: