A JavaScript framework for composable web apps
- 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
-
Enforced state immutability
-
Minimal file size
-
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)
Use the npm version:
npm install svenjs
Build youself. Clone this repo and run
npm run build
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"))
-
svenjsx - JSX as used by SvenJS.
-
svenjsx-loader - Webpack loader for SvenJS.