@@ -182,14 +182,6 @@ export function createComponent(
182
182
appContext ,
183
183
)
184
184
185
- // HMR
186
- if ( __DEV__ && component . __hmrId ) {
187
- registerHMR ( instance )
188
- instance . isSingleRoot = isSingleRoot
189
- instance . hmrRerender = hmrRerender . bind ( null , instance )
190
- instance . hmrReload = hmrReload . bind ( null , instance )
191
- }
192
-
193
185
if ( __DEV__ ) {
194
186
pushWarningContext ( instance )
195
187
startMeasure ( instance , `init` )
@@ -229,6 +221,14 @@ export function createComponent(
229
221
// TODO make the proxy warn non-existent property access during dev
230
222
instance . setupState = proxyRefs ( setupResult )
231
223
devRender ( instance )
224
+
225
+ // HMR
226
+ if ( component . __hmrId ) {
227
+ registerHMR ( instance )
228
+ instance . isSingleRoot = isSingleRoot
229
+ instance . hmrRerender = hmrRerender . bind ( null , instance )
230
+ instance . hmrReload = hmrReload . bind ( null , instance )
231
+ }
232
232
}
233
233
} else {
234
234
// component has a render function but no setup function
@@ -283,33 +283,18 @@ export let isApplyingFallthroughProps = false
283
283
*/
284
284
export function devRender ( instance : VaporComponentInstance ) : void {
285
285
instance . block =
286
- ( instance . type . render
287
- ? callWithErrorHandling (
288
- instance . type . render ,
289
- instance ,
290
- ErrorCodes . RENDER_FUNCTION ,
291
- [
292
- instance . setupState ,
293
- instance . props ,
294
- instance . emit ,
295
- instance . attrs ,
296
- instance . slots ,
297
- ] ,
298
- )
299
- : callWithErrorHandling (
300
- isFunction ( instance . type ) ? instance . type : instance . type . setup ! ,
301
- instance ,
302
- ErrorCodes . SETUP_FUNCTION ,
303
- [
304
- instance . props ,
305
- {
306
- slots : instance . slots ,
307
- attrs : instance . attrs ,
308
- emit : instance . emit ,
309
- expose : instance . expose ,
310
- } ,
311
- ] ,
312
- ) ) || [ ]
286
+ callWithErrorHandling (
287
+ instance . type . render ! ,
288
+ instance ,
289
+ ErrorCodes . RENDER_FUNCTION ,
290
+ [
291
+ instance . setupState ,
292
+ instance . props ,
293
+ instance . emit ,
294
+ instance . attrs ,
295
+ instance . slots ,
296
+ ] ,
297
+ ) || [ ]
313
298
}
314
299
315
300
const emptyContext : GenericAppContext = {
0 commit comments