The document discusses the Odoo JS Framework and introduces a new framework called Owl. It summarizes that Owl is a standalone framework for building components with a declarative syntax. It benchmarks Owl against other frameworks like React and Vue, finding Owl to be 3x faster than Odoo widgets and comparable in performance to React and Vue. The document promotes Owl as the new Javascript framework for Odoo starting in version 14.
Owl Javascript Framework
●standalone framework
● declarative component system
● class based
● based on QWeb Engine
● no nonsense
https://odoo.github.io/owl/
19.
Component
Example
import { Component,useState } from 'owl'
import { xml } from 'owl/tags'
class Counter extends Component {
static template = xml`
<button t-on-click="increment">
Click Me! [<t t-esc="state.value"/>]
</button>`;
state = useState({ value: 0 });
increment() {
this.state.value++;
}
}
20.
import { Component} from 'owl'
import { xml } from 'owl/tags'
import { Counter } from './Counter'
class App extends Component {
static template = xml`
<div>
<span>Hello Owl</span>
<Counter t-if="state.flag"/>
</div>`;
static components = { Counter };
state = useState({ flag: true });
}
Composition