hussar
v0.0.6
Published
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
Readme
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:
- https://github.com/DanielMazurkiewicz/hussar/blob/main/docs/src/components/filter.mjs
- https://github.com/DanielMazurkiewicz/hussar/blob/main/docs/src/components/method.mjs
