cakejs2-spatial v0.0.24
CakeJS2 lightweight front-end framework with only best parts and features of most awesome frameworks.
Features
- All in one
- Dependency management
- Live rendering (+ virtual dom)
- Good performance
- JSX support
- Small error stack trace (?)
- Small size and codebase (about 23kb)
- ES5 support (Yeah!)
- Very easy to learn
Candle counter recipe:
create().route('/', 'counter');
Cream.extend({
_namespace : 'counter',
candles : 0,
increment : function() {
this.set('candles', this.candles + 1);
},
render : function() {
return h('button', { onClick : this.increment }, 'Candles on the Cake: ' + this.candles);
}
});To enable JSX support, transpiler option have to be provided that names defaults with h (hyperscript) instead of react:
/** @jsx h */Examples
Live demos:
Check out examples folder.
Installation
npm install cakejs2CDN
https://unpkg.com/cakejs2@latest/dist/cake.min.jsAPI
h- next
- register
- unregister
- inject
createCream
create options:
create({
element : document.body // by default
elementClass : cake
elementId : cake
createRoot : false // do not create root node, use render'sroute:
create().route(
'/posts/:id/post', // URL pattern, also available "*" pattern
'home' // Namespace of the component
);Namespaces
Cream
Base component of any cake.
Functions:
initwillTransitiondidTransitionrender
Options:
_namespsace- object's namespace_after- DI after
Zefir:
props- routing options (/:id/for an instance becameprops.id)params- params eg?iam=parambacameparams.iam
Sugar:
observesproperty- computed property
observes creates observer function
dataWatcher : function() { .... }.observes('posts', /^store/)History
Cakejs2 is a second generation of the cakejs framework.
First version of cakejs were made in 2012th and published in 2014th.
License
MIT License
Copyright (c) 2016 Svetlana Linuxenko
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago

