Skip to content

Running app with locally installed plugin DOES NOT transpile the plugin TypeScript files #3378

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
radeva opened this issue Feb 20, 2018 · 4 comments
Assignees
Labels
feature plugins run Describes issues related to run command
Milestone

Comments

@radeva
Copy link

radeva commented Feb 20, 2018

Did you verify this is a real problem by searching the [NativeScript Forum]

I'm still not sure if this is a problem or expected behavior. I'm sure the CLI didn't work like this before.
Have in mind this clarification is quite important for us since it affects the plugin development workflow which we explicitly recommend for building plugins.

Tell us about the problem

Previously when I had to develop a plugin, I followed the guidelines of the NativeScript Plugin Seed stating that I need to run tsc -watch to watch for changes in the plugin and then run the plugin demo using the npm run demo.android or npm run demo.ios. This was enough to transpile the TypeScript when a do a change in the plugin and reload the demo app.

What I noticed recently is that if I follow the workflow above, the app is restared twice. Stopping the command for watching for TypeScript changes "fixes" this. But what it means?

  • Does this mean that running a demo with --syncAllFiles now is able to transpile the plugin .ts files also? - Or is it some side effect in recent versions?
  • Or is it a side effect from the way npm 5 works?

We need to know for certain what to recommend to our plugin authors.

Which platform(s) does your issue occur on?

Both

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

  • CLI: 3.4.1
  • Cross-platform modules:
    "tns-core-modules": "^3.1.0",
    "tns-platform-declarations": "^3.0.0",
  • Runtime(s):
    "android": "3.0.0",
    "ios": "3.0.0"
  • Plugin(s): (look for the version number in the package.json file of your
    project)
  • NPM: 5.6.0

Please tell us how to recreate the issue in as much detail as possible.

  1. git clone https://github.com/NativeScript/nativescript-plugin-seed.git
  2. cd nativescript-plugin-seed/src
  3. Open a command prompt / Terminal and write npm run build
  4. In the same command prompt/Terminal write npm run plugin.tscwatch
  5. In another command prompt / Terminal write npm run demo.android or npm run demo.ios
  6. Make a change in the yourplugin.common.ts and watch how the change is applied to the app
  7. You can now stop the command started in step 4 and repeat step 6.

The change will again be applied, but the app won't be restarted twice. Which means that only running the demo with syncAllFiles is now enough for the plugin TypeScript to be transpiled.

@radeva
Copy link
Author

radeva commented Feb 23, 2018

@Fatme Do we have an idea from which version of NativeScript we have such behavior? I need this in order to specify that for versions less then this specific one, the users need to watch for the typescript changes explicitly.

@Fatme
Copy link
Contributor

Fatme commented Feb 27, 2018

I'm not sure about the exact version of {N} CLI, we've checked that this behaviour is since 1.8 version of tsc compiler (which is released ~ 2 years ago)

Fatme added a commit to NativeScript/nativescript-dev-typescript that referenced this issue Mar 9, 2018
Fatme added a commit to NativeScript/nativescript-dev-typescript that referenced this issue Mar 9, 2018
Fatme added a commit to NativeScript/nativescript-dev-typescript that referenced this issue Mar 9, 2018
@radeva
Copy link
Author

radeva commented Apr 1, 2018

Hi @Fatme @rosen-vladimirov

It looks like the typescript version is not the only thing that affects this behaviour. Check below for details:

Versions:

  • tsc --version -> Version 2.7.2
  • tns --version -> 3.4.3
  • npm --version -> 5.6.0
  • package.json -> review the the camera plugin for package.json of the plugin and the demo.

Follow the steps:

Result: File is not transpiled.
Expected result: Based on the comments in the issue the file needs to be transpiled automatically.

@Fatme Fatme reopened this Apr 18, 2018
@vchimev
Copy link

vchimev commented Apr 18, 2018

I also experience the problem that the --syncAllFiles option does not transpile TypeScript files. I use npm link tns-core-modules in the project below.

Project:
https://github.com/NativeScript/NativeScript/tree/master/e2e/modal-navigation.

Versions:

tsc --version: 2.4.2
tns --version: 4.0.0
npm --version: 5.8.0
nativescript-dev-typescript: 0.7.1-2018-04-13-04

@vchimev vchimev changed the title Running app with locally installed plugin transpiles the plugin TypeScript files Running app with locally installed plugin DOES NOT transpile the plugin TypeScript files Apr 18, 2018
@Natalia-Hristova Natalia-Hristova modified the milestones: 4.0.0, 4.1.0 May 11, 2018
@Natalia-Hristova Natalia-Hristova removed this from the 4.1.0 milestone Jun 18, 2018
@rosen-vladimirov rosen-vladimirov added this to the 6.0.0 milestone May 22, 2019
@rosen-vladimirov rosen-vladimirov added feature plugins run Describes issues related to run command labels May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature plugins run Describes issues related to run command
Projects
None yet
Development

No branches or pull requests

6 participants