Skip to content

fix: remove unneeded liveEdit method #4016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions lib/services/livesync/ios-device-livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen
private $iOSEmulatorServices: Mobile.IiOSSimulatorService,
private $iOSDebuggerPortService: IIOSDebuggerPortService,
private $logger: ILogger,
private $fs: IFileSystem,
private $processService: IProcessService,
protected $platformsData: IPlatformsData,
protected device: Mobile.IiOSDevice) {
Expand Down Expand Up @@ -71,8 +70,7 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen
}

if (await this.setupSocketIfNeeded(projectData)) {
await this.liveEdit(scriptFiles);
await this.reloadPage(deviceAppData, otherFiles);
await this.reloadPage(otherFiles);
} else {
await this.restartApplication(deviceAppData, projectData.projectName);
}
Expand All @@ -82,7 +80,7 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen
return this.device.applicationManager.restartApplication({ appId: deviceAppData.appIdentifier, projectName });
}

private async reloadPage(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]): Promise<void> {
private async reloadPage(localToDevicePaths: Mobile.ILocalToDevicePathData[]): Promise<void> {
if (localToDevicePaths.length) {
const message = JSON.stringify({
method: "Page.reload",
Expand All @@ -96,22 +94,6 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen
}
}

private async liveEdit(localToDevicePaths: Mobile.ILocalToDevicePathData[]): Promise<void> {
for (const localToDevicePath of localToDevicePaths) {
const content = this.$fs.readText(localToDevicePath.getLocalPath());
const message = JSON.stringify({
method: "Debugger.setScriptSource",
params: {
scriptUrl: localToDevicePath.getRelativeToProjectBasePath(),
scriptSource: content
},
id: ++currentPageReloadId
});

await this.sendMessage(message);
}
}

private attachEventHandlers(): void {
this.$processService.attachToProcessExitSignals(this, this.destroySocket);

Expand Down