Skip to content

🍰 lightweight front-end framework with only best parts and features of most awesome frameworks.

License

Notifications You must be signed in to change notification settings

linuxenko/cakejs2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CakeJs

CakeJS2 is a lightweight front-end framework which borrows most awesome features from others.

New features

  • Virtual-dom merged into a source tree
  • No dependencies
  • SVG support (partial)

Features

For example: a 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);
  }
});

Hyperscript is an requirement:

/** @jsx h */

More examples

Live demos:

Check out examples folder.

Installation

To install latest version, the repository archive could be used:

https://notabug.org/hofuku/cakejs2/archive/master.zip

CDN

None yet

Deprecated:

https://unpkg.com/cakejs2@latest/dist/cake.min.js

API

create options:

create({
  element      : document.body // by default
  elementClass : cake
  elementId    : cake
  createRoot   : false        // do not create root node, use render's

route:

create().route(
 '/posts/:id/post',  // URL pattern, also available "*" pattern
 'home'             // Namespace of the component
 );

Namespaces

Namespaces

Cream is a base component of a cake.

Functions:

  • init
  • willTransition
  • didTransition
  • render

Options:

  • _namespsace - object's namespace
  • _after - DI after

Zefir:

  • props - routing options ( /:id/ for an instance became props.id )
  • params - params eg ?iam=param bacame params.iam

Sugar:

  • observes
  • property - computed property

observes creates observer function

  dataWatcher : function() { .... }.observes('posts', /^store/)

History

  • [2022] Forked to became a general development version for now. notabug
  • [2016] Cakejs2 is a second generation of the cakejs framework origin
  • [2012] First version of cakejs were made and published in 2014th.

License

MIT License

Copyright (c) 2016 Svetlana Linuxenko

About

🍰 lightweight front-end framework with only best parts and features of most awesome frameworks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published