Géry Debongnie
c7773bfd2a
[FIX] qweb/component: fix scoping issue with t-model and t-foreach
...
Without this fix, the handler set by t-model did not capture properly
the expression that needs to be updated.
closes #474
2019-11-19 13:15:34 +01:00
Géry Debongnie
bd39797f17
[FIX] component: propagate errors to caller
...
Errors from mounted/willPatch/patched should be returned to caller
(either mount or render functions)
part of #410
2019-11-18 14:29:54 +01:00
Géry Debongnie
94a595ef5b
[FIX] qweb: add support for typeof expression
...
closes #469
2019-11-18 07:57:43 +01:00
Géry Debongnie
54e1734f2f
[IMP] component: display better error message if render is empty
...
closes #446
2019-11-14 16:40:07 +01:00
Aaron Bohy
e5940b4b6b
[FIX] component: concurrent calls to mount and render
...
Closes #450
2019-11-14 15:12:31 +01:00
Géry Debongnie
bbdc9d90d7
[FIX] qweb: allow mixing body and expression variables
...
closes #445
2019-11-14 14:54:27 +01:00
Géry Debongnie
5614c85b04
[IMP] qweb: implement t-key with a directive
...
closes #331
2019-10-28 11:45:51 +01:00
Géry Debongnie
2279dafbec
[IMP] qweb: add an option to setup a translate function
...
closes #393
2019-10-28 11:32:41 +01:00
Géry Debongnie
9dfcfda365
[DOC] add more info on xml tag and single file component
...
closes #401
2019-10-26 09:10:50 +02:00
Géry Debongnie
3c38bbc076
[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
2019-10-25 16:01:52 +02:00
Aaron Bohy
9c5cad15c1
[IMP] component: refactor rendering pipeline
...
This commit introduces a brand new rendering system based on a fiber
class and a scheduler.
closes #330
2019-10-25 16:01:52 +02:00
Aaron Bohy
2beb12678e
[IMP] t-on directive: allow empty handler
...
Closes #377
2019-10-25 14:11:44 +02:00
Aaron Bohy
0ea1091692
[IMP] t-on directive: handle inline statements
...
Closes #265
2019-10-25 14:11:44 +02:00
Géry Debongnie
c2f42d3b82
[FIX] qweb: do not format expression twice in t-if
...
closes #392
2019-10-24 14:57:48 +02:00
Géry Debongnie
a3317ab997
[FIX] qweb: handle variable expressions in t-if
...
closes #390
closes #362
2019-10-24 08:55:30 +02:00
Géry Debongnie
be556a970e
[FIX] qweb: properly calls directive finalizers
...
closes #382
2019-10-22 21:56:29 +02:00
Géry Debongnie
f6d6da8393
[FIX] component: fix issues with component internal template key
...
closes #298
2019-10-21 09:41:27 +02:00
Géry Debongnie
0aeebd7b6e
[REF] utils: rename loadTemplates into loadFile
...
closes #351
2019-10-18 08:05:26 +02:00
Géry Debongnie
1d72164015
[FIX] component: support component reduced to a slot
2019-10-16 21:48:49 +02:00
Géry Debongnie
2825a5a55d
[FIX] qweb: properly handle xml comments
2019-10-15 15:47:50 +02:00
Géry Debongnie
0788d9fe75
[REF] qweb: rename Context into CompilationContext
2019-10-14 11:06:59 +02:00
Géry Debongnie
4a346d0615
[FIX] qweb: properly remove t-ref reference
...
when the node is removed from the dom
2019-10-14 11:06:59 +02:00
Géry Debongnie
3e8f60cefa
[FIX] qweb: properly handle t-raw in various situations
...
closes #325
closes #327
2019-10-14 09:59:26 +02:00
Géry Debongnie
41b0618c93
[FIX] qweb: improve generated compiled code
2019-10-11 14:10:44 +02:00
Aaron Bohy
0928c189f4
[FIX] qweb: allow to combine t-esc with other directives
...
With this rev., when a t-esc is not set on a <t> tag, we create
it inside the node on which it is set, to ensure that the t-esc
directive is always set on <t> tags.
Same applies for t-raw.
Closes #324
2019-10-11 14:10:44 +02:00
Aaron Bohy
2f27768be2
[FIX] qweb: event modifier with arg in t-foreach
...
Closes #266
2019-10-11 14:01:07 +02:00
Géry Debongnie
022b29b6a0
[IMP] component/qweb: remove t-mounted directive
...
The t-mounted directive main goals can be achieved with hooks, in a
better and more intuitive way.
closes #308
2019-10-03 10:57:24 +02:00
Géry Debongnie
5cdaa7b473
[IMP] hooks: implement useRef hook
...
closes #194
2019-09-27 11:20:08 +02:00
Géry Debongnie
5335fb8fba
[IMP] components: add hooks mechanism
...
part of #194
2019-09-27 11:20:08 +02:00
Géry Debongnie
4513e3f31c
[FIX] qweb: improved svg support for components
...
If we want to generate dynamically svg components, it is useful to be
able to define components with a <g> tag as root, and then getting the
correct namespace.
closes #302
2019-09-26 15:46:42 +02:00
Géry Debongnie
ecf12f6eee
[FIX] qweb: properly supports svg
...
Snabbdom supports svg, but it adds the namespace at the creation of the
virtual node. However, owl works slightly differently: it adds children
after creating the parent virtual node.
So, we need to actually call the addNS method after the children nodes
have been created.
As a bonus, this is slightly faster than snabbdom: we only check at
template compilation time once if a node is a svg.
2019-09-24 21:40:46 +02:00
Géry Debongnie
82a6961b3a
[FIX] component: properly handle wrapper component and slots
...
closes #297
2019-09-23 07:13:51 +02:00
Géry Debongnie
cc82b3ffcd
[IMP] component: support dynamic t-component
2019-09-21 21:58:19 +02:00
Géry Debongnie
3048c6f961
[REF] component: introduce fiber
...
part of #293
2019-09-20 10:47:55 +02:00
Géry Debongnie
8edc637033
[FIX] qweb: remove comments in xml strings before parsing
...
It was done in loadTemplates, but this does not work if we want to add
templates from another source.
2019-09-19 15:18:59 +02:00
Géry Debongnie
c9910077a4
[FIX] qweb: do not capture current qweb instance in closure
...
it is not needed, and has a bad effect on globally registered templates.
2019-09-12 23:23:55 +02:00
Géry Debongnie
9846b2e997
[IMP] tags: introduce xml tag
...
Big change! This commit introduces an xml function tag to easily define
inline templates.
This is a pretty big change toward single file owl components
Part of #284
2019-09-12 14:17:21 +02:00
Géry Debongnie
cfc2fb2ba2
[REF] qweb: rename register method to registerComponent
2019-09-12 14:17:21 +02:00
Géry Debongnie
d57017b6ed
[IMP] qweb: add registerTemplate method
2019-09-12 14:17:21 +02:00
Géry Debongnie
5bf7a5c671
[IMP] component: make template key static
...
closes #288
2019-09-12 14:17:21 +02:00
Géry Debongnie
9b589af75a
[REF] qweb: improve generated code in some cases
2019-09-12 09:43:09 +02:00
Géry Debongnie
4fc3423682
[IMP] component: support dynamic t-props
...
It is useful in some rare situations.
closes #144
2019-09-11 14:12:52 +02:00
Géry Debongnie
ffb3263c79
[IMP] component: allow dynamic root nodes
...
closes #283
2019-09-11 13:12:57 +02:00
Géry Debongnie
2a40907e35
[FIX] qweb: do not crash in some rare t-call situation
...
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.
2019-09-09 11:51:33 +02:00
Géry Debongnie
53a8841914
[TEST] component: snapshots slot functions
2019-09-05 14:33:43 +02:00
Géry Debongnie
19f0863aa3
[IMP] qweb: allow recursive templates t-calls
...
closes #267
2019-09-05 14:33:43 +02:00
Géry Debongnie
28f7b44f9e
[IMP] component: make t-model works with sub state keys
...
closes #273
2019-09-05 08:47:37 +02:00
Géry Debongnie
fe46a6ccee
[CLEANUP] run prettier on some code
2019-09-04 22:48:37 +02:00
Géry Debongnie
3c23a7b246
[FIX] component: t-model properly works with select
...
The initial value was not set on the select tag.
closes #271
2019-09-04 22:45:21 +02:00
Géry Debongnie
cfdce29ce7
[FIX] component: avoid key collisions in sub components
...
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.
2019-09-03 12:13:57 +02:00