]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
types: fix suspense exported type
authorEvan You <yyx990803@gmail.com>
Fri, 1 Nov 2019 16:43:27 +0000 (12:43 -0400)
committerEvan You <yyx990803@gmail.com>
Fri, 1 Nov 2019 16:43:27 +0000 (12:43 -0400)
packages/runtime-core/src/suspense.ts
packages/runtime-core/src/vnode.ts

index a8d323c0dd28783c1d862089cb0460468850508d..a01d7b20524db0ffd6f3338bf3f557e52ed95331 100644 (file)
@@ -10,11 +10,11 @@ import { handleError, ErrorCodes } from './errorHandling'
 import { pushWarningContext, popWarningContext } from './warning'
 
 export function isSuspenseType(type: VNodeTypes): type is typeof SuspenseImpl {
-  return (type as any).__isSuspenseImpl === true
+  return (type as any).__isSuspense === true
 }
 
 export const SuspenseImpl = {
-  __isSuspenseImpl: true,
+  __isSuspense: true,
   process(
     n1: VNode | null,
     n2: VNode,
index 08407429e6ca790a5a80dd764163a58d1e14d3b2..acc4537c3a02c617d863357aeadd559cb5b644e9 100644 (file)
@@ -25,12 +25,14 @@ export const Portal = Symbol(__DEV__ ? 'Portal' : undefined)
 export const Text = Symbol(__DEV__ ? 'Text' : undefined)
 export const Comment = Symbol(__DEV__ ? 'Comment' : undefined)
 
-// Export as {} to avoid circular type dependency between `suspense.ts` and
-// `createRenderer.ts` in exported types.
+// Export Suspense with casting to avoid circular type dependency between
+// `suspense.ts` and `createRenderer.ts` in exported types.
 // A circular type dependency causes tsc to generate d.ts with dynmaic import()
 // calls using realtive paths, which works for separate d.ts files, but will
 // fail after d.ts rollup with API Extractor.
-const Suspense = (__FEATURE_SUSPENSE__ ? SuspenseImpl : null) as {}
+const Suspense = ((__FEATURE_SUSPENSE__ ? SuspenseImpl : null) as any) as {
+  __isSuspense: true
+}
 export { Suspense }
 
 export type VNodeTypes =