[REF] owl: move metadata into __info__

This differentiate better metadata and owl exported values.  Also, and
this is the goal, it gives a space to add extra keys in the future.
This commit is contained in:
Géry Debongnie
2019-05-21 13:53:16 +02:00
parent 3d9f4e028c
commit da275e74fd
3 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -153,7 +153,7 @@ owl.utils.whenReady(startApp);`;
class App extends owl.Component { class App extends owl.Component {
constructor(...args) { constructor(...args) {
super(...args); super(...args);
this.version = owl._version; this.version = owl.__info__.version;
this.SAMPLES = SAMPLES; this.SAMPLES = SAMPLES;
this.widgets = { TabbedEditor }; this.widgets = { TabbedEditor };
@@ -349,7 +349,7 @@ class TabbedEditor extends owl.Component {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Application initialization // Application initialization
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
document.title = `${document.title} (v${owl._version})`; document.title = `${document.title} (v${owl.__info__.version})`;
document.addEventListener("DOMContentLoaded", async function() { document.addEventListener("DOMContentLoaded", async function() {
const templates = await owl.utils.loadTemplates("templates.xml"); const templates = await owl.utils.loadTemplates("templates.xml");
const qweb = new owl.QWeb(templates); const qweb = new owl.QWeb(templates);
+1 -1
View File
@@ -9,6 +9,6 @@ export default {
format: "iife", format: "iife",
name: "owl", name: "owl",
extend: true, extend: true,
outro: `exports._version = '${version}';\nexports._date = '${new Date().toISOString()}';\nexports._hash = '${git.short()}';\nexports._url = 'https://github.com/odoo/owl';` outro: `exports.__info__.version = '${version}';\nexports.__info__.date = '${new Date().toISOString()}';\nexports.__info__.hash = '${git.short()}';\nexports.__info__.url = 'https://github.com/odoo/owl';`
} }
}; };
+2
View File
@@ -17,5 +17,7 @@ export { QWeb } from "./qweb_core";
export { connect, Store } from "./store"; export { connect, Store } from "./store";
import * as _utils from "./utils"; import * as _utils from "./utils";
export const __info__ = {}
export const utils = _utils; export const utils = _utils;