2.0.0 • Published 8 years ago

svenjs v2.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

SvenJS

A JavaScript framework for composable web apps

Demos

Releases

  • 2.0.2: ES modules, bug fixes and more!
  • 0.3.2: Added _beforeMount life cycle method.
  • 0.3.1: Added composition (importing components and referencing them in JSX by name). For instance: const SecondComponent = require("SecondComponent"). Referenced in render like this:
  • 0.3.0: Renamed life cycle methods. New names: _didMount & _didUpdate

Features

  • Enforced state immutability

  • Minimal file size

Goals

  • Can be used in a browser script tag (almost there)

  • A web library that enables you to write code that can be accessed both serverside and clientside

  • Built in store implementation (todo)

Install

Use the npm version:

  npm install svenjs

Build youself. Clone this repo and run

  npm run build

How to use

import SvenJs from "svenjs";

SvenJs.create({
    initialState: {
        clicks: 0
    },
    render() {
    const clickFunc = () =>{
      let clicks=this.state.clicks;
      this.setState({clicks: ++clicks });
    }
    return (<div id="row">
            <h3>The Click App</h3>
            <div>
              <button onClick={clickFunc}>Click me?</button>
            </div>
        <div>
            <h3>Click stats</h3>
          <p>You have clicked on the button {this.state.clicks} times</p>
        </div>
    </div>)
    }
});
SvenJs.render(App, document.getElementById("app"))

Related Modules

2.0.0

8 years ago

1.0.0

10 years ago

0.3.3

10 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago