@@ -55,32 +55,38 @@ export function setupComponent(instance: ComponentInternalInstance): void {
55
55
56
56
let block : Block | undefined
57
57
58
- if (
59
- stateOrNode &&
60
- ( stateOrNode instanceof Node ||
61
- isArray ( stateOrNode ) ||
62
- fragmentKey in stateOrNode ||
63
- componentKey in stateOrNode )
64
- ) {
58
+ // Skip the type check for production since this is only for Dev HMR
59
+ if ( __DEV__ ) {
60
+ if (
61
+ stateOrNode &&
62
+ ( stateOrNode instanceof Node ||
63
+ isArray ( stateOrNode ) ||
64
+ fragmentKey in stateOrNode ||
65
+ componentKey in stateOrNode )
66
+ ) {
67
+ block = stateOrNode
68
+ } else if ( isObject ( stateOrNode ) ) {
69
+ instance . setupState = proxyRefs ( stateOrNode )
70
+ }
71
+
72
+ if ( ! block && component . render ) {
73
+ pauseTracking ( )
74
+ block = callWithErrorHandling (
75
+ component . render ,
76
+ instance ,
77
+ VaporErrorCodes . RENDER_FUNCTION ,
78
+ [
79
+ instance . setupState , // _ctx
80
+ shallowReadonly ( props ) , // $props
81
+ instance . emit , // $emit
82
+ getAttrsProxy ( instance ) , // $attrs
83
+ getSlotsProxy ( instance ) , // $slots
84
+ ] ,
85
+ )
86
+ resetTracking ( )
87
+ }
88
+ } else {
65
89
block = stateOrNode
66
- } else if ( isObject ( stateOrNode ) ) {
67
- instance . setupState = proxyRefs ( stateOrNode )
68
- }
69
- if ( ! block && component . render ) {
70
- pauseTracking ( )
71
- block = callWithErrorHandling (
72
- component . render ,
73
- instance ,
74
- VaporErrorCodes . RENDER_FUNCTION ,
75
- [
76
- instance . setupState , // _ctx
77
- __DEV__ ? shallowReadonly ( props ) : props , // $props
78
- instance . emit , // $emit
79
- __DEV__ ? getAttrsProxy ( instance ) : instance . attrs , // $attrs
80
- __DEV__ ? getSlotsProxy ( instance ) : instance . slots , // $slots
81
- ] ,
82
- )
83
- resetTracking ( )
84
90
}
85
91
86
92
if ( ! block ) {
0 commit comments