Skip to content

Commit 90a655c

Browse files
committed
docs: add beta warnings for the unstable options during livesync
1 parent 16d9674 commit 90a655c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/services/livesync/livesync-service.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { hook } from "../../common/helpers";
66
import { PACKAGE_JSON_FILE_NAME, LiveSyncTrackActionNames, USER_INTERACTION_NEEDED_EVENT_NAME, DEBUGGER_ATTACHED_EVENT_NAME, DEBUGGER_DETACHED_EVENT_NAME, TrackActionNames } from "../../constants";
77
import { DeviceTypes, DeviceDiscoveryEventNames, HmrConstants } from "../../common/constants";
88
import { cache } from "../../common/decorators";
9+
import * as constants from "../../constants";
910

1011
const deviceDescriptorPrimaryKey = "identifier";
1112

@@ -45,6 +46,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
4546

4647
public async liveSync(deviceDescriptors: ILiveSyncDeviceInfo[], liveSyncData: ILiveSyncInfo): Promise<void> {
4748
const projectData = this.$projectDataService.getProjectData(liveSyncData.projectDir);
49+
this.handleWarnings(liveSyncData, projectData);
4850
await this.$pluginsService.ensureAllDependenciesAreInstalled(projectData);
4951
await this.liveSyncOperation(deviceDescriptors, liveSyncData, projectData);
5052
}
@@ -113,6 +115,18 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
113115
return currentDescriptors || [];
114116
}
115117

118+
private handleWarnings(liveSyncData: ILiveSyncInfo, projectData: IProjectData) {
119+
if (liveSyncData.useHotModuleReload) {
120+
this.$logger.warn("Hot Module Replacement (HMR) is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398");
121+
if (projectData.projectType === constants.NgFlavorName) {
122+
this.$logger.warn("To enable Hot Module Replacement (HMR) in Angular projects, follow the steps outlined in this wiki: https://github.com/NativeScript/nativescript-angular/wiki/HMR");
123+
}
124+
}
125+
if (liveSyncData.syncToPreviewApp && liveSyncData.bundle) {
126+
this.$logger.warn("Webpack support for the `tns preview` command is currently in Beta. Please, do not hesitate to report any problems that you experience with the feature by opening a new issue in the NativeScript CLI repository: https://github.com/NativeScript/nativescript-cli/issues/new/choose");
127+
}
128+
}
129+
116130
private async refreshApplication(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, debugOpts?: IDebugOptions, outputPath?: string): Promise<void | IDebugInformation> {
117131
const deviceDescriptor = this.getDeviceDescriptor(liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier, projectData.projectDir);
118132

0 commit comments

Comments
 (0)