-
Notifications
You must be signed in to change notification settings - Fork 483
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
A truncate() or dec() method could be very useful #46
Comments
Why not just use |
Because I also want downward compatibility. So I don't want "0.1.2 and later", I want "0.1.x". |
Wait, so... how are you generating this range, then? I'd think it would work like this:
Is this how it works? So, who's generating this range? The server or the client? |
It's working a bit reverse, let me try again and be more coherent this time:
So at point 3, it's the server that has the range "1.2.x" (in the case of point 3.1) or "1.3.x" (in the case of point 3.2). |
Why not just do this? var versionClientGaveMe = req.headers['x-start-version-or-whatever'];
var myVersion = server.versionOrWhatever;
var isOk = semver.satisfies(myVersion, '^' + versionClientGaveMe); How often do you decrement the version running on the server? |
We roll out releases very often, and if post-release any issues are found, we can rollback the release to a previously installed version. |
if a post-release issue is found, doesn't that mean that you want the client to roll back? |
(didn't mean to close. this isn't a terrible feature idea, i'm just trying to figure out the use case a little bit.) |
You make a good point actually. "better safe than sorry" is a totally acceptable approach here. You've convinced me. I will go for your suggestion. |
Well, it's still a good feature idea, probably, and not terribly hard to do. I'll post a new issue without the use case you presented here :) |
Cool, thanks :) |
I have a situation where I have an API version and my web frontend is aware of that version at application start. When doing live updates of the backend, I want to be able to decide which connections coming from frontend can be considered API stable with my backend (does this make sense?).
Example
0.1.2
0.1.2
0.1.3
In this case, I want to say
0.1.2
satisfies0.1.x
, so the APIs are compatible. Because all version information comes from variables here, I'm wondering how I should go about generating the0.1.x
range, or>=0.1.0 <0.2.0
range. To generate the latter I was thinking of this:The
inc()
method already exists, buttruncate()
does not. Do you think it would make sense to add a method like that?The text was updated successfully, but these errors were encountered: