@@ -59,11 +59,7 @@ import {
5959} from '@vue/shared'
6060import { type RawProps , rawPropsProxyHandlers } from './componentProps'
6161import type { RawSlots , VaporSlot } from './componentSlots'
62- import {
63- currentSlotOwner ,
64- currentSlotScopeIds ,
65- getParentInstance ,
66- } from './componentSlots'
62+ import { currentSlotScopeIds } from './componentSlots'
6763import { renderEffect } from './renderEffect'
6864import { _next , createTextNode } from './dom/node'
6965import { optimizePropertyLookup } from './dom/prop'
@@ -277,10 +273,10 @@ let vdomHydrateNode: HydrationRenderer['hydrateNode'] | undefined
277273function createVDOMComponent (
278274 internals : RendererInternals ,
279275 component : ConcreteComponent ,
276+ parentComponent : VaporComponentInstance | null ,
280277 rawProps ?: LooseRawProps | null ,
281278 rawSlots ?: LooseRawSlots | null ,
282279) : VaporFragment {
283- const parentInstance = getParentInstance ( ) as VaporComponentInstance | null
284280 const frag = new VaporFragment ( [ ] )
285281 const vnode = ( frag . vnode = createVNode (
286282 component ,
@@ -290,9 +286,9 @@ function createVDOMComponent(
290286 { props : component . props } ,
291287 rawProps as RawProps ,
292288 rawSlots as RawSlots ,
293- parentInstance ? parentInstance . appContext : undefined ,
289+ parentComponent ? parentComponent . appContext : undefined ,
294290 undefined ,
295- parentInstance ,
291+ parentComponent ,
296292 )
297293
298294 // overwrite how the vdom instance handles props
@@ -322,9 +318,9 @@ function createVDOMComponent(
322318 if ( vnode . shapeFlag & ShapeFlags . COMPONENT_SHOULD_KEEP_ALIVE ) {
323319 vdomDeactivate (
324320 vnode ,
325- findParentKeepAlive ( parentInstance ! ) ! . getStorageContainer ( ) ,
321+ findParentKeepAlive ( parentComponent ! ) ! . getStorageContainer ( ) ,
326322 internals ,
327- parentInstance as any ,
323+ parentComponent as any ,
328324 null ,
329325 )
330326 return
@@ -333,14 +329,13 @@ function createVDOMComponent(
333329 }
334330
335331 frag . hydrate = ( ) => {
336- hydrateVNode ( vnode , parentInstance as any )
332+ hydrateVNode ( vnode , parentComponent as any )
337333 onScopeDispose ( unmount , true )
338334 isMounted = true
339335 frag . nodes = vnode . el as any
340336 }
341337
342- const scopeOwner = currentSlotOwner || parentInstance
343- vnode . scopeId = ( scopeOwner && scopeOwner . type . __scopeId ) || null
338+ vnode . scopeId = ( currentInstance && currentInstance . type . __scopeId ) || null
344339 vnode . slotScopeIds = currentSlotScopeIds
345340
346341 frag . insert = ( parentNode , anchor , transition ) => {
@@ -351,21 +346,21 @@ function createVDOMComponent(
351346 parentNode ,
352347 anchor ,
353348 internals ,
354- parentInstance as any ,
349+ parentComponent as any ,
355350 null ,
356351 undefined ,
357352 false ,
358353 )
359354 } else {
360355 const prev = currentInstance
361- simpleSetCurrentInstance ( parentInstance )
356+ simpleSetCurrentInstance ( parentComponent )
362357 if ( ! isMounted ) {
363358 if ( transition ) setVNodeTransitionHooks ( vnode , transition )
364359 internals . mt (
365360 vnode ,
366361 parentNode ,
367362 anchor ,
368- parentInstance as any ,
363+ parentComponent as any ,
369364 null ,
370365 undefined ,
371366 false ,
@@ -381,7 +376,7 @@ function createVDOMComponent(
381376 parentNode ,
382377 anchor ,
383378 MoveType . REORDER ,
384- parentInstance as any ,
379+ parentComponent as any ,
385380 )
386381 }
387382 simpleSetCurrentInstance ( prev )
0 commit comments