-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component lifecycle is not working properly #1659
Comments
Interesting, looks like components in the body of t-call are always rendered, I suppose we didn't ever really fully treat the case of using components in t-call body and it causes all kinds of weirdness. |
@sdegueldre do you expect to solve the issue soon? If not, then we will change our implementation to use inheritance as a workaround. I didn't test it with inheritance 😁, but I guess it will work as expected. As you mentioned OWL is always render the t-call body that is way the order of hooks execution is wrong, but the strange is why the onMounted hook is not executed? |
I'm no longer working in the R&D department so I don't really have the bandwidth to dedicate much time to work on Owl beyond triage. @ged-odoo is off until next week. Even then, the fact that this issue has been present for a long time and hasn't been reported until now indicates that it's probably a pretty niche issue. On top of that, from my current understanding of what's involved, it may require a fix very deep in the Owl internals with potentially far reaching implications, so I think if there's a fix it's likely to take a while, and it's even possible that a fix is impossible without breaking other things, though that will require someone to take a deeper look. With that in mind, I would advise to work around the issue for now if you can. |
interesting. we clearly do not use much t-call and t-out="0" in owl. they were implemented to have as much of qweb as possible, but this kind of usecases is usually done with higher order components and slots. Still, it looks like a bug indeed. We'll see if we can fix it, but it may take some time. |
Hi Géry & Sam,
Thank you for building an awesome framework, it really helped us a lot to build a complex and dynamic app.
The issue is the onMounted hook is not executed in specific circumstance and the order of hooks execution is wrong.
Copy the below code to OWL playground then run it.
JS
XML
You will see in the console the below output:
The issue here is "Greeter:mounted" is not logged, also we expect the logs that related to Greeter should be logged after "Root:mounted" since we set the the show flag in Root onMounted hook.
The issue is happened when add the if statement in the sub template, if we change the Root template as below, everything will work properly:
The text was updated successfully, but these errors were encountered: