@@ -37,7 +37,11 @@ import {
37
37
normalizeStyle ,
38
38
stringifyStyle ,
39
39
} from '@vue/shared'
40
- import { type RendererInternals , needTransition } from './renderer'
40
+ import {
41
+ type RendererInternals ,
42
+ getVaporInterface ,
43
+ needTransition ,
44
+ } from './renderer'
41
45
import { setRef } from './rendererTemplateRef'
42
46
import {
43
47
type SuspenseBoundary ,
@@ -294,10 +298,6 @@ export function createHydrationFunctions(
294
298
)
295
299
}
296
300
} else if ( shapeFlag & ShapeFlags . COMPONENT ) {
297
- if ( ( vnode . type as ConcreteComponent ) . __vapor ) {
298
- throw new Error ( 'Vapor component hydration is not supported yet.' )
299
- }
300
-
301
301
// when setting up the render effect, if the initial vnode already
302
302
// has .el set, the component will perform hydration instead of mount
303
303
// on its sub-tree.
@@ -318,15 +318,23 @@ export function createHydrationFunctions(
318
318
nextNode = nextSibling ( node )
319
319
}
320
320
321
- mountComponent (
322
- vnode ,
323
- container ,
324
- null ,
325
- parentComponent ,
326
- parentSuspense ,
327
- getContainerType ( container ) ,
328
- optimized ,
329
- )
321
+ // hydrate vapor component
322
+ if ( ( vnode . type as ConcreteComponent ) . __vapor ) {
323
+ const vaporInterface = getVaporInterface ( parentComponent , vnode )
324
+ vaporInterface . hydrate ( node , ( ) => {
325
+ vaporInterface . mount ( vnode , container , null , parentComponent )
326
+ } )
327
+ } else {
328
+ mountComponent (
329
+ vnode ,
330
+ container ,
331
+ null ,
332
+ parentComponent ,
333
+ parentSuspense ,
334
+ getContainerType ( container ) ,
335
+ optimized ,
336
+ )
337
+ }
330
338
331
339
// #3787
332
340
// if component is async, it may get moved / unmounted before its
0 commit comments