Skip to content
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

Nested Routers #1089

Open
posva opened this issue Aug 23, 2021 · 4 comments
Open

Nested Routers #1089

posva opened this issue Aug 23, 2021 · 4 comments
Labels
discussion This problem still needs more feedback enhancement New feature or request needs RFC This feature needs to go through the RFC process first

Comments

@posva
Copy link
Member

posva commented Aug 23, 2021

What problem does this feature solve?

Allow using nested memory routers to handle independent views. e.g. the messages on Twitter, or a chat.

A custom History implementation could even save the current page in local storage and restore it when reopening the app.

What does the proposed API look like?

provideRouter(createRouter(...))
// or
createNestedRouter(baseRouterOptions)
  • Could warn if history is based on HTML5
  • No initial navigation
  • Should provide these
  • Could appear in devtools
  • Could automatically unregister the history listener on unmounted
  • Should not change global configs
  • Should still be able to access the global router
@posva posva added the enhancement New feature or request label Aug 23, 2021
@posva
Copy link
Member Author

posva commented Aug 23, 2021

This would have to go through an RFC to better identify the different needs of creation/destruction of nested routers.

@posva posva added needs RFC This feature needs to go through the RFC process first discussion This problem still needs more feedback labels Jul 4, 2022
@posva posva moved this to To Do in Router v4.1.0 Sep 16, 2023
@Bertie2011
Copy link

The use case I have is having independent movable windows in an app with their own navigations.
I also could imagine this being useful for plenty of gamified apps (e.g. a shop/menu sidebar that has multiple levels to it)

@brendomaciel
Copy link

It's a pretty nice feature. It would address this scenario I guess.

@posva posva moved this to Planned in Vue Router Roadmap Apr 17, 2024
@posva posva moved this from Planned to In discussion in Vue Router Roadmap Apr 17, 2024
@kissu
Copy link

kissu commented Aug 7, 2024

Could also be useful in the use case of some micro-frontends where there are a lot of moving parts and people want to have it fully dynamic. Having 2 nested routers doesn't work so well right now.

PS: the current state of this issue is the following:

  • not enough interest
  • too much work
  • need a RFC still

Got this info from posva himself on the Discord server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion This problem still needs more feedback enhancement New feature or request needs RFC This feature needs to go through the RFC process first
Projects
Status: 💬 In discussion
Status: To Do
Development

No branches or pull requests

4 participants