MCPcopy
hub / github.com/vuejs/core / hydrate

Function hydrate

packages/runtime-core/src/hydration.ts:119–135  ·  view source on GitHub ↗
(vnode, container)

Source from the content-addressed store, hash-verified

117 } = rendererInternals
118
119 const hydrate: RootHydrateFunction = (vnode, container) => {
120 if (!container.hasChildNodes()) {
121 ;(__DEV__ || __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__) &&
122 warn(
123 `Attempting to hydrate existing markup but container is empty. ` +
124 `Performing full mount instead.`,
125 )
126 patch(null, vnode, container)
127 flushPostFlushCbs()
128 container._vnode = vnode
129 return
130 }
131
132 hydrateNode(container.firstChild!, vnode, null, null, null)
133 flushPostFlushCbs()
134 container._vnode = vnode
135 }
136
137 const hydrateNode = (
138 node: Node,

Callers 5

mountFunction · 0.85
performHydrateFunction · 0.85
hydrateOnVisibleFunction · 0.85
hydrateOnMediaQueryFunction · 0.85
doHydrateFunction · 0.85

Calls 4

warnFunction · 0.90
flushPostFlushCbsFunction · 0.90
patchFunction · 0.85
hydrateNodeFunction · 0.85

Tested by

no test coverage detected