Commit Graph

30 Commits

Author SHA1 Message Date
Géry Debongnie b2db7f21ed [FIX] observer: does not proxify promises
Promises are kind of special, and do not behave like usual javascript
values.

For this issue, the problem is that when the observer tries to observe a
promise value, the code will crash with an error like this:

Uncaught TypeError: Method Promise.prototype.then called on incompatible receiver [object Object]

Also, note that it does not make much sense to proxify promise methods
anyway, since they are not (supposed) to be modified.

So, with this commit, we simply consider that promises should be treated
like a primitive value: simply ignored when determining if it should be
proxified

Note that I actually believe that putting promises in a useState is not
a good idea in general.

closes #677
2020-09-17 13:51:10 +02:00
Géry Debongnie c36333dbbc [CLEANUP] update prettier to v2.0.4 2020-04-21 16:23:31 +02:00
Géry Debongnie 3fdc7a48f3 [IMP] types: make component generic types optional
In most cases, we just want Component<any, Env>. But since it was so
annoying to have always the type Env, we actually used
Component<any,any> everywhere.

With this commit, the generic types have a default (and their order is
swapped), so we can simply use Component in most cases, and
Component<Props> when we want to type the props.
2020-02-06 09:37:44 +01:00
Géry Debongnie c43178a45b [CLEANUP] observer: remove useless variable 2019-12-03 11:17:37 +01:00
Aaron Bohy 3c0f8ac76f [IMP] component: introduce OwlEvent
Closes #485
2019-11-21 13:12:22 +01:00
Géry Debongnie 56087b95cd [REF] observer: notify subscribers directly
This rev. moves the logic of batching the notifications of changes
occurring in the same microtask tick, from the observer, to the
listeners (the context, and the render function of components).
By doing so in render, we ensure that similar renderings are
batched in a single one, wherever they come from (state change,
store change, direct call...).
2019-11-14 15:12:31 +01:00
Aaron Bohy fa6801b523 [REF] observer: remove revNumber
Closes #257
2019-10-30 11:13:52 +01:00
Géry Debongnie 5335fb8fba [IMP] components: add hooks mechanism
part of #194
2019-09-27 11:20:08 +02:00
Géry Debongnie f9861040c8 [FIX] router: properly react on hashchange
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
2019-09-01 11:45:13 +02:00
Géry Debongnie eaf912bed7 [FIX] observer: properly handle dates 2019-08-22 14:22:20 +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 5382e824b1 [REF] owl: reorganize src code in sub files 2019-07-16 13:12:08 +02:00
Géry Debongnie 3766fbc7b8 reorganize files 2019-01-23 09:45:28 +01:00
Géry Debongnie 4862496891 add router service, better structure for demo app 2019-01-22 14:44:37 +01:00
Géry Debongnie a357ff6b37 call mounted recursively on all children 2019-01-21 16:26:51 +01:00
Géry Debongnie 9be5cc1760 add t-ref directive 2019-01-21 15:46:29 +01:00
Géry Debongnie cd0ef90075 naive implementation of mounted hook 2019-01-21 14:54:13 +01:00
Géry Debongnie fbf099f1f3 add attributes module in widget (+lint) 2019-01-21 14:39:06 +01:00
Géry Debongnie a3bf470930 add support for text root nodes (and test suite cleanups) 2019-01-21 14:03:36 +01:00
Géry Debongnie e40c9ee4e5 t-widget directive 2019-01-20 15:10:44 +01:00
Géry Debongnie 041830c684 remove old code 2019-01-20 09:29:18 +01:00
Géry Debongnie 00e20f7c72 lint 2019-01-20 09:26:14 +01:00
Géry Debongnie a2146ffa83 fix widget class 2019-01-20 09:25:41 +01:00
Géry Debongnie cc96328bdd add on-directive 2019-01-20 09:10:50 +01:00
Géry Debongnie 3a4d1ef1ba basic qweb vdom implementation 2019-01-19 23:21:41 +01:00
Géry Debongnie e7415cd811 add snabbdom 2019-01-17 17:13:46 +01:00
Géry Debongnie 9b08e30cf3 work on composability 2019-01-17 14:05:05 +01:00
Géry Debongnie ddd70b8526 small qweb cleanup 2019-01-17 09:43:50 +01:00
Géry Debongnie 0f8cdfa87d implement destroy, add tests 2019-01-17 08:36:38 +01:00
Géry Debongnie f0d529139b basic project infrastructure 2019-01-16 16:17:25 +01:00