We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05685a9 commit 1ae545aCopy full SHA for 1ae545a
packages/runtime-core/src/hydrationStrategies.ts
@@ -1,6 +1,13 @@
1
-import { isString } from '@vue/shared'
+import { getGlobalThis, isString } from '@vue/shared'
2
import { DOMNodeTypes, isComment } from './hydration'
3
4
+// Polyfills for Safari support
5
+// see https://caniuse.com/requestidlecallback
6
+const requestIdleCallback: Window['requestIdleCallback'] =
7
+ getGlobalThis().requestIdleCallback || (cb => setTimeout(cb, 1))
8
+const cancelIdleCallback: Window['cancelIdleCallback'] =
9
+ getGlobalThis().cancelIdleCallback || (id => clearTimeout(id))
10
+
11
/**
12
* A lazy hydration strategy for async components.
13
* @param hydrate - call this to perform the actual hydration.
0 commit comments