Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

[HMR] Changes in plugin do NOT apply in angular projects #914

Open
1 task done
vchimev opened this issue May 28, 2019 · 0 comments
Open
1 task done

[HMR] Changes in plugin do NOT apply in angular projects #914

vchimev opened this issue May 28, 2019 · 0 comments

Comments

@vchimev
Copy link
Contributor

vchimev commented May 28, 2019

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.4
  • Cross-platform modules: 5.4
  • Android Runtime: 5.4
  • iOS Runtime: 5.4
  • Plugin(s): [email protected]
  • Node.js: 12.3.1
  • Please, attach your package.json and webpack.config.js as these configurations are usually critical for investigating issues with webpack - default.

Describe the bug

Changes in plugin do NOT apply in angular projects with HMR.

To Reproduce

git clone https://github.com/NativeScript/nativescript-ui-autocomplete.git && cd ./nativescript-ui-autocomplete/src
npm run postclone && cd ../demo-angular
tns run android|ios (--hmr)

Make a change in nativescript-ui-autocomplete/src/angular/autocomplete-directives.ts.
For example, add a console.log() to the constructor. This change is going to be applied.

Make a change in .nativescript-ui-autocomplete/src/ui-autocomplete.common.ts.
For example, add a console.log() to the constructor. This change is NOT going to be applied.

Expected behavior

The latest change to be applied.

Sample project

Refer to how To Reproduce.

Additional context

In NativeScript projects with Angular, there is a registry of components: https://github.com/NativeScript/nativescript-angular/blob/7.2.4/nativescript-angular/element-registry.ts

Furthermore, any components in use need to be registered - this is RadAutoCompleteTextView in the particular case:
https://github.com/NativeScript/nativescript-ui-autocomplete/blob/v4.0.0/src/angular/autocomplete-directives.ts

As the initial instance of the component is kept in the registry, in order to apply the changes in ui-autocomplete.common.ts, it would be needed to register again the RadAutoCompleteTextView component.

Related to NativeScript/NativeScript#6398.

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

No branches or pull requests

1 participant