]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor: extract SFCInternalOptions inteface
authorEvan You <yyx990803@gmail.com>
Mon, 16 Dec 2019 15:36:48 +0000 (10:36 -0500)
committerEvan You <yyx990803@gmail.com>
Tue, 17 Dec 2019 17:31:38 +0000 (12:31 -0500)
packages/runtime-core/src/apiOptions.ts
packages/runtime-core/src/component.ts

index 2dea6eef4f16e82dd981cc7ec9bed0b88b2cd682..b50165a272191d95fab4a0528f67c426e592a1c9 100644 (file)
@@ -3,7 +3,8 @@ import {
   Data,
   Component,
   SetupContext,
-  RenderFunction
+  RenderFunction,
+  SFCInternalOptions
 } from './component'
 import {
   isFunction,
@@ -48,7 +49,7 @@ export interface ComponentOptionsBase<
   D,
   C extends ComputedOptions,
   M extends MethodOptions
-> extends LegacyOptions<Props, RawBindings, D, C, M> {
+> extends LegacyOptions<Props, RawBindings, D, C, M>, SFCInternalOptions {
   setup?: (
     this: null,
     props: Props,
@@ -66,11 +67,6 @@ export interface ComponentOptionsBase<
   directives?: Record<string, Directive>
   inheritAttrs?: boolean
 
-  // SFC & dev only
-  __scopeId?: string
-  __hmrId?: string
-  __hmrUpdated?: boolean
-
   // type-only differentiator to separate OptionWithoutProps from a constructor
   // type returned by createComponent() or FunctionalComponent
   call?: never
index 4825d873991fcc79f61a2a9b34fcddafbe8f124d..e26581420564fb94c703132377c874d95b89168d 100644 (file)
@@ -32,15 +32,17 @@ import { currentRenderingInstance } from './componentRenderUtils'
 
 export type Data = { [key: string]: unknown }
 
-export interface FunctionalComponent<P = {}> {
+export interface SFCInternalOptions {
+  __scopeId?: string
+  __hmrId?: string
+  __hmrUpdated?: boolean
+}
+
+export interface FunctionalComponent<P = {}> extends SFCInternalOptions {
   (props: P, ctx: SetupContext): VNodeChild
   props?: ComponentPropsOptions<P>
   inheritAttrs?: boolean
   displayName?: string
-
-  // internal HMR related flags
-  __hmrId?: string
-  __hmrUpdated?: boolean
 }
 
 export type Component = ComponentOptions | FunctionalComponent