Skip to content

js library for creating SPA easily based on components and states

License

Notifications You must be signed in to change notification settings

dyong0/spa-jquery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository is unmaintained

I recommend React + Redux + fetch with WebPack and Gulp in ES6.

SPA jQuery

Simple SPA js framework based on jQuery.

Why

It's simple and familar with jQuery users. Even you can use jQuery code in this framework.

Most front-end developers are familar with jQuery, but jQuery doesn't support architecture. Just make things possible, getting messed often. To solve this problem, some people suggest huge and new framemworks and libraries such as AngularJS, Amber, React. But learning these heavies are very tough. I suggest SPA jQuery.

What you only need are:

  • jQuery skills
  • Node.js
  • Terminal to run Node command
  • Web browser to see what's going on

Preview example

<!--UserList.html-->
<ul></ul>
<!--UserListItem.html-->
<li></li>
var SPA = require('spa-jquery');
var Component = SPA.Component;

Component.define('UserList', {
  users : [],
  
  render : function(){
    var $self = this;
    
    Component.create('UserListItem').times(this.users).then(function($userListItems){
      $userListItems.forEach(function($item){
        $item.update({
          user : user
        });
      });
      
      $self.append($userListItems);
    });
  }
});

Component.define('UserListItem', {
  user : null,
  
  render : function(){
    this.text(this.user.name);
  }
});

Component.create('UserList').then(function($userList){
  //Root component is a child of <body> generated by Component automatically
  Component.getRootComponent().append($userList);
});

Installation

$ npm install spa-jquery

Usage

Checkout Tutorial and Documents

Demo

Demo page and the source code.

How to contribute

Welcome issues and pull requests! Please create an issue before making pull requests. I'll reply asap. Also if you want to become a contributer please contact me by my email written in my github account.

About

js library for creating SPA easily based on components and states

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published