mirror of https://github.com/vuejs/core.git
Merge f264ceb892
into bb4ae25793
This commit is contained in:
commit
ba644f0f7f
|
@ -188,6 +188,14 @@ export function createComponent(
|
||||||
appContext,
|
appContext,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// HMR
|
||||||
|
if (__DEV__ && component.__hmrId) {
|
||||||
|
registerHMR(instance)
|
||||||
|
instance.isSingleRoot = isSingleRoot
|
||||||
|
instance.hmrRerender = hmrRerender.bind(null, instance)
|
||||||
|
instance.hmrReload = hmrReload.bind(null, instance)
|
||||||
|
}
|
||||||
|
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
pushWarningContext(instance)
|
pushWarningContext(instance)
|
||||||
startMeasure(instance, `init`)
|
startMeasure(instance, `init`)
|
||||||
|
@ -227,14 +235,6 @@ export function createComponent(
|
||||||
// TODO make the proxy warn non-existent property access during dev
|
// TODO make the proxy warn non-existent property access during dev
|
||||||
instance.setupState = proxyRefs(setupResult)
|
instance.setupState = proxyRefs(setupResult)
|
||||||
devRender(instance)
|
devRender(instance)
|
||||||
|
|
||||||
// HMR
|
|
||||||
if (component.__hmrId) {
|
|
||||||
registerHMR(instance)
|
|
||||||
instance.isSingleRoot = isSingleRoot
|
|
||||||
instance.hmrRerender = hmrRerender.bind(null, instance)
|
|
||||||
instance.hmrReload = hmrReload.bind(null, instance)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// component has a render function but no setup function
|
// component has a render function but no setup function
|
||||||
|
@ -291,18 +291,33 @@ export let isApplyingFallthroughProps = false
|
||||||
*/
|
*/
|
||||||
export function devRender(instance: VaporComponentInstance): void {
|
export function devRender(instance: VaporComponentInstance): void {
|
||||||
instance.block =
|
instance.block =
|
||||||
callWithErrorHandling(
|
(instance.type.render
|
||||||
instance.type.render!,
|
? callWithErrorHandling(
|
||||||
instance,
|
instance.type.render,
|
||||||
ErrorCodes.RENDER_FUNCTION,
|
instance,
|
||||||
[
|
ErrorCodes.RENDER_FUNCTION,
|
||||||
instance.setupState,
|
[
|
||||||
instance.props,
|
instance.setupState,
|
||||||
instance.emit,
|
instance.props,
|
||||||
instance.attrs,
|
instance.emit,
|
||||||
instance.slots,
|
instance.attrs,
|
||||||
],
|
instance.slots,
|
||||||
) || []
|
],
|
||||||
|
)
|
||||||
|
: callWithErrorHandling(
|
||||||
|
isFunction(instance.type) ? instance.type : instance.type.setup!,
|
||||||
|
instance,
|
||||||
|
ErrorCodes.SETUP_FUNCTION,
|
||||||
|
[
|
||||||
|
instance.props,
|
||||||
|
{
|
||||||
|
slots: instance.slots,
|
||||||
|
attrs: instance.attrs,
|
||||||
|
emit: instance.emit,
|
||||||
|
expose: instance.expose,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
)) || []
|
||||||
}
|
}
|
||||||
|
|
||||||
const emptyContext: GenericAppContext = {
|
const emptyContext: GenericAppContext = {
|
||||||
|
|
Loading…
Reference in New Issue