Skip to content
This repository was archived by the owner on Nov 17, 2022. It is now read-only.

[DO NOT MERGE] New nsconfig option for enabling HMR by default #1593

Merged
merged 2 commits into from
Mar 28, 2019

Conversation

NickIliev
Copy link
Contributor

@NickIliev NickIliev commented Mar 21, 2019

Related to NativeScript/nativescript-cli#4411

To be merged after CLI v.53 is released.

@cla-bot cla-bot bot added the cla: yes label Mar 21, 2019
@NickIliev NickIliev requested review from Fatme and tsonevn March 21, 2019 12:54
@NickIliev NickIliev changed the title new nsconfig option for enabling HMR by default [DO NOT MERGE] New nsconfig option for enabling HMR by default Mar 21, 2019

> **Note:** There are conceptual differences when the `useLegacyWorkflow` is used in **debug** build versus when used in **release** builds. When the flag is enabled against a debug build, the extended HMR experience is enabled. However, in cases where the `--release` flag is passed (release build) then only the `--bundle` is executed in the background (No HMR). The reason for this is to avoid bringing additional HMR logic and files into production. For details about the differences between Webpack livesync and HMR refer to [the comparative table](/performance-optimizations/bundling-with-webpack#hot-module-replacement).

In case, when you have enabled the default HMR via the `useLegacyWorkflow` option, but you need to test without using HMR you can pass the `--no-hmr` flag to disable the feature for the current build.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no-bundle provides the default experience
no-hmr provides webpack build without hmr

@@ -238,6 +239,49 @@ The `run` command will again take a few seconds, as the NativeScript CLI will be

Now that you have a full setup in place for developing your apps let’s look at a few additional things you can do.

### Using RUN with HMR

The developer experience significantly improves by using the [HMR (Hot Module Replacement)](/performance-optimizations/bundling-with-webpack#hot-module-replacement) feature introduced in NativeScript 5. The option requires Webpack (enabled by default in all NativeScript 5.x.x templates) and behind the scene is creating Webpack bundle with the enhancement of Hot Module Replacement developer experience.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The option requires nativescript-dev-webpack plugin (enabled by default in all NativeScript 5.x.x templates) maybe?

@tsonevn
Copy link
Contributor

tsonevn commented Mar 21, 2019

test

@NickIliev
Copy link
Contributor Author

test

@NickIliev NickIliev merged commit d4ca5d2 into master Mar 28, 2019
@NickIliev NickIliev deleted the niliev/hmr branch March 28, 2019 13:22
@lock
Copy link

lock bot commented Mar 27, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants