Skip to content

Commit 62616a4

Browse files
authored
Merge pull request #4850 from NativeScript/kddimitrov/update-documentation-hmr-only
docs: --no-hmr added, --syncAllFiles and --bundle removed, added note…
2 parents 50ac37b + 811b406 commit 62616a4

File tree

12 files changed

+97
-59
lines changed

12 files changed

+97
-59
lines changed

docs/man_pages/project/configuration/prepare.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ position: 7
1010
Copies common and relevant platform-specific content from the `app` directory to the subdirectory for the selected target platform
1111
in the `platforms` directory. This lets you build the project with the SDK for the selected platform. <% if(isMacOS) { %>You must specify the target platform for which you want to prepare your project.<% } %>
1212

13+
When running this command the HMR (Hot Module Replacement) is not enabled by default. In case you want to enable HMR, you can pass `--hmr` flag.
14+
15+
<% if(isHtml) { %>
16+
> NOTE: When passing `--release` CLI will disable HMR.
17+
<% } %>
18+
1319
### Commands
1420

1521
Usage | Synopsis
@@ -21,6 +27,10 @@ Usage | Synopsis
2127
* `android` - Prepares your project for an Android build.
2228
* `ios` - Prepares your project for an iOS build.<% } %>
2329

30+
### Options
31+
32+
* `--hmr` - Enables the hot module replacement (HMR) feature.
33+
2434
<% if(isHtml) { %>
2535

2636
### Command Limitations

docs/man_pages/project/testing/build-android.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Builds the project for Android and produces an APK that you can manually deploy
1313

1414
Usage | Synopsis
1515
---|---
16-
General | `$ tns build android [--compileSdk <API Level>] [--key-store-path <File Path> --key-store-password <Password> --key-store-alias <Name> --key-store-alias-password <Password>] [--release] [--static-bindings] [--copy-to <File Path>] [--bundle [<value>] [--env.*]] [--aab]`
16+
General | `$ tns build android [--compileSdk <API Level>] [--key-store-path <File Path> --key-store-password <Password> --key-store-alias <Name> --key-store-alias-password <Password>] [--release] [--static-bindings] [--copy-to <File Path>] [--env.*]] [--aab]`
1717

1818
### Options
1919

@@ -25,7 +25,6 @@ General | `$ tns build android [--compileSdk <API Level>] [--key-store-path <Fil
2525
* `--key-store-alias` - Provides the alias for the keystore file specified with `--key-store-path`. You can use the `--key-store-*` options along with `--release` to produce a signed release build. You need to specify all `--key-store-*` options.
2626
* `--key-store-alias-password` - Provides the password for the alias specified with `--key-store-alias-password`. You can use the `--key-store-*` options along with `--release` to produce a signed release build. You need to specify all `--key-store-*` options.
2727
* `--copy-to` - Specifies the file path where the built `.apk` will be copied. If it points to a non-existent directory path, it will be created. If the specified value is existing directory, the original file name will be used.
28-
* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application.
2928
* `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. Supported additional flags:
3029
* `--env.aot` - creates Ahead-Of-Time build (Angular only).
3130
* `--env.snapshot`- creates [Snapshot](https://docs.nativescript.org/performance-optimizations/bundling-with-webpack#v8-heap-snapshot) (only for release builds on Mac OS & for Android).

docs/man_pages/project/testing/build-ios.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Builds the project for iOS and produces an `APP` or `IPA` that you can manually
1717

1818
Usage | Synopsis
1919
---|---
20-
General | `$ tns build ios [--for-device] [--release] [--copy-to <File Path>] [--provision [<UUID/name>]] [--bundle [<value>] [--env.*]]`
20+
General | `$ tns build ios [--for-device] [--release] [--copy-to <File Path>] [--provision [<UUID/name>]] [--env.*]]`
2121

2222
### Options
2323

@@ -27,7 +27,6 @@ General | `$ tns build ios [--for-device] [--release] [--copy-to <File Path>] [-
2727
* `--copy-to` - Specifies the file path where the built `.ipa` will be copied. If it points to a non-existent directory path, it will be created. If the specified value is existing directory, the original file name will be used.
2828
* `--team-id` - If used without parameter, lists all team names and ids. If used with team name or id, it will switch to automatic signing mode and configure the .xcodeproj file of your app. In this case .xcconfig should not contain any provisioning/team id flags. This team id will be further used for codesigning the app. For Xcode 9.0+, xcodebuild will be allowed to update and modify automatically managed provisioning profiles.
2929
* `--provision` - If used without parameter, lists all eligible provisioning profiles. If used with UUID or name of your provisioning profile, it will switch to manual signing mode and configure the .xcodeproj file of your app. In this case xcconfig should not contain any provisioning/team id flags. This provisioning profile will be further used for codesigning the app.
30-
* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application.
3130
* `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. Supported additional flags:
3231
* `--env.aot` - creates Ahead-Of-Time build (Angular only).
3332
* `--env.snapshot`- creates [Snapshot](https://docs.nativescript.org/performance-optimizations/bundling-with-webpack#v8-heap-snapshot) (only for release builds on Mac OS & for Android).

docs/man_pages/project/testing/build.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ position: 3
99

1010
Builds the project for Android <% if(isMacOS) { %>or iOS <% } %>and produces an application package that you can manually deploy on a device or native emulator. <% if(isMacOS) { %>You must specify the target platform for which you want to build your project.<% } %>
1111

12+
When running this command the HMR (Hot Module Replacement) is not enabled by default. In case you want to enable HMR, you can pass `--hmr` flag.
13+
14+
<% if(isHtml) { %>
15+
> NOTE: When passing `--release` CLI will disable HMR.
16+
<% } %>
17+
1218
### Commands
1319

1420
Usage | Synopsis
@@ -20,24 +26,21 @@ Usage | Synopsis
2026
* `android` - Build the project for Android and produces an `APK` that you can manually deploy on a device or in the native emulator.
2127
* `ios` - Build the project for iOS and produces an `APP` or `IPA` that you can manually deploy in the iOS Simulator or on a device.<% } %>
2228

23-
<% if(isHtml) { %>
24-
2529
### Options
2630

2731
* `--justlaunch` - If set, does not print the application output in the console.
28-
* `--release` - If set, produces a release build. Otherwise, produces a debug build.
32+
* `--release` -If set, produces a release build by running webpack in production mode and native build in release mode. Otherwise, produces a debug build.
2933
* `--device` - Specifies a connected device/emulator to start and run the app. `<Device ID>` is the index or `Device Identifier` of the target device as listed by the `$ tns device <Platform> --available-devices` command.
30-
* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application.
31-
* `--hmr` - (Beta) Enables the hot module replacement (HMR) feature. HMR depends on `webpack` and adding the `--hmr` flag to the command will automatically enable the `--bundle` option as well. <% if(isConsole) { %> The HMR feature 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.<% } %>
34+
* `--hmr` - Enables the hot module replacement (HMR) feature.
3235
* `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. Supported additional flags:
3336
* `--env.aot` - creates Ahead-Of-Time build (Angular only).
3437
* `--env.snapshot`- creates [Snapshot](https://docs.nativescript.org/performance-optimizations/bundling-with-webpack#v8-heap-snapshot) (only for release builds on Mac OS & for Android).
3538
* `--env.uglify` - provides basic obfuscation and smaller app size.
3639
* `--env.report` - creates a Webpack report inside a `report` folder in the root folder.
3740
* `--env.sourceMap` - creates inline source maps (useful for debbuging bundled app).
3841
* `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release).
39-
* `--syncAllFiles` - Watches all production dependencies inside node_modules for changes. Triggers project rebuild if necessary!
4042

43+
<% if(isHtml) { %>
4144

4245
### Related Commands
4346

docs/man_pages/project/testing/debug-android.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ position: 4
99

1010
Initiates a debugging session for your project on a connected Android device or Android emulator. When necessary, the command will prepare, build, deploy and launch the app before starting the debug session. While debugging, the output from the application is printed in the console and any changes made to your code are synchronizes with the deployed app.
1111

12-
To enable Hot Module Replacement (HMR) in Angular projects, follow the steps outlined in [the HMR documentation section](https://docs.nativescript.org/performance-optimizations/bundling-with-webpack#hot-module-replacement).
13-
1412
### Commands
1513

1614
Usage | Synopsis
@@ -30,14 +28,10 @@ Attach the debug tools to a running app in the native emulator | `$ tns debug an
3028
* `--timeout` - Sets the number of seconds that the NativeScript CLI will wait for the emulator/device to boot. If not set, the default timeout is 90 seconds.
3129
* `--no-watch` - If set, changes in your code will not be reflected during the execution of this command.
3230
* `--clean` - If set, forces the complete rebuild of the native application.
33-
* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application.
34-
* `--hmr` - Enables the hot module replacement (HMR) feature. HMR depends on `webpack` and adding the `--hmr` flag to the command will automatically enable the `--bundle` option as well.<% if(isConsole) { %> 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.<% } %>
35-
* `--syncAllFiles` - Watches all production dependencies inside node_modules for changes. Triggers project rebuild if necessary!
31+
* `--no-hmr` - Disables Hot Module Replacement (HMR). In this case, when a change in the code is applied, CLI will transfer the modified files and restart the application.
3632

3733
<% if(isHtml) { %>
3834

39-
>Note: For more information about HMR, the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398.
40-
4135
### Command Limitations
4236

4337
* You must have Google Chrome installed on your machine.

docs/man_pages/project/testing/debug-ios.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ Initiates a debugging session for your project on a connected iOS device or in t
1313
<% if((isConsole && isMacOS) || isHtml) { %>
1414
<% if(isHtml) { %>> <% } %>IMPORTANT: Before building for iOS device, verify that you have configured a valid pair of certificate and provisioning profile on your macOS system. <% if(isHtml) { %>For more information, see the [Code Signing](https://developer.apple.com/support/code-signing/) and [Maintain Signing Assets](https://help.apple.com/xcode/mac/current/#/dev3a05256b8) sections from the Apple Developer documentation.<% } %>
1515

16-
To enable Hot Module Replacement (HMR) in Angular projects, follow the steps outlined in this wiki: https://github.com/NativeScript/nativescript-angular/wiki/HMR.
17-
1816
### Commands
1917

2018
Usage | Synopsis
@@ -35,17 +33,13 @@ Attach the debug tools to a running app in the iOS simulator | `$ tns debug ios
3533
* `--timeout` - Sets the number of seconds that NativeScript CLI will wait to find the inspector socket port from device's logs. If not set, the default timeout is 10 seconds.
3634
* `--no-watch` - If set, changes in your code will not be reflected during the execution of this command.
3735
* `--clean` - If set, forces the complete rebuild of the native application.
38-
* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application.
39-
* `--hmr` - (Beta) Enables the hot module replacement (HMR) feature. HMR depends on `webpack` and adding the `--hmr` flag to the command will automatically enable the `--bundle` option as well. <% if(isConsole) { %> The HMR feature 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.<% } %>
36+
* `--no-hmr` - Disables Hot Module Replacement (HMR). In this case, when a change in the code is applied, CLI will transfer the modified files and restart the application.
4037
* `--chrome` - Deprecated - default behavior uses '--chrome' implicitly. Allows debugging in Chrome Developer Tools. If set, Safari Web Inspector is not started and debugging is attached to Chrome Developer Tools.
4138
* `--inspector` - If set, the developer tools in the Safari Web Inspector are used for debugging the application.
42-
* `--syncAllFiles` - Watches all production dependencies inside node_modules for changes. Triggers project rebuild if necessary!
4339

4440
<% } %>
4541
<% if(isHtml) { %>
4642

47-
>Note: 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.
48-
4943
### Command Limitations
5044

5145
* You can run `$ tns debug ios` only on macOS systems.

docs/man_pages/project/testing/debug.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,28 @@ position: 6
99

1010
Initiates a debugging session for your project on a connected device or native emulator. <% if(isMacOS) { %>You must specify the target platform on which you want to debug.<% } %> When necessary, the command will prepare, build, deploy and launch the app before starting the debug session. While debugging, the output from the application is printed in the console and any changes made to your code are synchronized on all connected devices or running emulators.
1111

12+
<% if(isHtml) { %>
13+
#### How file changes are handled
14+
With HMR (Hot Module Replacement):
15+
* Changes in `.js`, `.ts`, `.less`, `.sass` and other file types that are accepted will cause a refresh of the application.
16+
* Changes in `App_Resources` will cause a rebuild of the application.
17+
* Changes in any `package.json` file inside the project will cause a rebuild of the application.
18+
* Changes in `node_modules/somePlugin` if accepted will cause a refresh of the application.
19+
* Changes in `node_modules/somePlugin/platforms` will cause a rebuild of the application.
20+
* Changes in `node_modules/somePlugin/package.json` file will cause a rebuild of the application.
21+
* Changes that are not accepted and HMR fails will cause a restart of the native application.
22+
23+
With **no** HMR:
24+
* Changes in `.js`, `.ts`, `.less`, `.sass` and other file types will cause a restart of the native application.
25+
* Changes in `App_Resources` will cause a rebuild of the application.
26+
* Changes in any `package.json` file inside the project will cause a rebuild of the application.
27+
* Changes in `node_modules/somePlugin` will cause a restart of the native application.
28+
* Changes in `node_modules/somePlugin/platforms` will cause a rebuild of the application.
29+
* Changes in `node_modules/somePlugin/package.json` file will cause a rebuild of the application.
30+
31+
When running this command with `--debug-brk` any file change will cause a restart of the native application (HMR is disabled). Changes in `App_Resources` and `node_modules/somePlugin/platforms` will cause a rebuild of the application.
32+
<% } %>
33+
1234
### Commands
1335

1436
Usage | Synopsis

docs/man_pages/project/testing/preview.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ To scan the QR code and deploy your app on a device, you need to have the Native
1515

1616
After scanning the QR code with the scanner provided in the NativeScript Playground app, your app will be launched on your device through the Preview app. Additionally, any changes made to your project will be automatically synchronized with the deployed app.
1717

18-
To enable Hot Module Replacement (HMR) in Angular projects, follow the steps outlined in this wiki: https://github.com/NativeScript/nativescript-angular/wiki/HMR.
19-
2018
### Commands
2119

2220
Usage | Synopsis
@@ -25,15 +23,10 @@ Generates a QR code that can be scanned by the NativeScript PlayGround app | `tn
2523

2624
### Options
2725

28-
* `--bundle` - (Beta) Specifies that the `webpack` bundler will be used to bundle the application.<% if(isConsole) { %> The support for webpack in preview 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.<% } %>
29-
* `--hmr` - (Beta) Enables the hot module replacement (HMR) feature. HMR depends on `webpack` and adding the `--hmr` flag to the command will automatically enable the `--bundle` option as well.<% if(isConsole) { %> The HMR feature 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.<% } %>
26+
* `--no-hmr` - Disables Hot Module Replacement (HMR). In this case, when a change in the code is applied, CLI will transfer the modified files and restart the application.
3027

3128
<% if(isHtml) { %>
3229

33-
>Note: 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.
34-
35-
>Note: 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.
36-
3730
### Command Limitations
3831

3932
* The Preview app comes with a predefined set of NativeScript plugins. If your app utilizes a plugin that is not present in the Preview app, you will see a warning message and your app might not work as expected.

0 commit comments

Comments
 (0)