Skip to content

Commit

Permalink
[REF] owl: move metadata into __info__
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ged-odoo committed May 21, 2019
1 parent 3d9f4e0 commit da275e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions extras/playground/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ owl.utils.whenReady(startApp);`;
class App extends owl.Component {
constructor(...args) {
super(...args);
this.version = owl._version;
this.version = owl.__info__.version;
this.SAMPLES = SAMPLES;
this.widgets = { TabbedEditor };

Expand Down Expand Up @@ -349,7 +349,7 @@ class TabbedEditor extends owl.Component {
//------------------------------------------------------------------------------
// Application initialization
//------------------------------------------------------------------------------
document.title = `${document.title} (v${owl._version})`;
document.title = `${document.title} (v${owl.__info__.version})`;
document.addEventListener("DOMContentLoaded", async function() {
const templates = await owl.utils.loadTemplates("templates.xml");
const qweb = new owl.QWeb(templates);
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export default {
format: "iife",
name: "owl",
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 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ export { QWeb } from "./qweb_core";
export { connect, Store } from "./store";
import * as _utils from "./utils";

export const __info__ = {}


export const utils = _utils;

0 comments on commit da275e7

Please sign in to comment.