Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
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

Description

@vchimev

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): nativescript-ui-autocomplete@4.0
  • 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions