Commit Graph

956 Commits

Author SHA1 Message Date
Géry Debongnie 91896942dd [FIX] component: prevent rendering if not mounted 2019-05-06 13:45:50 +02:00
Géry Debongnie bd29e4f761 [REF] qweb: split code into 3 files
closes #84
2019-05-06 13:00:46 +02:00
Géry Debongnie b9591cfecd [IMP] component: add support for dynamic css on t-widget
closes #80
2019-05-06 11:19:18 +02:00
Géry Debongnie 51320204f9 [IMP] component: add static css support for sub components
part of issue #80
2019-05-06 10:22:53 +02:00
Géry Debongnie eb508b7660 [FIX] component: capture ref key in closure
This is what commit d3197e9865 should have
done. Many changes should be done on normal nodes and on components!

closes #77
2019-05-04 22:48:50 +02:00
Géry Debongnie 84b3cc42cf [FIX] qweb: make transition code much more robust
part of #66
2019-05-03 14:15:25 +02:00
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 d3197e9865 [FIX] qweb: capture ref key in closure, to avoid scoping issue
closes #77
2019-05-03 09:43:27 +02:00
Géry Debongnie 0da44033ac [IMP] qweb: add preliminary support for transitions
Still very naive...

Part of #66
2019-05-03 09:35:35 +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 4a748d2ea4 [IMP] qweb: add t-debug and t-log directives 2019-04-29 14:07:08 +02:00
Géry Debongnie 1701d5aa86 [REM] utils: remove findInTree and htmlTrim
They were not used and are not in the scope of this project.
2019-04-27 11:44:37 +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 b6bd0f92a7 [ADD] utils: add whenReady function 2019-04-26 14:22:43 +02:00
Géry Debongnie 78108e8d2c [IMP] utils: add loadJS function
Very useful to lazy load libraries in owl applications
2019-04-26 13:28:30 +02:00
Géry Debongnie 2bd0719b9a [REF] component, vdom: small cleanup 2019-04-25 17:10:36 +02:00
Géry Debongnie cf47f8459a [REF] utils: remove id generator 2019-04-25 16:45:09 +02:00
Géry Debongnie 40613e0a76 [IMP] observer: add observer to exported objects 2019-04-25 15:47:01 +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 f5ce05c81e [FIX] vdom: fix typing issues, small cleanup 2019-04-22 21:22:21 +02:00
Géry Debongnie 8a4fd5015a [REF] vdom: fork snabbdom and use custom version 2019-04-20 09:34:51 +02:00
Géry Debongnie ae263730d9 [ADD] utils: add loadTemplates function 2019-04-18 22:42:37 +02:00
Géry Debongnie 4fb2733321 [FIX] observer: better handling of reassigning state
closes #50
2019-04-18 13:14:10 +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 4b30d0b412 [FIX] observer: protect observed state against changes 2019-04-18 07:59:30 +02:00
Géry Debongnie 7a479baf63 [DOC] doc: remove references to updateState 2019-04-17 10:59:03 +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 94e7d9aa39 [REF] observer: move batch code out of store, add notifycb 2019-04-17 09:16:48 +02:00
Géry Debongnie c47c4ccc60 [REF] observer: turn the observer into a class 2019-04-16 22:34:26 +02:00
Géry Debongnie b89327c831 [IMP] qweb: log a warning if a t-foreach is used without t-key
closes #40
2019-04-16 17:49:33 +02:00
Géry Debongnie 8163e2b0e4 [REM] component: remove PureComponent 2019-04-16 17:20:32 +02:00
Géry Debongnie a22dcdaddf [REF] owl: reorganize exports, remove registry, remove web example
closes #38
2019-04-16 17:20:23 +02:00
Géry Debongnie eac49562fa [REF] owl: export owl elements in one object 2019-04-16 16:26:06 +02:00
Géry Debongnie 460ae4bb34 [REF] qweb: add missing semicolon to compiled template 2019-04-16 16:16:08 +02:00
Géry Debongnie c52e86feaf [FIX] qweb: t-set should reuse variable if possible
closes #41
2019-04-16 16:04:44 +02:00
Géry Debongnie cef12acfe0 [REF] observer: create sub array prototype only once
and reuse it whenever necessary.  This should speed up the observer.
2019-04-16 15:17:36 +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 7092f5e142 [REF] observer: move observer out of store 2019-04-16 14:24:19 +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 7974ce4963 [IMP] qweb: crash if t-on directive is used with no event
closes #33
2019-04-16 14:07:51 +02:00
Géry Debongnie ed326d34fd [FIX] qweb: add t-debug to list of valid directives
With a previous commit, qweb crashes when an unknown directive is
encountered.  However, t-debug was not on the list of valid directives.
2019-04-16 09:57:58 +02:00