From ca84f46cd0853375f1c268083b410c7bfea3d4a9 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 24 Apr 2020 16:13:44 -0400 Subject: [PATCH] chore: add tip about Suspense being experimental --- packages/runtime-core/src/components/Suspense.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/runtime-core/src/components/Suspense.ts b/packages/runtime-core/src/components/Suspense.ts index 0cd79eb5..cf0e281a 100644 --- a/packages/runtime-core/src/components/Suspense.ts +++ b/packages/runtime-core/src/components/Suspense.ts @@ -227,6 +227,8 @@ export interface SuspenseBoundary { unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void } +let hasWarned = false + function createSuspenseBoundary( vnode: VNode, parent: SuspenseBoundary | null, @@ -239,6 +241,14 @@ function createSuspenseBoundary( rendererInternals: RendererInternals, isHydrating = false ): SuspenseBoundary { + /* istanbul ignore if */ + if (__DEV__ && !__TEST__ && !hasWarned) { + hasWarned = true + console[console.info ? 'info' : 'log']( + ` is an experimental feature and its API will likely change.` + ) + } + const { p: patch, m: move,