A lightweight JavaScript component framework
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs Minor update of doc Dec 22, 2017
src Simplified syntax to use es6, removed Inheritable and added babel Dec 22, 2017
.gitignore Put a webpack configuration Dec 21, 2017
.npmignore Small corrections above 2.0.0-rc1 Dec 22, 2017
.travis.yml 2.0.0-rc1 Dec 22, 2017
LICENSE Create LICENSE Feb 28, 2018
README.md
package-lock.json forgot lock Dec 22, 2017
package.json 2.0.0 Dec 22, 2017
test.js Added tests with legado Dec 22, 2017
webpack.config.js Simplified syntax to use es6, removed Inheritable and added babel Dec 22, 2017

README.md

widgetjs

Build Status npm

A lightweight JavaScript component framework

widgetjs is a lightweight framework in JavaScript to separate web applications in multiples reusable components called widgets.

import {Widget} from "widgetjs";

class MyWidget extends Widget {
    constructor() {
        super();
        this.el.innerHTML = "<h1>Welcome to widgetjs!</h1>";
        this.on("dom:click h1", function() {
            window.location = "http://widgetjs.neoname.eu";
        });
    }
}

new MyWidget().appendTo(document.body);
  • Uses simple class inheritance.
  • Provides an events system separate from the DOM.
  • Provides life-cycle management for visual components.
  • Can be used with or without jQuery.

Read the documentation here

widgetjs is not a full featured framework that can handle all aspects of a web application like network communications or routing, there already exists good libraries for that. widgetjs only handles one aspect of web development: separation of visual components into independant entities. So it provides only features to serve that goal, namely widgets, events and lifecycle management.

To install:

npm install widgetjs

Or download it on https://unpkg.com/widgetjs/

License: MIT

Supported browsers: All major browsers as well as IE down to IE9.