Files
owl/doc/tooling.md
T

59 lines
2.1 KiB
Markdown
Raw Normal View History

2019-05-21 14:11:40 +02:00
# 🦉 Tooling 🦉
2019-06-09 17:25:14 +02:00
## Content
2019-06-09 16:56:27 +02:00
2019-06-09 17:25:14 +02:00
- [Overview](#overview)
- [Development Mode](#development-mode)
- [Playground](#playground)
- [Benchmarks](#benchmarks)
2019-06-09 16:56:27 +02:00
2019-06-09 17:25:14 +02:00
## Overview
2019-06-09 16:56:27 +02:00
2019-06-09 17:25:14 +02:00
To help work with/improve/learn OWL, there are a few extras tools/settings.
2019-06-09 16:56:27 +02:00
2019-06-09 17:25:14 +02:00
- development mode: enable better error reporting for the developer
- a playground application: a space to experiment and learn Owl.
- a benchmarks application: allow comparison with a few common frameworks
2019-06-09 16:56:27 +02:00
2019-06-09 17:25:14 +02:00
The two applications are available in the `tools/` folder, and can be accessed
by using a static http server. A simple python
server is available in `server.py`. There is also a npm script to start it:
`npm run tools` (and its version with a watcher: `npm run tools:watch`).
2019-05-21 14:11:40 +02:00
2019-06-09 17:25:14 +02:00
## Development Mode
By default, Owl is in _production_ mode, this means that it will try to do its
job fast, and skip some expensive operations. However, in some cases, it is
2019-05-21 14:11:40 +02:00
convenient to have better information on what is going on, this is the purpose
of the dev mode.
2019-06-09 17:25:14 +02:00
Owl has a mode flag, in `owl.__info__.mode`. Its default value is `prod`, but
2019-05-21 14:11:40 +02:00
it can be set to `dev`:
```js
2019-06-09 17:25:14 +02:00
owl.__info__.mode = "dev";
2019-05-21 14:11:40 +02:00
```
Note that templates compiled with the `prod` settings will not be recompiled.
2019-06-09 16:56:27 +02:00
So, changing this setting is best done at startup.
An important job done by the `dev` mode is to validate props for each component
2019-09-11 14:01:49 +02:00
creation and update. Also, extra props will cause an error.
2019-06-09 17:25:14 +02:00
## Playground
The playground is an important application designed to help learning and
experimenting with Owl. The last published version of Owl can be tested [online](https://odoo.github.io/owl/playground/).
It is an application similar to `jsFiddle`, but specialized for Owl: there are
three tabs (`js`, `css` and `xml`), and a simple button `Run` to execute that
code in an iframe.
2019-06-09 16:56:27 +02:00
## Benchmarks
2019-06-09 17:25:14 +02:00
Note: This is more an internal tool, useful for people working on Owl.
2019-06-09 16:56:27 +02:00
The benchmarks application is a very small application, implemented in different
2019-06-09 17:25:14 +02:00
frameworks, and in different versions of Owl. This is a simple internal tool,
2019-06-09 16:56:27 +02:00
useful to compare various performance metrics on some tasks.