wip: fix render fn compat detection

This commit is contained in:
Evan You
2021-04-11 11:15:40 -04:00
parent a2f441dc0e
commit c55f3ed0e8
9 changed files with 86 additions and 20 deletions

View File

@@ -1,7 +1,8 @@
import {
getCurrentInstance,
SetupContext,
ComponentInternalInstance
ComponentInternalInstance,
ComponentOptions
} from '../component'
import {
cloneVNode,
@@ -110,7 +111,7 @@ export function useTransitionState(): TransitionState {
const TransitionHookValidator = [Function, Array]
const BaseTransitionImpl = {
const BaseTransitionImpl: ComponentOptions = {
name: `BaseTransition`,
props: {
@@ -250,6 +251,10 @@ const BaseTransitionImpl = {
}
}
if (__COMPAT__) {
BaseTransitionImpl.__isBuiltIn = true
}
// export the public type for h/tsx inference
// also to avoid inline import() in generated d.ts files
export const BaseTransition = (BaseTransitionImpl as any) as {

View File

@@ -5,7 +5,8 @@ import {
ComponentInternalInstance,
LifecycleHooks,
currentInstance,
getComponentName
getComponentName,
ComponentOptions
} from '../component'
import { VNode, cloneVNode, isVNode, VNodeProps } from '../vnode'
import { warn } from '../warning'
@@ -62,7 +63,7 @@ export interface KeepAliveContext extends ComponentRenderContext {
export const isKeepAlive = (vnode: VNode): boolean =>
(vnode.type as any).__isKeepAlive
const KeepAliveImpl = {
const KeepAliveImpl: ComponentOptions = {
name: `KeepAlive`,
// Marker for special handling inside the renderer. We are not using a ===
@@ -298,6 +299,10 @@ const KeepAliveImpl = {
}
}
if (__COMPAT__) {
KeepAliveImpl.__isBuildIn = true
}
// export the public type for h/tsx inference
// also to avoid inline import() in generated d.ts files
export const KeepAlive = (KeepAliveImpl as any) as {