-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
feat(router): stateful routes #538
base: master
Are you sure you want to change the base?
Conversation
37bf152
to
87b6aa3
Compare
Adds stateful routes so that route configurations can specify a module or a module in a viewport as `stateful: true`. A stateful module that's loaded in a viewport is never unloaded when navigating away, it's just not shown, and is displayed with the same state whenever a route places it in the same viewport again. Required by aurelia/router#538. Closes aurelia/router#534.
@davismj This is a pretty highly requested feature. The PR has quite a few changes, so needs careful review. |
@EisenbergEffect I thought I had replied to this one. What does this solve that a |
@oneillci I need a bit of time to review this. I'll keep this on my radar for an April release. |
@jwx - Can I just check something? If I had a route: person/:id/details and I navigated through 100 people, it would have 100 hidden people waiting in the DOM(view)/in-memory(view model). Is this correct? By 'hidden' do you mean 'display:none' in css or removed from the DOM? Apart from increase memory demands are there any drawbacks of this feature? Do you still get the same 'activate' etc events in the 'detail' VM? Is there a way to clear the cache, if you so wanted? |
Was this ever implemented? I am building an app that has a geographic map and I want the map to be retained in memory when I navigate away and return. |
@davismj After addressing the current round of router issues, it would be great if you could review this. This is a very long standing request and this PR has been sitting here for over 6 months. |
And this one too please :) |
Adds stateful routes so that route configurations can specify a module or a module in a viewport as `stateful: true`. A stateful module that's loaded in a viewport is never unloaded when navigating away, it's just not shown, and is displayed with the same state whenever a route places it in the same viewport again. Depending on aurelia/templating-router#64 and aurelia#536. Closes aurelia#534.
87b6aa3
to
76e0f91
Compare
Adds stateful routes so that route configurations can specify a module or a module in a viewport as `stateful: true`. A stateful module that's loaded in a viewport is never unloaded when navigating away, it's just not shown, and is displayed with the same state whenever a route places it in the same viewport again. Required by aurelia/router#538. Closes aurelia/router#534.
Bump. |
@davismj @EisenbergEffect - any news on this? Any eta? |
@jwx @davismj @EisenbergEffect - any news on this? Any eta? If there's anything I can do to help with this please let me know! Would be good to know what's stopping this from being merged (apart form the conflicts) as considering using this branch in production.... |
Apologies for keeping everyone waiting on this for so long. At the moment our priority is with getting Aurelia 2 to alpha. That is not to say that we're abandoning v1, but I strongly believe it to be in the majority of the community's best interest that we first get v2 to a state where we can comfortably recommend it for production, before adding any new features to v1. This feature as well as almost all other requested features are in fact already implemented and well-tested in v2. The bulk of the remaining work in v2 is further improving test coverage, and maximizing backwards compatibility with v1 to ease migration. The original plan was to get v2 done in Q1 this year. Due to various circumstances we won't make that, so we're trying to make sure it will at least be Q2 at the latest, and to maximize the odds of accomplishing that we need to focus all effort on v2 for the time being. After that, the idea is to circle back to v1 and backport some tests and features where possible, bringing v1 and v2 closer to each other to make migration even easier. |
@fkleuver - many thanks for the detailed reply, Looking forward to v2! :-) |
Adds stateful routes so that route configurations can specify a module or a module in a viewport as
stateful: true
. A stateful module that's loaded in a viewport is never unloaded when navigating away, it's just not shown, and is displayed with the same state whenever a route places it in the same viewport again.Depending on #536, #538, aurelia/templating#572, aurelia/templating-router#64 and aurelia/templating-router#65.
Closes #534.