Repository navigation
refactor(runtime-core): replace VueElement import with ComponentCustomElementInterface - #14348
Conversation
…mElementInterface Remove direct import of VueElement from @vue/runtime-dom in runtime-core to avoid improper cross-package dependency (runtime-core should not depend on runtime-dom).
📝 WalkthroughWalkthroughAdds Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/runtime-core/src/component.ts (1)
1259-1296: Public interface expansion may be breaking for downstream implementations.
ComponentCustomElementInterfaceis exported and used structurally. Making_isVueCEand_hasShadowRoot()required can break downstream custom-element adapters or module augmentations that implement this interface. Consider keeping the public surface stable by making these members optional or by introducing an internal extension used only by the renderer.💡 Minimal compatibility-preserving tweak (make members optional)
export interface ComponentCustomElementInterface { /** * `@internal` */ - _isVueCE: boolean + _isVueCE?: boolean @@ /** * `@internal` check if shadow root is enabled */ - _hasShadowRoot(): boolean + _hasShadowRoot?: () => boolean }If you go this route, update call sites to use optional chaining or a type guard.
🧹 Nitpick comments (1)
packages/runtime-core/src/renderer.ts (1)
644-647: Prefer castingcustomElementto the interface for stronger typing.Right now
customElementis inferred asRendererElement | null, which relies on the index signature for_beginPatch/_endPatch. Casting toComponentCustomElementInterfacepreserves type safety and intent.♻️ Suggested tweak
- const customElement = - n1.el && (n1.el as ComponentCustomElementInterface)._isVueCE - ? n1.el - : null + const customElement = + n1.el && (n1.el as ComponentCustomElementInterface)._isVueCE + ? (n1.el as ComponentCustomElementInterface) + : null
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
Remove direct import of VueElement from @vue/runtime-dom in runtime-core
to avoid improper cross-package dependency (runtime-core should not
depend on runtime-dom).
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.