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

Why is the Vue Router unsupported? #316

Open
Znegl opened this issue Dec 18, 2019 · 6 comments
Open

Why is the Vue Router unsupported? #316

Znegl opened this issue Dec 18, 2019 · 6 comments

Comments

@Znegl
Copy link

Znegl commented Dec 18, 2019

According to the docs the Vue Router is unsupported and we have to wait for the team to resolve the issue.
Looking at the git history for the page, the Vue Router was first supported, then experimental and then unsupported, without ever explaining what the issue was or is. Furthermore there is no link to the issue anywhere, which makes it a bit hard to keep track of.
Could you please elaborate on why it's unsupported? It would make it easier how to handle the limitation. It might also help someone else figuring out a solution to the problem.

We're currently in the process of starting a project requiring code sharing between the web and native apps and we would really really like to use the Vue router and not reinvent routing for our entire app because the NativeScript version of it doesn't support the router.

@Znegl
Copy link
Author

Znegl commented Dec 18, 2019

@rigor789
Copy link
Member

I agree the wording is a little misleading - there isn't a specific outstanding issue that we need to resolve.

The progress has been logged here: nativescript-vue/nativescript-vue#214.

Both @bundyo and I have spent a lot of time figuring out how to make it work, but we've always came across cases where things would start acting up (In very common scenarios too).

What it boils down to is that web routing doesn't have the idea of a backstack, where previous pages are kept alive (a good analogy would be like having a separate tab open for every page of the backstack, you can go back to any of them and be right back where you left off) - instead it has a history, that basically just stores the "url"'s to the previous routes.

The way native apps work is that you don't replace the current page whenever navigating, but rather push the new page on top of the current one.

What VueRouter does is keep track of the history, and render the active page inside <router-view> and does not allow customizing when things are rendered, nor how - which makes it difficult to integrate with the NativeScript's navigation system ($navigateTo, $navigateBack in case of NativeScript-Vue).

I'm hopeful that we can figure out a better solution for Vue 3, since as far as I'm aware the VueRouter will get a full rewrite soon. (Maybe @posva could confirm this)

@posva
Copy link

posva commented Dec 19, 2019 via email

@Znegl
Copy link
Author

Znegl commented Dec 19, 2019

Great! Thanks for the quick and informative answers, both of you!

@rigor789
Copy link
Member

That's great @posva, thanks for the feedback! I do think the ability to add a custom history/router-view will eliminate most of the obstacles if not all of them!

@jswhisperer
Copy link

Glad to hear it's being working on @posva , nativescript seems like the most mature solution for mobile and vue, but it's hard to argure production ready apps without the great vue router support :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants