Repository navigation
fix(custom-element): skip mounting an async custom element removed while its component loads (fix #15775) - #15777
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughAsync custom elements now skip mounting when their definitions resolve while they are disconnected. Tests check that they mount after reconnection. ChangesAsync Custom Element Reconnection
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Fixed issue severity: <fixed_issue_severity>Low</fixed_issue_severity> Merge Risk: ⚪ Minimal · up to Detached async custom elements should wait to mount until reconnected. No actionable merge-blocking risk remains after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change prevents detached elements from mounting without adding public capabilities or authority. Risk is low, with less certainty around recovery when an element reconnects under different parent ownership. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
An async custom element removed from the document while its component is loading is still mounted when the component resolves. If its Vue custom element parent was removed with it, the mount throws on the parent's unmounted instance (
reading 'provides'), and a custom element nested inside it stays blank after the tree is added back. Reproduction in #15775.This checks
this.isConnectedbefore the initial mount in_resolveDef, as #15154 does for a child waiting on its parent. The definition still resolves and is cached, andconnectedCallbackmounts it when the element is connected again.Tests: a parent / async child / grandchild case (fails on main: unhandled error and blank grandchild) and an async element with no Vue parent that must not run
mountedwhile detached.minorhas the same unguarded mount (this._mountComponent(def)in_resolveDef).Ran the
unitandunit-jsdomprojects (3,747 passed, 6 skipped), plus prettier, eslint and the pre-committsc --noEmit; not the e2e or dts tests.Summary by CodeRabbit