Juris is radical way of buildind web app, freeing you from all the heavy tooling.
If you want you can only use Vi and Notepad nothing more.
<!DOCTYPE html>
<html>
<head>
<title>Juris.js Counter Demo</title>
<script src="https://unpkg.com/juris@0.8.0/juris.js"></script>
</head>
<body>
<div id="app"></div>
<script>
const Counter = (props, context) => ({
div: {
children: [
{ button: {
text: '-',
onclick: () => context.setState('count', context.getState('count') - 1)
}},
{ button: {
text: '+',
onclick: () => context.setState('count', context.getState('count') + 1)
}}
]
}
});
const Display = (props, context) => ({
div: {
className: 'display',
text: () => props.count()
}
});
const juris = new Juris({
states: {
count: 0
},
components: {
Counter: Counter,
Display: Display
},
layout: {
div: {
children: [
{ Display: { count: () => juris.getState('count') } },
{ Counter: {} }
]
}
}
});
juris.render('#app');
</script>
</body>
</html>