diff --git a/README.md b/README.md index 04c4cbff..c5c26262 100644 --- a/README.md +++ b/README.md @@ -4,22 +4,29 @@ _A no nonsense web framework for structured, dynamic and maintainable applicatio ## Project Overview -The Odoo Web Library (OWL) is a smallish (~17kb gzipped) UI framework intended to be the basis for -the [Odoo](https://www.odoo.com/) Web Client. OWL's main features are: +The Odoo Web Library (OWL) is a smallish (~17kb 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_, (template based, with asynchronous rendering and a virtual dom) -- a store implementation (for state management) +- a declarative component system, +- a reactivity system based on hooks, +- a store implementation (for state management), - a small frontend router -**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. +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. ## Example Here is a short example to illustrate interactive components: ```javascript -import { Component, QWeb, useState } from 'owl' -import { xml } from 'owl/tags' +import { Component, QWeb, useState } from "owl"; +import { xml } from "owl/tags"; class Counter extends Component { static template = xml` @@ -48,12 +55,14 @@ const app = new App({ qweb: new QWeb() }); app.mount(document.body); ``` -Note that the counter component is made reactive with the [`useState` hook](doc/hooks.md#usestate). +Note that the counter component is made reactive with the [`useState`](doc/hooks.md#usestate) +hook. Also, all examples here uses the `xml` helper 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. -## OWL's Design Principles +## 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. @@ -82,7 +91,7 @@ The complete documentation can be found [here](doc/readme.md). The most importan - [Quick Start](doc/quick_start.md) - [Component](doc/component.md) -- [QWeb](doc/qweb.md) +- [Hooks](doc/hooks.md) Found an issue in the documentation? A broken link? Some outdated information? Submit a PR! @@ -96,15 +105,154 @@ If you want to use a simple `