Géry Debongnie
4e982f5460
[IMP] qweb: add warning if t-key is missing in some cases
...
closes #71
2019-05-03 10:22:57 +02:00
Géry Debongnie
6350d9598d
[REF] qweb, component: small code refactoring
2019-05-02 10:58:47 +02:00
Géry Debongnie
40e486a9eb
[REF] component: remove updateProps
...
it is actually now a private method
2019-04-29 16:50:49 +02:00
Géry Debongnie
e56580efb2
[FIX] component: call willPatch/patched hooks properly
...
Each component called its hooks properly individually, however the issue
was that it was done component by component. However, in practice, we
want the willPatch hooks to be done before ANY patch is actually
performed, and the patched should be called AFTER every patch is
applied.
The trick is to propagate a list of patched components across various
function calls.
closes #64
2019-04-29 15:45:15 +02:00
Géry Debongnie
b08e876136
[FIX] component: call mounted hooks in subcomponent properly
...
order was not correct in some cases. Also, this commit is a pretty
significant optimization.
2019-04-27 11:35:02 +02:00
Géry Debongnie
005b727328
[FIX] component: hooks mounted/willUnmount called in correct order
...
The issue was with parent/child relationship. It is not intuitive to
me, but the mounted hook should be called first on the children, and
then on the parent. willUnmount hooks is the opposite.
closes #63
2019-04-26 17:23:50 +02:00
Géry Debongnie
b44f274e37
[FIX] component: do not call willPatch/patched if not in DOM
...
closes #62
2019-04-26 15:30:59 +02:00
Géry Debongnie
754272b436
[IMP] component: give snapshot from 'willPatch' to 'patched'
2019-04-25 14:46:04 +02:00
Alexandre Kühn
379cd2a90f
[FIX] component: t-refs are bound/unbound at proper timing
...
With this commit, we make sure that bound references are removed when a
widget is removed from the DOM.
closes #59
2019-04-25 10:40:45 +02:00
Géry Debongnie
20b33f50fa
[FIX] component: bind t-ref widgets at correct moment
...
closes #51
2019-04-23 11:28:30 +02:00
Géry Debongnie
4ee39282ca
[IMP] component: add 'set' method to allow extending state
...
closes #49
2019-04-18 10:15:50 +02:00
Géry Debongnie
3b3fd8a6c9
[REF] component: make observer and state optional
2019-04-18 10:11:16 +02:00
Géry Debongnie
29111a5c10
[IMP] component: disable mutations in render phase
...
closes #48
2019-04-18 10:11:04 +02:00
Géry Debongnie
94ed6ebe60
[IMP] component: remove updateState method
2019-04-17 10:59:03 +02:00
Géry Debongnie
619e455dd5
[IMP] component: observe the state and rerender if it changes
...
closes #35
2019-04-17 10:58:54 +02:00
Géry Debongnie
0ca4cc1596
[IMP] qweb: make t-key directive dynamic
...
instead of having t-key and t-att-key.
closes #36
2019-04-16 14:38:55 +02:00
Géry Debongnie
6640644d34
[FIX] qweb/component: make widgets work with t-else=""
...
closes #37
2019-04-16 14:17:02 +02:00
Géry Debongnie
3733734ae5
[REF] component: rename t-keep-alive to t-keepalive
...
This is useful to preserve the following nice property: when we have an
attribute t-something-someotherthing, we can get the directive name by
removing 't-' at the front, and splitting on '-'.
2019-04-14 10:44:29 +02:00
Géry Debongnie
a0f0a24d1d
[REF] component: use __owl__ as metadata key
2019-04-13 14:14:34 +02:00
Géry Debongnie
f960149ba2
rem: remove destroyed hook
2019-04-10 09:35:20 +02:00
Géry Debongnie
74ce6a671e
fix: properly destroy widget in some cases
...
when widget was (props)updated, then removed from DOM, it was not
destroyed.
closes #19
2019-04-09 15:31:03 +02:00
Géry Debongnie
bc07c49a5f
imp: add willUpdateProps hook to components
2019-04-09 13:55:13 +02:00
Géry Debongnie
94c33af8e9
ref: rename 'detach' method to 'unmount'
2019-04-09 12:57:34 +02:00
Géry Debongnie
6e0ef0fd5c
ref: rename updated hook to 'patched'
2019-04-09 10:37:53 +02:00
Géry Debongnie
370a92b67e
imp: t-ref directive is now dynamic
...
closes #11
2019-04-09 10:33:08 +02:00
Géry Debongnie
a951c484be
ref: rename componentDidUpdate hook into 'updated'
...
closes #16
2019-04-05 23:29:16 +02:00
Géry Debongnie
14d3eb83eb
imp: add willPatch hook
2019-04-05 23:23:00 +02:00
Géry Debongnie
990a08dc04
imp: add componentDidUpdate hook
2019-04-01 16:00:57 +02:00
Géry Debongnie
5cd45b59af
fix: properly destroy/detach widgets in some cases
...
Sometimes, widgets were not properly destroyed/detached. This was caused
by the fact that we used the hook remove, when we sometimes need to use
the hook destroy as well.
2019-03-29 12:50:45 +01:00
Géry Debongnie
afc89e6f66
fix: if t-props is not defined, should fallback on {}
2019-03-28 17:35:08 +01:00
Géry Debongnie
a236ae396a
fix: make sure props are always defined
...
fix #7
2019-03-22 09:28:56 +01:00
Géry Debongnie
ad9fb77458
fix: force children to rerender when env changes
2019-03-21 16:06:06 +01:00
Géry Debongnie
d799e3dd47
prevent useless rerenders when updatingEnv on unmounted component
...
fix #4
2019-03-21 10:39:09 +01:00
Géry Debongnie
38f307ef57
implement updateEnv feature
2019-03-19 13:26:05 +01:00
Géry Debongnie
695636e60e
cleanup, rename setState into updateState
2019-03-19 10:35:41 +01:00
Géry Debongnie
d99ea4c9f4
rename updateState into setState
2019-03-15 11:54:59 +01:00
Alexandre Kühn
9be0b65cd3
make t-set works with t-props
...
test by aku, fix by ged
2019-03-15 11:06:05 +01:00
Géry Debongnie
46c8d5a4ee
add support for ES6-like syntax for props
2019-03-14 15:53:31 +01:00
Géry Debongnie
8d95f46fce
move test helpers from demo app to tests/
2019-03-14 11:50:39 +01:00
Géry Debongnie
e95af73065
move core tests to tests/ folder
2019-03-14 11:40:23 +01:00