Before this commit, QWeb crashed when it had to deal with a t-call with
multiple sub nodes on the same line, and one text node:
<t t-call="SomeTemplate">
<span>hey</span> <span>hey</span>
</t>
This was because we need to compile the content to be able to extract
all possible t-set t-value statements. But doing so means that we had a
multiple root templates, which caused a crash in this case.
Solving this issue is simple: the sub template is compiled with the flag
allowMultipleRoots set to true.
This is a tricky bug. The problem is that a ConnectedComponent can
trigger a rendering before it is aware that there is a state change in
the store, and just before the store update event comes in.
What we do in this commit is to update the storeProps whenever a
rendering is scheduled. However, we need to keep the rendering
information as a promise to give it in some case to the __checkUpdate
method (see the note in the render method)
closes#268
Of course, the templateId computation is kind of tricky. Here, an issue
occurred because the templateId did not take the componentId into
account when we were in a loop, but with no keyed parent.
This meant that multiple sub components shared the same templateId,
confusing the vdom algorithm.
This is a difficult part of owl: we need to be able to reconcile the
vdom generated (this is done with our virtual dom algorithm), but also
to be able to reconcile the proper components.
The issue here is that when we are in a list, with a t-key attribute on all
list nodes, and those list nodes contains sub component, then the
component system used the index of the list, and did not take into
account the key from the parent. The fix is to keep track of the
current key in the context, and uses that as a part of the templateId.
Before this commit, hashchanges were not taken into account by the
router, if used in history mode.
Also, it's stupid, but i ran prettier on the codebase
When components were initially rendered more than once, in consecutive
microtask ticks, the order of two actions was reversed: the assignation
of the vnode to the __owl__.vnode property, and the assignation of
__owl__.vnode to the final rendered vdom of the component.
As a result, the widget was rendered as null (so, not present).
The reason for this issue was that the renderPromise key was reassigned
at some point.
This is a breaking change. Code using Observer, EventBus, Store or
ConnectedComponent need to update the way they import theses classes.
- Observer is now in owl.misc (so you can import it like this:
const Observer = owl.misc.Observer;)
- EventBus is also now in owl.misc
- Store and ConnectedComponent are now together in store