Ionic-cli: Will Ionic State be a part of ionic-cli v3 ?

Created on 15 Mar 2017  路  8Comments  路  Source: ionic-team/ionic-cli

What version of the CLI are you using? Output of ionic --version

Ionic 3 Beta

Short description of the problem:

The ionic state reset functions are gone

What behavior are you expecting?

Is this temporary or will they be removed for certain in Ionic v3 ?

Most helpful comment

This will be removed from Ionic v3. Cordova has made updates so that there is no longer a need for ionic to also track state. We will be providing documentation on why this was done and how to move forward with plugin/platform state management in cordova.

The short answer is all ionic plugin/platform add <...> commands save by default. In order to restore all plugins/platforms just run ionic cordova:prepare <platform name>.

All 8 comments

This will be removed from Ionic v3. Cordova has made updates so that there is no longer a need for ionic to also track state. We will be providing documentation on why this was done and how to move forward with plugin/platform state management in cordova.

The short answer is all ionic plugin/platform add <...> commands save by default. In order to restore all plugins/platforms just run ionic cordova:prepare <platform name>.

The short answer is all ionic plugin/platform add <...> commands save by default.

@jthoms1 This still doesn't appear to be the case as of [email protected].

I just ran ionic plugin add cordova-plugin-inappbrowser in a new ionic 3 sidemenu project. While it did install correctly in the /plugins folder and make an entry in the /platforms/ios/ios.json file, these are both ephemeral folders - i.e. in the template's .gitignore by default. Therefore, there is no 'saved' reference to the plugin in my committed git repo. The next person to clone the repo won't know it was ever added when trying to restore the project.

However, if I explicitly add --save to the command above, an entry is created in the root config.xml to actually 'save' the plugin for the project.

@rob3c what version of the ionic-cli are you using? Asking since you are mentioning [email protected] and my question was about ionic v3

@dmastag oops - good catch! The ionic-cli vs ionic-angular versioning is a bit confusing, and I didn't read as carefully as I should have. As you noticed, I was using the "ionic 3" library, but only via the "ionic 3" CLI at version 2.2.2. I haven't actually tried cli@3, but hopefully it eliminates the confusion surrounding cordova vs ionic plugin - and more generally, state - management.

Yeahh, thats why I like that in ionic-cli v3 all cordova commands are called using
ionic cordova:command

but ionic cordova prepare command doesn't make same as state reset or am i wrong ?

state reset command making remove to all platforms and plugins and reinstall and add them again

how can i make something similar in ionic cli v3 ?

ok i was wrong cordova prepare working goodly

the problem was in storing plugins and platforms in package.json file

it was like old style of ionic , so u should store them either in config.xml or in package.json but with new style of cordova as mentioned here: https://cordova.apache.org/docs/en/latest/platform_plugin_versioning_ref/

note: to store in package.json u should use latest cordova cli vesrion >= 7

I miss the ionic state reset --plugins command. It was very easy to restore plugins or the entire platforms when something wasn't working as expected, specially when you need to use global vars for plugins.

Was this page helpful?
0 / 5 - 0 ratings