ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

feat: Ionic 2 Livereload Maintain Nav Stack

Open Chuckv01 opened this issue 10 years ago • 21 comments

When livereload runs in v2 you are brought to the root page. It would be nice to have an option somewhere to stay on your current page/state or maintain the nav stack.

Chuckv01 avatar Feb 18 '16 21:02 Chuckv01

Is there an intermediate fix we can use until this hits? It's kind of annoying to work on a view that is nested 4 levels down and having to navigate to it every time you want to see the changes you made.

thomastuts avatar Apr 06 '16 08:04 thomastuts

@adamdbradley - as this is was planned for beta5 and I'm at the moment at beta23 - this seems not to be implemented yet or doesn't work as expected.

I mean it is very time consuming if I need to click 4 times (+ ajax calls) in order to test changes as livereload each time move me back to root page.

What's working is styles - once scss is complied it will be displayed but if I touch HTML / TS it immediately reload and back me to root page.

vukasin-nikodijevic avatar Apr 08 '16 16:04 vukasin-nikodijevic

Hey @vukasin0! We are actually currently working on beta.5. If you run ionic info from your project you should get something similar to this:

Your system information:

Cordova CLI: 6.1.1
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.4
Ionic CLI Version: 2.0.0-beta.24
...

Where Ionic CLI Version is the version of the command line interface. This is used to run the ionic commands from a terminal such as ionic start, ionic serve, etc.

and Ionic Framework Version is the framework version (latest is beta.4). This is the library of components, animations, etc. that make up your app. Some more info on all of this here: http://ionicframework.com/docs/v2/resources/using-npm/

Sorry for any confusion, but I hope that helped!

This issue is something we plan on working on soon, but in the meantime you might want to take a look at routing. We have an example here: https://github.com/driftyco/ionic/tree/2.0/ionic/components/nav/test/routing

We use routing in our component demos, as well, though that is a bit more complex: https://github.com/driftyco/ionic-preview-app

brandyscarney avatar Apr 08 '16 19:04 brandyscarney

@brandyscarney - thanks for clarification - I was using

$ ionic --version
2.0.0-beta.23

Yep - mine version is actually beta 3

vukasin-nikodijevic avatar Apr 08 '16 20:04 vukasin-nikodijevic

We will be using ng2's router to keep the state of your app, but the ng2 router is currently going under an overhaul. I'm going to move this back and wait for it to stabilize before we update ionic to better reload at the state the app was left off at. Currently ionic works with ng2's router, but only for simple navigation, not nested. When these features are completed in the ng2 router we'll add it then. Thanks

adamdbradley avatar Apr 14 '16 20:04 adamdbradley

Since Angular 2's router is under heavy development and another refactor, we cannot estimate when the router will be completed. I'm going to take this off of beta8, but leave it as an open issue.

adamdbradley avatar May 20 '16 04:05 adamdbradley

Will the ng2 router be used together with the NavController or we will have to choose which one to use?

zygimantas avatar Jun 20 '16 04:06 zygimantas

can anyone please advise a solution on this ? thanks.

MingxuanLi avatar Sep 27 '16 02:09 MingxuanLi

Waiting eagerly for this. It's really a pain to develop when you have to navigate through several pages after every compile :(

lightheaded avatar Nov 08 '16 08:11 lightheaded

Any updates @jgw96 ? Currently using DeepLinker to kinda hack around it.

iRoachie avatar Nov 08 '16 11:11 iRoachie

For React, there's a thing called react-hot-loader, used in conjunction with Webpack's Hot Module Replacement. This video demonstrates how it works in practice, you don't need to refresh the page or use live reload: https://www.youtube.com/watch?v=xsSnOQynTHs

Perhaps there's something similar for Angular? Because it would be of great help to everyone here until the nav stack is persisted across requests.

gustavohenke avatar Nov 08 '16 12:11 gustavohenke

@gustavohenke There's a similar approach using redux with ngrx, to hotload for angular2. https://teropa.info/blog/2016/08/08/angular-2-hot-loading-with-ngrx-store-and-webpack.html

iRoachie avatar Nov 08 '16 13:11 iRoachie

@iRoachie, could you share how you hacked around it? I hate spending my time doing the clickity-click

lightheaded avatar Nov 12 '16 22:11 lightheaded

Just to back reference it, some guys in the forum seem to have asked the inital question at:

https://forum.ionicframework.com/t/developing-in-ionic2-ionic-serve-or-browser-refresh-to-a-particular-page-rather-than-back-to-the-first-page-of-navigation-stack-solved/47894/6

There are also 2 "workarounds" for this problem.

  1. Change the rootPage to the current page you're working on
  2. Introduce a RoutingConfig with URLs, that are picked up by the router so the current URL can be reloaded. (I did not test this one yet)

Flixt avatar Jan 26 '17 14:01 Flixt

Hello everyone! Thanks for the feature request. I'm going to move this issue over to our internal list of feature requests for evaluation. We are continually prioritizing all requests that we receive with outstanding issues. We are extremely grateful for your feedback, but it may not always be our next priority. I'll copy the issue back to this repository when we have begun implementation. Thanks!

jgw96 avatar Feb 06 '17 19:02 jgw96

This issue was moved to driftyco/ionic-feature-requests#23

jgw96 avatar Feb 06 '17 20:02 jgw96

The link to the new issue is not working. Where was this moved to?

EDIT: Ah.. it's private, i see. That's unfortunate. Very important feature. Apps can get quite complex and always navigating there from root can become very tedious.

cmaart avatar Feb 15 '17 16:02 cmaart

Is there anyway for us to see the status of feature requests?

dschnelzer avatar Mar 16 '17 21:03 dschnelzer

@Flixt that doesn't work, if you do that, then submit something or go back, it will crash because you don't have any other page in the stack.

albe-rosado avatar Jun 30 '17 14:06 albe-rosado

Would love to know what's going on with this. Can we get an update?

fablrdigital avatar Nov 30 '17 16:11 fablrdigital