-
-
Notifications
You must be signed in to change notification settings - Fork 245
HMR support for script changes in NativeScript-Vue applications #388
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
Comments
A little bit of insight why a navigation occurs: vue-hot-reload-api is responsible for handling hot module "chunks". In case a template changes, it replaces the render function with a new one, and calls In case the In NativeScript-Vue, when a |
For me only script is getting updated, style changes are not instant and require a change in script to be pushed. Any idea what's wrong? |
@saibbyweb's issue has been introduced and addressed in the |
@msaelices Thanks for reaching out! Currently we are in the middle of 5.3 iteration and our backlog is pretty much set. I'm adding your feature request for extending the API of the navigation stack to our vNext backlog and we will discuss its feasibility on the next planning meetings. |
@msaelices I believe there was a miscommunication regarding this issue and the NativeScript Core framework. The way NativeScript Core currently works is that on Livesync/HMR of a script file there is a navigation in the same Frame with the |
@MartoYankov The issue I can think of with using |
@MartoYankov totally agree with @rigor789. In that case, I guess there would be the same losing backstack issue with Angular, right? |
Please review this part of the PR https://github.com/nativescript-vue/nativescript-vue/pull/444/files#diff-c7066f3e92bcad6c8156ffe597acaa48R106 A simple method which does internally the same thing we did would be perfect, as some calls that we did like |
@rigor789 @msaelices We are aware if this as a usability issue and we are aiming to improve this as a whole in NativeScript for all frameworks. We just don't have a good foolproof solution yet and as @manoldonev mentioned, we are kind of overbooked at the moment. Do you think this should be a blocker for the Vue framework implementation? Actually, Angular currently has it even worse and doesn't even have the The replace navigation approach sounds like a good candidate for an implementation and I think we might add it as a solution to HMR since it's only a development workflow. However, providing it as a public API for navigation would require more work and testing against a lot of scenarios. The problem lies in transitions. We currently have lots of outstanding issues with navigation transitions with nesting navigations and as far as our research went a while back, native frameworks don't have "replace" as a natural pattern. |
@MartoYankov What about having a method for only replacing the last element in the backstack, but intended only for using in HMR scenarios? So, it would be without any transitions and effects because of we, as developers, only need to replace the currently rendered page. I think this would help both to Angular and Vue bindings to bring a better experience to the developers. |
👍 I think an internal method for doing it without any transitions would solve quite a few issues for both Angular and Vue |
As I mentioned, this is definitely a viable solution and we will explore it as an improvement for all three frameworks. We are not considering this as critical. @vchimev is working on HMR for Core and Angular at the moment and I think he will have a chance to look at this soon. That being said, this solution doesn't handle all scenarios in NativeScript. There are scenarios where you have RadSideDrawer, TabView or a Layout as root and you won't be able to refresh these and keep their state with navigation. |
What problem does this feature solve?
NativeScript 5.0 introduces Hot Module Replacement (HMR) Beta and it works great for changes in
template
andstyle
of components in NativeScript-Vue applications.However, a change in
script
navigates to a new Page in the same Frame which needs to be avoided.The text was updated successfully, but these errors were encountered: