Skip to content

CLI generates aar files on changes in app/ (livesync with webpack) #3707

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
sis0k0 opened this issue Jun 26, 2018 · 1 comment · Fixed by #3708
Closed

CLI generates aar files on changes in app/ (livesync with webpack) #3707

sis0k0 opened this issue Jun 26, 2018 · 1 comment · Fixed by #3708

Comments

@sis0k0
Copy link
Contributor

sis0k0 commented Jun 26, 2018

Please, provide the details below:

Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?

👍

Tell us about the problem

Setup:

Application with at least one plugin that requires the CLI to generate an .aar file. For example - the sdk samples that use the nativescript-camera plugin.

Command:

tns run android --bundle

Behavior

When you change a file in the app/ folder:

  1. Webpack detects the change and recompiles the JS bundles (for example, bundle.js or vendor.js).
  2. The CLI regenerates all aar files.
  3. The changed JS bundle are deployed on the device and the app is restarted.

Expected behavior

The second step is not needed and slows down the sync of the app. The CLI shouldn't regenerate aar files on changes in the app/ folder.

Why does this happen?

There are a couple of obsolete checks for the --bundle flag that cause the CLI to trigger the rebuilding of aar files every time there's a change in the project.

Which platform(s) does your issue occur on?

Android

Please provide the following version numbers that your issue occurs with:

  • CLI: 4.2.0-2018-06-26-11829 (the same thing happens with the official version - 4.1.2)
@sis0k0 sis0k0 self-assigned this Jun 26, 2018
sis0k0 added a commit that referenced this issue Jun 26, 2018
These checks are no longer needed. They also cause the CLI to
rebuild the .aar files on every change when using `tns run android
--bundle`.

- The first check:
The CLI watches the `App_Resources` folder and will execute the logic
for preparing them whenever there's a change.

- The second check:
The CLI will try to detect changes in node_modules by comparing the
timestamps of every file there on every change. When there's a change,
it will set the `modulesChanged` flag to true. Therefore, the `bundle` flag is not needed.

fixes #3707
@sis0k0 sis0k0 changed the title CLI generates aar files on every change when using webpack and livesync CLI generates aar files on changes in app/ (livesync with webpack) Jun 26, 2018
@sis0k0 sis0k0 reopened this Jul 2, 2018
@sis0k0 sis0k0 added this to the 4.2.0 milestone Jul 2, 2018
@Natalia-Hristova Natalia-Hristova self-assigned this Jul 6, 2018
@Natalia-Hristova
Copy link

This is fixed and will be available in the next CLI official release 4.2.0.

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

Successfully merging a pull request may close this issue.

2 participants