odoo / owl

OWL: A web framework for structured, dynamic and maintainable applications
https://odoo.github.io/owl/
Other
1.17k stars 350 forks source link

app should have a way to have multiple roots #1640

Closed ged-odoo closed 2 months ago

ged-odoo commented 2 months ago

Knowledge has to create a new app for each embedded components. This is slightly annoying because there is some bookkeeping to do to copy the app configuration. Also, the sub app cannot have the same template cache, since compiled templates keep a reference to the app and doing that may cause weird crashes.

Another usecase could be website, which may have 1 single owl app with multiple roots all over the page.

I don't think that it would be very difficult to modify the App class to support multiple root nodes:

app.mount(Component, root)