Skip to content

Commit 41ad10c

Browse files
committed
chore: revert
1 parent 172df6a commit 41ad10c

File tree

1 file changed

+20
-35
lines changed

1 file changed

+20
-35
lines changed

packages/runtime-vapor/src/component.ts

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,6 @@ export function createComponent(
182182
appContext,
183183
)
184184

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-
193185
if (__DEV__) {
194186
pushWarningContext(instance)
195187
startMeasure(instance, `init`)
@@ -229,6 +221,14 @@ export function createComponent(
229221
// TODO make the proxy warn non-existent property access during dev
230222
instance.setupState = proxyRefs(setupResult)
231223
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+
}
232232
}
233233
} else {
234234
// component has a render function but no setup function
@@ -283,33 +283,18 @@ export let isApplyingFallthroughProps = false
283283
*/
284284
export function devRender(instance: VaporComponentInstance): void {
285285
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+
) || []
313298
}
314299

315300
const emptyContext: GenericAppContext = {

0 commit comments

Comments
 (0)