jmdobry / angular-cache

angular-cache is a very useful replacement for the Angular 1 $cacheFactory.
http://jmdobry.github.io/angular-cache
MIT License
1.39k stars 156 forks source link

Tag versions #21

Closed pdf closed 11 years ago

pdf commented 11 years ago

Please tag versions so that they can be pinned. Also, it would be nice if the output filenames were not versioned (ie - angular-cache.js / angular-cache.min.js rather than angular-cache-n.n.n.js), so that references don't have to change with an update.

jmdobry commented 11 years ago

See angular-cache/tags. What is it about the tags that isn't to your liking? And what do you mean by "pinned"? Are you using raw.github.com as a CDN?

Drone.io archives the artifacts of each successful build. You can find them at drone.io.

There is a file that isn't versioned, though it isn't minified. See src/angular-cache.js.

It isn't good practice to depend on a 3rd-party library that isn't versioned. See how Google Hosted Libraries (CDN) does it as a reference.

The intention of angular-cache-n.n.n.js is that it is frozen and won't change, saving you and a lot of other people a lot of heartburn. It's up to you to choose which version you want to use with your code. Do you really want to put that power into the hands of someone else?

pdf commented 11 years ago

See angular-cache/tags https://github.com/jmdobry/angular-cache/tags. What is it about the tags that isn't to your liking? And what do you mean by "pinned"? Are you using raw.github.com as a CDN?

Sorry, I should have been more explicit - I'm using bower for dependency management. But the tags don't seem to be updated when releases are made. Also, bower expects semver tags, though the most recent release supports git hashes, so I guess that will do in lieu of up to date semver tags.

There is a file that isn't versioned, though it isn't minified. See src/angular-cache.js https://github.com/jmdobry/angular-cache/blob/master/src/angular-cache.js

Okay, that should work, any chance of updating the bower.json 'main' section to use that instead of the versioned files? There's an argument for a minified version, but most frameworks have some mechanism for handling that.

It isn't good practice to depend on a 3rd-party library that isn't versioned. See how Google Hosted Libraries https://developers.google.com/speed/libraries/devguide (CDN) does it as a reference.

The intention of angular-cache-n.n.n.js is that it is frozen and won't change, saving you and a lot of other people a lot of heartburn. It's up to you to choose which version you want to use with your code. Do you really want to put that power into the hands of someone else?

Yeah, if your only method of dependency management is the script declaration, I can see the reasoning for versioned output files, but using node or bower or whatever, the result is just that you need to update references in multiple places, rather than a single authoritative location. Codifying the version in the filename doesn't make much sense to me, since properly maintained git tags already give you a canonical path to a specific version.

Anyway, I can just modify the way I reference this lib to use the file in src/angular-cache.js and track git hashes rather than version numbers, though that's somewhat more painful.

jmdobry commented 11 years ago

bower expects semver tags

Ah. While I had published angular-cache to bower, I hadn't actually looked at how bower handles versions. I had assumed that it was similar to npm, where you specify the version you're publishing. From now on I will name my tags strictly with semver.

I will keep the versioned output files around for those who don't use Bower, but update bower.json to use the un-versioned file.

pdf commented 11 years ago

Great, thanks, one problem though - src/ is still in ignore, so src/angular-cache.js is also omitted, even though it's specified in main.

Semver also defines a standard notation for alpha/beta/rc releases too. You don't have to use it, but it makes tag history more readable IMO.

jmdobry commented 11 years ago

Good catch. The bower stuff should be fixed up for you now.