[REF] component: large cleanup of concurrency branch

We remove here old comments, add some tests and documentation, and in
general, make sure the state of the code is in a good shape

part of #330
This commit is contained in:
Géry Debongnie
2019-10-24 21:20:52 +02:00
parent 9c5cad15c1
commit 3c38bbc076
14 changed files with 530 additions and 442 deletions
@@ -13,7 +13,6 @@ exports[`RouteComponent can render simple cases 1`] = `
if (context['routeComponent']) {
//COMPONENT
let key3 = 'key' + context['env'].router.currentRouteName;
let def1;
let templateId2 = \`__4__\` + key3;
let w2 = templateId2 in parent.__owl__.cmap ? parent.__owl__.children[parent.__owl__.cmap[templateId2]] : false;
let vn5 = {};
@@ -23,24 +22,24 @@ exports[`RouteComponent can render simple cases 1`] = `
w2.destroy();
w2 = false;
}
if (!w2) {
if (w2) {
w2.__updateProps(props2, extra.fiber, undefined, undefined, sibling);
let pvnode = w2.__owl__.pvnode;
utils.defineProxy(vn5, pvnode);
} else {
let componentKey2 = \`routeComponent\`;
let W2 = context.constructor.components[componentKey2] || QWeb.components[componentKey2]|| context['routeComponent'];
if (!W2) {throw new Error('Cannot find the definition of component \\"' + componentKey2 + '\\"')}
w2 = new W2(parent, props2);
parent.__owl__.cmap[templateId2] = w2.__owl__.id;
def1 = w2.__prepare(extra.fiber, undefined, undefined, sibling);
let def1 = w2.__prepare(extra.fiber, undefined, undefined, sibling);
let pvnode = h('dummy', {key: templateId2, hook: {insert(vn) { let nvn=w2.__mount(fiber, pvnode.elm);pvnode.elm=nvn.elm;},remove() {},destroy(vn) {w2.destroy();}}});
const fiber = w2.__owl__.currentFiber;
def1.then(function () {if (w2.__owl__.isDestroyed) {return;} const vnode = fiber.vnode; pvnode.sel = vnode.sel; });
utils.defineProxy(vn5, pvnode);
w2.__owl__.pvnode = pvnode;
} else {
def1 = def1 || w2.__updateProps(props2, extra.fiber, undefined, undefined, sibling);
let pvnode = w2.__owl__.pvnode;
utils.defineProxy(vn5, pvnode);
}
sibling = w2.__owl__.currentFiber;
sibling = w2.__owl__.currentFiber || sibling;
}
return result;
}"