2019-03-14 12:51:19 +01:00
**Warning!**
2019-01-16 13:19:58 +01:00
2019-03-14 12:51:19 +01:00
This is currently a proof of concept, definitely not a production-ready codebase.
We hope to use it in the Odoo web client soon.
2019-01-16 13:19:58 +01:00
2019-03-14 12:51:19 +01:00
---
2019-01-17 10:49:57 +01:00
2019-03-14 12:51:19 +01:00
# Core Utility for Odoo Web Client
2019-01-17 18:08:39 +01:00
2019-03-14 12:51:19 +01:00
## Overview
2019-01-28 10:59:46 +01:00
2019-03-14 12:51:19 +01:00
This repository contains some useful building block for building web applications.
We made some efforts to make sure the code is reusable and generic. However, since this is the basis for the Odoo web client, we will not hesitate to design
the code here to better match the Odoo architecture/design principles.
2019-01-28 10:59:46 +01:00
2019-03-14 12:51:19 +01:00
Currently, this repository contains:
2019-01-28 10:59:46 +01:00
2019-03-14 12:51:19 +01:00
- some utility functions/classes
- an implementation/extension of the QWeb template engine that outputs a virtual
dom (using the snabbdom library)
- a Component class, which uses the QWeb engine as its underlying rendering
mechanism. The component class is designed to be declarative, with
asynchronous rendering.
2019-01-28 10:59:46 +01:00
2019-03-14 12:51:19 +01:00
In the future, this repository may includes other features. Here are some possible
ideas:
2019-01-28 10:59:46 +01:00
2019-03-14 12:51:19 +01:00
- a (frontend) router could be included.
- a store base class (as in the flux/redux architecture)
2019-01-28 15:51:20 +01:00
2019-03-14 12:51:19 +01:00
Note: the code is written in typescript. This does not mean that the main web
client will ever be converted to typescript (even though I would really like it).
2019-01-29 15:19:02 +01:00
2019-03-14 12:51:19 +01:00
## Web client demo
2019-01-31 10:55:06 +01:00
2019-03-14 12:51:19 +01:00
To test and play with the component class, there is a demo application located
in the _ demo/ _ folder. It is a rethink of what the web client could look like
if it is ever rebuilt from scratch. It is currently an experiment. But
obviously, we hope someday to be able to use this work and actually rewrite
completely the odoo web client.
2019-02-03 15:05:53 +01:00
2019-03-14 12:51:19 +01:00
## Main scripts
2019-03-03 11:06:50 +01:00
2019-03-14 12:51:19 +01:00
To install every dependency needed to play with this code:
2019-03-03 11:06:50 +01:00
2019-03-14 12:51:19 +01:00
```
npm install
```
2019-03-03 11:06:50 +01:00
2019-03-14 12:51:19 +01:00
To build a bundle of this as a library:
2019-03-03 11:06:50 +01:00
2019-03-14 12:51:19 +01:00
```
npm run build
```
2019-03-03 11:06:50 +01:00
2019-03-14 12:51:19 +01:00
To run tests:
2019-03-03 11:06:50 +01:00
2019-03-14 12:51:19 +01:00
```
npm run test
npm run test:watch
```
2019-03-03 11:06:50 +01:00
2019-03-14 12:51:19 +01:00
To play with the demo application:
2019-03-03 11:06:50 +01:00
2019-03-14 12:51:19 +01:00
```
npm run demo:build # make a build in dist/app/
npm run demo:dev # make a build in dist/app/, and make a live server to access it
```
2019-03-03 11:06:50 +01:00
2019-03-14 12:51:19 +01:00
The _ demo:dev _ task will build the app (without minification), then start a live-server with hot-reloading, and watch the file system to make sure
that assets are properly rebuilt if necessary, and then reloaded.
2019-03-03 11:06:50 +01:00
2019-03-14 12:51:19 +01:00
## Documentation
2019-03-03 11:06:50 +01:00
2019-03-14 14:12:51 +01:00
- [Quick Start ](doc/quick_start.md )
- [Component ](doc/component.md )
- [QWeb ](doc/qweb.md )