Skip to content

Commit e534fe0

Browse files
fix: hmr is working slowly
In recent changes we've broken HMR - in order to get its status on device, we need to call refresh application and monitor the logs. However, the logic at the moment is - wait for logs and call refresh application after that. This leads to very slow hmr. Also this way application will not be restarted when the HMR fails as we do not monitor the logs at the point when the hmr cannot be applied.
1 parent cd6a94a commit e534fe0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/controllers/run-controller.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ export class RunController extends EventEmitter implements IRunController {
358358
}
359359

360360
let liveSyncResultInfo = await platformLiveSyncService.liveSyncWatchAction(device, watchInfo);
361+
await this.refreshApplication(projectData, liveSyncResultInfo, data, deviceDescriptor);
361362

362363
if (!liveSyncResultInfo.didRecover && isInHMRMode) {
363364
const status = await this.$hmrStatusService.getHmrStatus(device.deviceInfo.identifier, data.hmrData.hash);
@@ -369,8 +370,6 @@ export class RunController extends EventEmitter implements IRunController {
369370
await this.refreshApplication(projectData, liveSyncResultInfo, data, deviceDescriptor);
370371
}
371372
}
372-
373-
await this.refreshApplication(projectData, liveSyncResultInfo, data, deviceDescriptor);
374373
}
375374

376375
this.$logger.info(`Successfully synced application ${deviceAppData.appIdentifier} on device ${device.deviceInfo.identifier}.`);

0 commit comments

Comments
 (0)