🦉 Odoo Web Library 🦉

_A no nonsense web framework for structured, dynamic and maintainable applications_ ## Project Overview The Odoo Web Library (OWL) is a smallish (~18kb gzipped) UI framework intended to be the basis for the [Odoo](https://www.odoo.com/) Web Client. Owl is a modern framework, written in Typescript, taking the best ideas from React and Vue in a simple and consistent way. Owl's main features are: - a declarative component system, - a reactivity system based on hooks, - a store implementation (for state management), - a small frontend router Owl components are defined with ES6 classes, they use QWeb templates, an underlying virtual dom, integrates beautifully with hooks, and the rendering is asynchronous. **Try it online!** An online playground is available at [https://odoo.github.io/owl/playground](https://odoo.github.io/owl/playground) to let you experiment with the Owl framework. There are some code examples to showcase some interesting features. Owl is currently mostly stable. Possible future changes are explained in the [roadmap](roadmap.md). ## Example Here is a short example to illustrate interactive components: ```javascript const { Component, QWeb, useState } = owl; const { xml } = owl.tags; class Counter extends Component { static template = xml` `; state = useState({ value: 0 }); } class App extends Component { static template = xml`
Hello Owl
`; static components = { Counter }; } const app = new App({ qweb: new QWeb() }); app.mount(document.body); ``` Note that the counter component is made reactive with the [`useState` hook](doc/reference/hooks.md#usestate). Also, all examples here uses the [`xml` helper](doc/reference/tags.md#xml-tag) to define inline templates. But this is not mandatory, many applications will load templates separately. More interesting examples can be found on the [playground](https://odoo.github.io/owl/playground) application. ## Design Principles OWL is designed to be used in highly dynamic applications where changing requirements are common and code needs to be maintained by large teams. - **XML based**: templates are based on the XML format, which allows interesting applications. For example, they could be stored in a database and modified dynamically with `xpaths`. - **templates compilation in the browser**: this may not be a good fit for all applications, but if you need to generate dynamically user interfaces in the browser, this is very powerful. For example, a generic form view component could generate a specific form user interface for each various models, from a XML view. - **no toolchain required**: this is extremely useful for some applications, if, for various reasons (security/deployment/dynamic modules/specific assets tools), it is not ok to use standard web tools based on `npm`. Owl is not designed to be fast nor small (even though it is quite good on those two topics). It is a no nonsense framework to build applications. There is only one way to define components (with classes). If you are interested in a comparison with React or Vue, you will find some more information [here](doc/comparison.md). ## Documentation A complete documentation for Owl can be found here: - [Main documentation page](doc/readme.md). The most important sections are: - [Quick Start](doc/quick_start.md) - [Component](doc/reference/component.md) - [Hooks](doc/reference/hooks.md) Found an issue in the documentation? A broken link? Some outdated information? Submit a PR! ## Installing/Building If you want to use a simple `