(
initialVNode,
container,
anchor,
parentComponent,
parentSuspense,
namespace: ElementNamespace,
optimized,
)
| 1200 | } |
| 1201 | |
| 1202 | const mountComponent: MountComponentFn = ( |
| 1203 | initialVNode, |
| 1204 | container, |
| 1205 | anchor, |
| 1206 | parentComponent, |
| 1207 | parentSuspense, |
| 1208 | namespace: ElementNamespace, |
| 1209 | optimized, |
| 1210 | ) => { |
| 1211 | // 2.x compat may pre-create the component instance before actually |
| 1212 | // mounting |
| 1213 | const compatMountInstance = |
| 1214 | __COMPAT__ && initialVNode.isCompatRoot && initialVNode.component |
| 1215 | const instance: ComponentInternalInstance = |
| 1216 | compatMountInstance || |
| 1217 | (initialVNode.component = createComponentInstance( |
| 1218 | initialVNode, |
| 1219 | parentComponent, |
| 1220 | parentSuspense, |
| 1221 | )) |
| 1222 | |
| 1223 | if (__DEV__ && instance.type.__hmrId) { |
| 1224 | registerHMR(instance) |
| 1225 | } |
| 1226 | |
| 1227 | if (__DEV__) { |
| 1228 | pushWarningContext(initialVNode) |
| 1229 | startMeasure(instance, `mount`) |
| 1230 | } |
| 1231 | |
| 1232 | // inject renderer internals for keepAlive |
| 1233 | if (isKeepAlive(initialVNode)) { |
| 1234 | ;(instance.ctx as KeepAliveContext).renderer = internals |
| 1235 | } |
| 1236 | |
| 1237 | // resolve props and slots for setup context |
| 1238 | if (!(__COMPAT__ && compatMountInstance)) { |
| 1239 | if (__DEV__) { |
| 1240 | startMeasure(instance, `init`) |
| 1241 | } |
| 1242 | setupComponent(instance, false, optimized) |
| 1243 | if (__DEV__) { |
| 1244 | endMeasure(instance, `init`) |
| 1245 | } |
| 1246 | } |
| 1247 | |
| 1248 | // avoid hydration for hmr updating |
| 1249 | if (__DEV__ && isHmrUpdating) initialVNode.el = null |
| 1250 | |
| 1251 | // setup() is async. This component relies on async logic to be resolved |
| 1252 | // before proceeding |
| 1253 | if (__FEATURE_SUSPENSE__ && instance.asyncDep) { |
| 1254 | parentSuspense && |
| 1255 | parentSuspense.registerDep(instance, setupRenderEffect, optimized) |
| 1256 | |
| 1257 | // Give it a placeholder if this is not hydration |
| 1258 | // TODO handle self-defined fallback |
| 1259 | if (!initialVNode.el) { |
no test coverage detected