|
@@ -1,5 +1,6 @@
|
|
|
import {
|
|
import {
|
|
|
type AsyncComponentInternalOptions,
|
|
type AsyncComponentInternalOptions,
|
|
|
|
|
+ type ComponentInternalInstance,
|
|
|
type ComponentInternalOptions,
|
|
type ComponentInternalOptions,
|
|
|
type ComponentObjectPropsOptions,
|
|
type ComponentObjectPropsOptions,
|
|
|
type ComponentPropsOptions,
|
|
type ComponentPropsOptions,
|
|
@@ -33,6 +34,7 @@ import {
|
|
|
queuePostFlushCb,
|
|
queuePostFlushCb,
|
|
|
registerHMR,
|
|
registerHMR,
|
|
|
setCurrentInstance,
|
|
setCurrentInstance,
|
|
|
|
|
+ setCurrentRenderingInstance,
|
|
|
startMeasure,
|
|
startMeasure,
|
|
|
unregisterHMR,
|
|
unregisterHMR,
|
|
|
warn,
|
|
warn,
|
|
@@ -556,23 +558,30 @@ function callRender(
|
|
|
* dev only
|
|
* dev only
|
|
|
*/
|
|
*/
|
|
|
export function devRender(instance: VaporComponentInstance): void {
|
|
export function devRender(instance: VaporComponentInstance): void {
|
|
|
- instance.block =
|
|
|
|
|
- (instance.type.render
|
|
|
|
|
- ? callRender(instance.type.render, instance, instance.setupState!)
|
|
|
|
|
- : 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 prev = setCurrentRenderingInstance(
|
|
|
|
|
+ instance as unknown as ComponentInternalInstance,
|
|
|
|
|
+ )
|
|
|
|
|
+ try {
|
|
|
|
|
+ instance.block =
|
|
|
|
|
+ (instance.type.render
|
|
|
|
|
+ ? callRender(instance.type.render, instance, instance.setupState!)
|
|
|
|
|
+ : 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,
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
|
|
+ )) || []
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ setCurrentRenderingInstance(prev)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export const emptyContext: GenericAppContext = {
|
|
export const emptyContext: GenericAppContext = {
|