-
-
Notifications
You must be signed in to change notification settings - Fork 140
Added the clearRequiredCachedItem command #92
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
Conversation
Can one of the admins verify this patch? |
+1 |
+1 |
@NathanaelA Kudos for the live-sync effort! However I am not sure the proposed way of updating the application is safe. Clearing a single module cache may lead to unpredictable results within the app. For example there are modules that cache the exports of other modules. Imagine you clear a module that is already cached within other modules - in this case the other modules will use the older version. Or there are modules exposing events - such as the What I may suggest here is to restart the entire application, in pretty much the same way we do it in our Companion Application. Here is a sample code:
|
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
While @atanasovg is correct and creating a function that could have weird behavior in the core runtime is not the ideal approach, the huge benefit of the live update for the {N} developer productivity must be weighted in. |
This comment was marked as abuse.
This comment was marked as abuse.
@NathanaelA the point here is about the runtime engine and not about the live sync. Once the method is there future developers (and we are hoping for this platform to have a future, right?) will see this method and might be tempted to use it. The bad thing is that it'll actually work, but with weird edge cases. It is ok for you to implement it, it is less desired for it to be implemented in the runtime - this is why I suggested the hooks, so you, me and everyone else can do all that crazy stuff. With all this theoretical discussion aside, I really suggest {N} maintainers to provide means for @NathanaelA to implement this LiveSync as I truly believe this is by far the most important single feature that {N} developers could have. |
This comment was marked as abuse.
This comment was marked as abuse.
+1 |
1 similar comment
+1 |
dc2cf97
to
5031087
Compare
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
@NathanaelA Also there is API for page navigation without history NativeScript/NativeScript#548 Closing this pull. |
This comment was marked as abuse.
This comment was marked as abuse.
@NathanaelA What you are doing is potentially dangerous code with many side effects. We want to state clearly that such code will not go into the core runtime in any circumstances. The code you are proposing does not take into account multiple things like state of Javascript GC, state of Java GC, module dependencies, require preconditions, state of the native instances, background operations etc. The last thing we want is non deterministic engine which does not provide any guarantee of its operation regardless of the current mode of execution - release or debug. Let me repeat that - the engine we are building should provide deterministic behavior in Release and in Debug mode. Hoping that nothing bad happens is not the best approach when building a software. The commands you designate as "dangerous" (the double underscore commands) are very deterministic and have very predictable results. They are in fact "internal". That's why we designate them with double underscore. We want to be able to change the name, remove them, introduce new ones without introducing braking changes. Now your work is inspiring indeed. Your contribution to NativeScript is invaluable. You will agree with us that is in the best interest for all of having the freedom to reject introducing bad code in the core runtime. What you prove is that LiveSync is major feature and the comments here show we need to do better job for it. We have started working on such improvements as shown in the video. Also we are looking into more deeper deterministic ways to handle js code sync but nothing major to show yet. We choose to close this pull for the better. Don't judge us too hard for that. Cheers, |
This comment was marked as abuse.
This comment was marked as abuse.
@NathanaelA - Thats the spirit Nathanael. Your contribution to {N} is invaluable. And to the {N} community as well. |
😀 |
👍 |
1 similar comment
+1 |
@blagoev in your video It shows that updates with out any restart but when using nativescript-angular livesync restarts the app every time, is there any plans to fix this? |
I̶t̶ ̶s̶h̶o̶u̶l̶d̶ ̶n̶o̶t̶ ̶r̶e̶s̶t̶a̶r̶t̶ ̶i̶f̶ ̶y̶o̶u̶ ̶o̶n̶l̶y̶ ̶e̶d̶i̶t̶ ̶c̶s̶s̶ ̶o̶r̶ ̶x̶m̶l̶ ̶(̶t̶e̶m̶p̶l̶a̶t̶e̶)̶ ̶f̶i̶l̶e̶.̶ ̶I̶f̶ ̶y̶o̶u̶ ̶e̶d̶i̶t̶ ̶a̶ ̶J̶S̶/̶T̶S̶ ̶f̶i̶l̶e̶ ̶(̶p̶o̶s̶s̶i̶b̶l̶y̶ ̶w̶i̶t̶h̶ ̶a̶n̶ ̶i̶n̶-̶l̶i̶n̶e̶ ̶t̶e̶m̶p̶l̶a̶t̶e̶ ̶o̶r̶ ̶C̶S̶S̶ ̶s̶t̶y̶l̶e̶)̶,̶ ̶i̶t̶ ̶w̶i̶l̶l̶ ̶r̶e̶s̶t̶a̶r̶t̶. |
I need this for my http://github.com/nathanaela/nativescript-livesync as it is needs to remove the last version of the page from the cache before it loads the newer version.