Comments (3)
The pub API has two potential sources for fetching the "latest" version on the packages endpoint:
- The "latest" field on the packages, which will take the latest stable release, if none, the latest pre-release
- A list with all versions, assuming that the list is ordered chronologically.
Some facts about this:
- We cant trust the chronological order of release to define as being "up to date", especially when it is about pre-releases. One may have two pre-released tracks for the same version with interlacing release dates. Ex:
- 0.2.0-nicefeature.1 released Monday
- 0.2.0-awesomefeature.1 released Tuesday
- 0.2.0-nicefeature.2 released Wednesday
You wouldn't like to have people updating from awesomefeature.1
to nicefeature.2
since they may preview different features.
- We cant trust pub-semver's compareTo to define the order of pre-releases. Since
0.2.0-awesomefeature.1
is considered precedent of0.2.0-nicefeature.1
because of alphabetical order.
Proposal:
Add a boolean flag to isUpToDate
to always return true
if the running version is a pre-release since there is no safe way to define compare pre-releases.
from pub_updater.
This affects specifically cases where there is a stable release for that package.
For packages with only pre-releases, this won't happen.
The fix for this issue should maintain the behavior on the latter but fix the false positive on the former.
from pub_updater.
@renancaraujo Thanks for working on this! An approach to still support upgrading pre-release versions could be to allow users to pass in a sorting function for pre-release versions. WDYT?
from pub_updater.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pub_updater.