-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Detect which Runtime? #93
Comments
Thanks for the suggestion, we will consider how this can be best done and what implications it has. |
This comment was marked as abuse.
This comment was marked as abuse.
Hi, @NathanaelA EDIT: If you wan't to use the version of the runtime as a workaround you can do:
|
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
The main problem you are facing will be fixed with 1.6.2 release with this commit. |
Hi @NathanaelA I've read carefully your points and while I understand them I don't think versioning will help. Before I go into the details I would like to make it clear that whatever decision we take there will be a trade-off. About 1) It is indeed a breaking change on our end. We did a change in modules and the runtime and It was hard to assess the impact of it. As a result we break some existing apps. We already committed the fix in the Points 2) and 3) are similar to 1) I guess this kind of issues will be eventually solved in different manner. I guess the About 4) I think the explicit feature/API availability/discoverability is always proffered to version checks. I would love to discuss how this can be improved in {N} and implement a proper solution. Many of us remember the |
This comment was marked as abuse.
This comment was marked as abuse.
I do realize how my concerns about versioning may look hostile for many of the community. I have to say that I value your opinion and the great work you do for {N} :) Please don't take my unwillingness to introduce versioning as something set in stone. Yet, I am not convinced versioning is a good way to go. Once we introduced it will be very hard and painful to remove it if we revisit our decision. Also, please note that I don't want take this decision by myself and I would rather keep the discussion going. I hope that all can see that for important and critical breaking changes, like #362, we try to provide a fix as fast as possible. In the concrete example our time to reaction is just a few days. I hope this gains the trust of the community. Also, as an active community member you have very quick time to react for every {N} release. Sometimes it may seem that we are holding you back but it is definitely not our intention. It is just the fact that we are trying to be more conservative when providing a new feature. I do realize this can be frustrating and I guess it is a matter of time until both sides learn to deal with such issue. We will try to act more quickly, that's for sure. Now, about the versioning. We've all seen code full of version checks and it is not pretty. I don't mind if it is pretty or not but more importantly often these checks don't work for many scenarios. Bug regression is just one example. There are other alternatives to versioning. We can provide API contracts similar to the ones in Android or UWP for example. Also, maybe it is a good time to revisit our thinking about semver. As I said earlier I would love to help and dig deeper into the this and provide solutions starting with the most critical issues. Also, I would encourage everybody involved to look closely at solutions provided by npm and WordPress. Besides, because the runtimes are npm modules we have the version info already. Look at the {
"nativescript": {
"id": "org.nativescript.app",
"tns-android": {
"version": "1.6.1"
}
},
"dependencies": {
"tns-core-modules": "1.6.0"
}
} I will check with @teobugslayer and @rosen-vladimirov to see whether it is a good idea to merge its content with In any way, I would kindly ask not to rush in providing versioning mechanism without thorough discussion. |
This comment was marked as abuse.
This comment was marked as abuse.
I had a short discussion with @rosen-vladimirov and we analyzed the current state and how it can be improved. Part of the current problem is that we allow app upgrade and the user ends with old plugins + new runtime. It is important to state that while we use We are going to create a proposal at https://github.com/NativeScript/nativescript-cli/issues because it is not Android specific and we consider there it will have much better visibility. I will provide a link once it is available. EDIT: see NativeScript/nativescript-cli#1530 |
This comment was marked as abuse.
This comment was marked as abuse.
If it is a only matter of a simple |
Hi @NathanaelA , |
This comment was marked as abuse.
This comment was marked as abuse.
I think there is some misunderstanding. The (main) code base is one. You have two flavors. Does it really matter if you have if (version_check) {
goLeft()
} else {
goRight()
} or two dependencies // left flavor
goLeft() and // right flavor
goRight() |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
OK, I let me be more precise if (version_check) {
goLeft();
} else {
goRight()
} And // main code base
go()
|
IMO, I don't see why it totally matters, if you don't want to use it yourselves, don't, but if it helps @NathanaelA then let that slippery slope be his to traverse if he wants... As long as exposing it doesn't cause undue burden to the {N} team... I think it can only help plugin developers. I personally don't want to have |
I think this one of those issues when we know we won't get it right in the first time. That's why we keep this discussion and try to find out a good compromise for most of us, hopefully for everyone. Also, as I said if it is just a few |
@slavchev Yeah thats fine, nobody is bent out of shape over it, it's your party :) But like @NathanaelA says, you guys are already internally doing these kinds of checks, what would it fundamentally hurt to expose this to us through the api so we could use it (even if you dont) |
@NathanaelA , I'm expressing my own opinion what I would do in case I have to support a plugin. |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
TL;DR I describe how I use the standard version branches
OK, I am a plugin author and I work on AwesomePlugin (AP). The current version of the runtime (RT) is version A. I work in Scenario 1My AP is compatible with both RT version A and B so I tag my current commit, declare my compatatibility (with A and B), build and publish my AP. Scenario 2There is a breaking change in RT version B and my AP doesn't work anymore. Say a simple Scenario 3There is a breaking change in RT version B and my AP doesn't work anymore. I branch from
In commit Then I continue work in
Once I am ready, I branch from
In commit I continue to work in
I want to provide this feature to my existing versions of AP (VERSION_A and VERSION_B) so I back-port it with commits
I tag I support a old version branches as long as I find it feasible, For example, I may decide to back-port my new feature only to VERSION_A of my AP. At that point a bug in RT version A is discovered. It turned out the bug in fixed in RT version B. I switch to VERSION_A branch and fix the bug with commit
I tag Scenario 4There is a breaking change in RT version B and my AP doesn't work anymore. The change in RT version B is a big one and I decide to abstract it in a new dependency. I will keep it short this time but I am going to apply the same approach from scenario 3. I build my AwesomePlugin component (APC). I branch where I have to and build and publish to versions VERSION_APCA and VERSION_APCB. Then I use APC in two different branches of my AP, build and publish two of it VERSION_A and VERSION_A and I set VERSION_A to have dependency to RT version A and VERSION_APCA. Next, I set VERSION_B to have dependency to RT version B and VERSION_APCB. This is really a variation of the previous scenario. Again, this is what I would do, YMMV. EDIT: As far for the V8, they use the described approach https://github.com/v8/v8/network |
There are example of both worlds. For example Chrome does not allow you to detect the v8 runtime version. At least is not easy and totally hacky. Also note that there are people trying to do just that. On the other hand Android is good example of promoting version checks for multiple platforms support. You can also detect if it is art or dalvik runtime executing your code. Also .NET have very easy version checking. https://msdn.microsoft.com/en-us/library/system.environment.version.aspx I am not opposed to the idea of having version exposed if that will make someone life easy. Having the version information can help someone shoot himself in the foot, but that's fine if that's what he wants/needs to do. Stopping someone from messing something by hiding information will only make them make even more hacks to get what they need. For example including build hooks in plugins to hard code the package.json version to be available at runtime. So in short my vote is inclined towards what @NathanaelA have requested. |
This comment was marked as abuse.
This comment was marked as abuse.
I tried to analyze the reasons behind this issue. I tried to answer questions like why it was open last June and why it resurfaces now. I think this is mainly because we did a breaking change, namely NativeScript/NativeScript#1577. Also, there is another important thing. While I looked deeper in
Here is a short excerpt.
Currently we have What do you think? |
This comment was marked as abuse.
This comment was marked as abuse.
+1 for letting us choose and avoid branch complexity... If we want to for plugin X. If it's a TINY change i just want a simple if statement... |
Guys, the more we discuss the more I get confused 😄 I described what git workflow I use, I never meant that you should do the same. I guess it is my fault that I haven't been more clear about that. Everybody uses some workflow that works for him/her and it is not my business to tell the people what to do 😄 If you don't want to have multiple branches that is fine with me. Nevertheless I would like to understand what do you think about the following suggestion. The same scenario as before. You are about to ship your plugin and we release a new version of the runtime with a breaking change that you can easily workaround with an
Is it a high price to pay? Do you want to avoid having your plugin published twice? All we want is to make it easier for you guys. We did a mistake by using |
Is their a command to get the current android runtime version, this would be very useful for add on. I've got a add-on that is going to require a patch that hasn't been deployed yet. This would be great if I could say
if (__versionRuntime <= "1.02") then doSomething()
The text was updated successfully, but these errors were encountered: