Skip to content

Provide a way to use hmr by default for a project #4389

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

Closed
rosen-vladimirov opened this issue Feb 25, 2019 · 5 comments
Closed

Provide a way to use hmr by default for a project #4389

rosen-vladimirov opened this issue Feb 25, 2019 · 5 comments
Assignees
Labels
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

rosen-vladimirov commented Feb 25, 2019

Is your feature request related to a problem? Please describe.
Currently HMR requires passing --hmr option on every command. When I forget to pass it, the application is rebuild and after that I have to stop the command and execute it again, which triggers another rebuild. This slows down my application development.

Describe the solution you'd like
Provide an easy way to have hmr working out-of-the-box, i.e. when I execute tns run [<platform>] hmr to be set by default. It would be great if this feature is enabled by default for newly created projects and if I'm able to enable it for old projects. For example, it can be handled by handling having a property in nsconfig.json that enables HMR.

Describe alternatives you've considered
No

Additional context
HMR provides the best development experience, i.e. application is not restarted when you change .ts, .js, .html, .xml, .css, .scss file in the app, so this improves the experience with several seconds for each change. Also the changes are synced much faster than in normal livesync process.

@jlooper
Copy link

jlooper commented Mar 4, 2019

Yes, but we need to make sure all the 'flavors' of NS work nicely with HMR...working on the Vue piece of this

@NathanWalker
Copy link
Contributor

As long as HMR works reliably and predictably. I'm still seeing oddities with Angular --hmr enabled. Can share on screen if need be (ping via Slack if needed)

@triniwiz
Copy link
Member

triniwiz commented Mar 4, 2019

As @jlooper said once it works on all flavors 😄 .... :shipit:

@miroslavaivanova
Copy link
Contributor

Acceptance Criteria:

  • expected error: --hmr --release
  • expected error: --hmr --no-bundle
  • without useLegacyWorkflow in nsconfig: old behaviour
  • without nsconfig: old behaviour
  • useLegacyWorkflow: true -> old behaviour
  • useLegacyWorkflow: false -> new behaviour: hmr + webpack
  • useLegacyWorkflow: false -> you can stop with: --no-hmr or/and --no-bundle
  • useLegacyWorkflow: false + --release -> webpack build without hmr

@rosen-vladimirov rosen-vladimirov changed the title Provide fast and reliable development experience via Webpack+HMR by default Provide a way to use hmr by default for a project Mar 27, 2019
@rosen-vladimirov
Copy link
Contributor Author

To achieve this, you can set "useLegacyWorkflow": false in your nsconfig.json file. This way, when you execute any project related command (like tns run <platform>, tns debug <platform>), hot module replacement will be enabled by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants