Alexandre Kühn 379cd2a90f [FIX] component: t-refs are bound/unbound at proper timing
With this commit, we make sure that bound references are removed when a
widget is removed from the DOM.

closes #59
2019-04-25 10:40:45 +02:00
2019-03-18 14:26:33 +01:00
2019-03-14 14:27:52 +01:00
2019-04-24 10:11:32 +02:00
2019-04-24 10:32:17 +02:00

🦉 Odoo Web Library 🦉

Project Overview

The Odoo Web Library (OWL) is a small UI framework intended to be the basis for the Odoo Web Client, and hopefully many other Odoo related projects. OWL's two key features are:

  • a declarative component system, with QWeb as a template engine, asynchronous rendering, and an underlying virtual dom,
  • and a store (state management solution, loosely inspired by VueX and React/Redux).

If you are interested, you can find a discussion on what makes OWL different from React and Vue here

Try it online!

An online playground is available at https://odoo.github.io/owl/playground to let you experiment with the OWL framework.

Example

Here is a short example to illustrate interactive widgets:

class ClickCounter extends owl.Component {
  inlineTemplate = `
    <button t-on-click="increment">
      Click Me! [<t t-esc="state.value"/>]
    </button>`;

  state = { value: 0 };

  increment() {
    this.state.value++;
  }
}

const qweb = new owl.QWeb();
const counter = new ClickCounter({qweb});
counter.mount(document.body);

More interesting examples can be found on the playground application.

Installing/Building

If you want to use a simple <script> tag, the last release can be downloaded here:

Some npm scripts are available:

Command Description
npm install install every dependency required for this project
npm run build build a bundle of owl in the /dist/ folder
npm run minify minify the prebuilt owl.js file
npm run test run all tests
npm run test:watch run all tests, and keep a watcher

Documentation

The complete documentation can be found here. The most important sections are:

License

OWL is GPL licensed.

S
Description
OWL: A web framework for structured, dynamic and maintainable applications
Readme LGPL-3.0 27 MiB
Languages
TypeScript 87.3%
JavaScript 12.1%
CSS 0.5%
Python 0.1%