Aaron Bohy
5731358607
[IMP] component: expose scheduler instance
...
Closes #433
2019-11-05 15:11:13 +01:00
Géry Debongnie
8d1dd06340
[IMP] component: error when mounted on invalid target
2019-11-04 08:41:29 +01:00
Géry Debongnie
2413c98f50
[REF] component: small optimization in rare cases
...
When we have default props, we do not need to allocate a new
props object and copy it. This commit simply modify the props
object in place, which is fine, since the props object is always
a new one any way, generated by the directive.
2019-11-01 09:03:30 +01:00
Géry Debongnie
d74b5a03db
[IMP] component: add props on root components
...
This is a partial revert of commit 7d249d6f09 .
The reason is that this changes made it much harder to unit test
components. Before, we could simply instantiate a component
like this:
const my|Comp = new MyComponent(null, props);
and then simply test it. This commit reestablish that possibility.
2019-11-01 09:03:27 +01:00
Géry Debongnie
83532db48f
[DOC] adapt documentation to env changes
...
part of #430
2019-11-01 09:03:27 +01:00
Géry Debongnie
534152eff7
[REF] component: small improvement
...
and run prettier
2019-11-01 08:39:35 +01:00
Aaron Bohy
05a678c039
[IMP] component: get env from constructor
...
closes #430
2019-11-01 08:39:35 +01:00
Aaron Bohy
7d249d6f09
[IMP] component: do not set props in root components
...
Also remove props from Fiber, as it was not useful anymore.
2019-10-30 15:09:10 +01:00
Aaron Bohy
9106c19066
[IMP] component: simplify constructor API
...
It now takes two arguments: parent (optional, only for non-root
components) and props (optional). In the case of the root component,
the env is taken from the config (config.defaultEnv). If it doesn't
exists, the default env is created on the fly.
Closes #306
2019-10-30 15:09:10 +01:00
Aaron Bohy
9e37b968e8
[FIX] component: error handling: rendering with sub components
...
Closes #425
2019-10-30 13:27:48 +01:00
Géry Debongnie
9edf29a3a1
[IMP] context: group components by depth
...
closes #399
2019-10-29 16:02:51 +01:00
Aaron Bohy
5d57a7bf13
[FIX] component: updateProps: validation and default values
...
Before this rev., default values weren't taken into account when
validating props whenever a component was updated. Moreover, there
was no test attesting that props were validated at update.
2019-10-28 11:32:43 +01:00
Géry Debongnie
4ebe419c56
[FIX] component: make sure props are validated in all cases
...
closes #379
2019-10-28 11:32:43 +01:00
Géry Debongnie
9cee12d7b4
[IMP] component: propagate error to mount and render
2019-10-28 11:32:43 +01:00
Géry Debongnie
2c563ee380
[REF] component: move error handling into the fiber
2019-10-28 11:32:43 +01: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
Géry Debongnie
2825a5a55d
[FIX] qweb: properly handle xml comments
2019-10-15 15:47:50 +02:00
Géry Debongnie
1337aa0107
[IMP] component: add current key for easier hook creation
...
closes #319
2019-10-14 10:25:34 +02:00
Géry Debongnie
41b0618c93
[FIX] qweb: improve generated compiled code
2019-10-11 14:10:44 +02:00
Géry Debongnie
07dac970f7
[IMP[ component/hooks: add onWillStart and onWillUpdateProps
2019-10-09 15:09:26 +02:00
Géry Debongnie
cedb1f411f
[REF] component: move template check in constructor
2019-10-08 13:51:55 +02:00
Géry Debongnie
683993dbc4
[FIX] component/hooks: onWillUnmount was not properly called
2019-10-07 16:01:28 +02:00
Géry Debongnie
c3453d35b9
[IMP] hooks/component: remove updateEnv, add useSubEnv
...
closes #182
2019-10-04 22:54:27 +02:00
Géry Debongnie
b0dd0252a4
[REF] component: move method at proper place
2019-10-04 22:54:27 +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
367725d194
[IMP] hooks: add onWillPatch and onPatched
...
This commit also changes the behaviour of willPatch and patched: they no
longer transfer data from one to the other, because it can be done
cleanly by hooks and a closure.
closes #307
2019-10-03 10:20:28 +02:00
Géry Debongnie
f6820bb8ac
[REF] hooks: better implementation of onMounted/onWillUnmount
2019-09-28 21:14:40 +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
bbbaf95c8e
Merge pull request #296 from odoo/issue-293-owl-fibers
...
[MERGE] component: introduce owl fiber
2019-09-20 13:54:59 +02:00
Géry Debongnie
caa63628dc
[REF] component: refactor fiber creation methods
2019-09-20 11:14:50 +02:00
Géry Debongnie
7a49b9d94e
[REF] component: move render props and promise to fiber
...
part of #293
2019-09-20 10:48:10 +02:00
Géry Debongnie
01eb338e69
[REF] component: move patchqueue management to fiber
...
part of #293
2019-09-20 10:47:58 +02:00
Géry Debongnie
3048c6f961
[REF] component: introduce fiber
...
part of #293
2019-09-20 10:47:55 +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
e1acf66143
[IMP] component: components key is now static
...
This is a breaking change!
closes #279
2019-09-11 11:18:49 +02:00
Géry Debongnie
e6a3ede4a6
[FIX] component: improve unmount/remount behaviour
2019-08-28 11:41:10 +02:00
Géry Debongnie
9b3a97e732
[DOC] component: improve internal documentation
2019-08-26 12:19:11 +02:00
Géry Debongnie
9843d16585
[REF] component: improve render method
2019-08-26 10:31:11 +02:00
Géry Debongnie
e690991a6a
[FIX] component: better heuristic to determine if was mounted
2019-08-22 14:55:31 +02:00
Géry Debongnie
9754cc7521
[REF] small cleanup
2019-08-22 14:26:34 +02:00
Géry Debongnie
ca920a0091
[ADD] router: initial implementation
2019-08-22 14:26:34 +02:00
Géry Debongnie
e5b1ba24d8
[IMP] component: allow multiple mount/unmount
...
closes #258
2019-08-22 14:23:08 +02:00
Géry Debongnie
fd0fb5be00
[REF] observer: refactor observer using proxy
...
closes #253
2019-08-22 14:22:20 +02:00
Géry Debongnie
f18c73e59f
[FIX] component: solve a tricky concurrency rendering issue
...
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.
2019-07-30 08:54:55 +02:00
Géry Debongnie
93d0a7dd46
[FIX] store: properly handle defaultProps in connected components
...
Thanks to aku for issue + tests + first solution
closes #245
2019-07-16 20:51:57 +02:00
Géry Debongnie
5382e824b1
[REF] owl: reorganize src code in sub files
2019-07-16 13:12:08 +02:00