Skip to content

[FIX] devtools: get OWL 3 root nodes through the mount promise - #1998

Merged
ged-odoo merged 1 commit into
masterfrom
mater-devtools-roots-as-promise-juca
Jul 16, 2026
Merged

[FIX] devtools: get OWL 3 root nodes through the mount promise#1998
ged-odoo merged 1 commit into
masterfrom
mater-devtools-roots-as-promise-juca

Conversation

@juliusc2066

Copy link
Copy Markdown
Member

Since 3700cad, roots created by app.createRoot() no longer expose their ComponentNode: root.node is undefined, so getRoots() returned an array of undefined for every OWL 3 app and the extension could not inspect any component tree.

The node is still reachable through the only remaining public surface: root.promise resolves with the root component instance, whose owl property is its ComponentNode. Since getRoots() is synchronous, cache each root's node in a WeakMap when its promise resolves, and post a RefreshApps message at that point so the devtools re-render once the tree becomes inspectable. Roots whose mount fails resolve to nothing and are simply skipped.

root.node is still used when present, for compatibility with earlier 3.x versions that exposed it directly.

Since 3700cad,
roots created by app.createRoot() no longer expose their ComponentNode:
root.node is undefined, so getRoots() returned an array of undefined for
every OWL 3 app and the extension could not inspect any component tree.

The node is still reachable through the only remaining public surface:
root.promise resolves with the root component instance, whose __owl__
property is its ComponentNode. Since getRoots() is synchronous, cache
each root's node in a WeakMap when its promise resolves, and post a
RefreshApps message at that point so the devtools re-render once the
tree becomes inspectable. Roots whose mount fails resolve to nothing
and are simply skipped.

root.node is still used when present, for compatibility with earlier
3.x versions that exposed it directly.
@juliusc2066
juliusc2066 force-pushed the mater-devtools-roots-as-promise-juca branch from 45a2d82 to 8fd9cf3 Compare July 16, 2026 09:07
@ged-odoo
ged-odoo merged commit a42ebaa into master Jul 16, 2026
2 checks passed
@ged-odoo
ged-odoo deleted the mater-devtools-roots-as-promise-juca branch July 16, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants