Skip to content

8eecf0d2/jagwah

Repository files navigation

Jagwah

Travis CI badge Codeclimate maintainability Greenkeeper badge Bundlephobia minified badge Bundlephobia minified zipped badge

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();

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 hello world with jagwah

Credits

All of the really hard work was done by WebReflection and the contributors of hyperHtml.

About

🐱 Small web application framework for HyperHTML

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published