]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
types: custom element interface should be internal
authorEvan You <evan@vuejs.org>
Tue, 6 Aug 2024 18:33:20 +0000 (02:33 +0800)
committerEvan You <evan@vuejs.org>
Tue, 6 Aug 2024 18:33:20 +0000 (02:33 +0800)
packages/runtime-core/src/component.ts
packages/runtime-core/src/hmr.ts
packages/runtime-core/src/renderer.ts
packages/runtime-dom/src/apiCustomElement.ts

index 2bf25ac8e4726644fb553fb1660ac81f54970bc3..f420a678a2faf3b9d555b6f7e768c8176d03e30f 100644 (file)
@@ -1239,6 +1239,12 @@ export function isClassComponent(value: unknown): value is ClassComponent {
 }
 
 export interface ComponentCustomElementInterface {
-  injectChildStyle(type: ConcreteComponent): void
-  removeChildStyle(type: ConcreteComponent): void
+  /**
+   * @internal
+   */
+  _injectChildStyle(type: ConcreteComponent): void
+  /**
+   * @internal
+   */
+  _removeChildStyle(type: ConcreteComponent): void
 }
index 926d3fa0a51a3789f10926b51aae31f7c1a3ed02..19ff20de30b00cc32192e030ba0f52ed36753532 100644 (file)
@@ -162,7 +162,7 @@ function reload(id: string, newComp: HMRComponent) {
 
     // update custom element child style
     if (instance.root.ce && instance !== instance.root) {
-      instance.root.ce.removeChildStyle(oldComp)
+      instance.root.ce._removeChildStyle(oldComp)
     }
   }
 
index 588a58e34ca6aa89b62a4f25203be32cc91ee19f..2415307bb5f93943a07315fd2db252f059df4b88 100644 (file)
@@ -1337,7 +1337,7 @@ function baseCreateRenderer(
         } else {
           // custom element style injection
           if (root.ce) {
-            root.ce.injectChildStyle(type)
+            root.ce._injectChildStyle(type)
           }
 
           if (__DEV__) {
index 2684e97ea51ae843d3e1ed4bc0cfcddff1b6b8f2..6af68193a0894ac6d852c072a2f5f20b4187f69c 100644 (file)
@@ -609,11 +609,17 @@ export class VueElement
     }
   }
 
-  injectChildStyle(comp: ConcreteComponent & CustomElementOptions) {
+  /**
+   * @internal
+   */
+  _injectChildStyle(comp: ConcreteComponent & CustomElementOptions) {
     this._applyStyles(comp.styles, comp)
   }
 
-  removeChildStyle(comp: ConcreteComponent): void {
+  /**
+   * @internal
+   */
+  _removeChildStyle(comp: ConcreteComponent): void {
     if (__DEV__) {
       this._styleChildren.delete(comp)
       if (this._childStyles && comp.__hmrId) {