Description
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.
- git clone https://github.com/NativeScript/nativescript-plugin-seed.git
- cd nativescript-plugin-seed/src
- Open a command prompt / Terminal and write
npm run build
- In the same command prompt/Terminal write
npm run plugin.tscwatch
- In another command prompt / Terminal write
npm run demo.android
ornpm run demo.ios
- Make a change in the
yourplugin.common.ts
and watch how the change is applied to the app - 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.