]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: add tip about Suspense being experimental
authorEvan You <yyx990803@gmail.com>
Fri, 24 Apr 2020 20:13:44 +0000 (16:13 -0400)
committerEvan You <yyx990803@gmail.com>
Fri, 24 Apr 2020 20:13:44 +0000 (16:13 -0400)
packages/runtime-core/src/components/Suspense.ts

index 0cd79eb5586537cde0b841c279570304f884570c..cf0e281a646bfa58b1c71382db69097a399fa8ab 100644 (file)
@@ -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'](
+      `<Suspense> is an experimental feature and its API will likely change.`
+    )
+  }
+
   const {
     p: patch,
     m: move,