jagwah
v0.0.17
Published
Wrapper for the awesome hyperHtml renderer written in Typescript.
Downloads
13
Readme
Jagwah
Jagwah (pronounced /dʒægwæh/) is a tiny web application framework built with hyperHtml & Typescript.
Getting Started
Install with yarn or npm
yarn add jagwah
Import and start using
import { Jagwah } from 'jagwah';
const jagwah = new Jagwah({
providers: [ ... ],
templates: [ ... ]
});
jagwah.start();
Documentation
All of the documentation can be found in the github wiki, it's not perfectly up to date with the latest changes but provides a good overview. Organizing and validating documentation is the focus of minor release 0.1.0
.
All examples are stored in the examples
branch
Overview
Jagwah wraps around hyperHtml to provide a simple API for building web applications with Routes, Templates, Dependency Injection and a few other things. It's intended for use with Typescript but works equally as well with Javascript, not abstracting too far away from core language features.
Example
Below is a really simple example of jagwah, it uses a single Template without Providers or Routes.
main.ts
import { Jagwah, Selector } from 'jagwah';
const jagwah = new Jagwah();
@Selector('#hello-world')
class HelloWorldTemplate {
constructor() {}
public render(render: Jagwah.Template.render) {
return render`
<h1>Hello World</h1>
`;
}
}
jagwah.Template(HelloWorldTemplate);
jagwah.update();
main.js
(javascript alternative)
import { Jagwah } from 'jagwah';
const jagwah = new Jagwah();
function HelloWorldTemplate() {}
HelloWorldTemplate.$selector = '#hello-world';
HelloWorldTemplate.prototype.render(render) {
return render`
<h1>Hello World</h1>
`;
}
jagwah.Template(HelloWorldTemplate);
jagwah.update();
index.html
<body>
<div id="hello-world"></div>
</body>
result.png
Credits
All of the really hard work was done by WebReflection and the contributors of hyperHtml.