carhartl / jquery-cookie

No longer maintained, superseded by JS Cookie:
https://github.com/js-cookie/js-cookie
MIT License
8.56k stars 4.06k forks source link

Please, provide minified version and project structure #121

Closed Addvilz closed 12 years ago

Addvilz commented 12 years ago

Hi! Is it possible that You could provide us with minified version along with development version in this repository? Without it, it is impossible to update jquery-cookie automatically from within asset management system, as because it needs to be minified by hand.

Also, it would be nice if .js files could be relocated inside /js/ directory, where they belong...

carhartl commented 12 years ago

Imo minification isn't part of a source repository. I believe this has been discussed before, here and elsewhere. Compare jQuery, propably one of the most popular JavaScript libraries out there, just as one example - they do not provide a minified version on GitHub, only for the release distributions they do.

Whether files belong into "js", "src" or something else seems to be matter of preference. As long as there's only a single file I'd like to keep it simple.

Addvilz commented 12 years ago

Except that jQuery provides minified version on CDN/websites. You don't seem to have one. It was only a suggestion to have minified version distributed via Github, You could distribute it whatever You consider reasonable to.

I was only pointing out that it is normal nowdays to have pre-minified version hosted somewhere for automated download.

As for directory structure, keeping things in order is simple. No matter You have 1 or 10 000 library files - documentation, data, demo and actual library files must be separated from everything else. it just a good practice, and it doesn't really matter weather You fallow majority and put js files in js directory, or src directory, or whatever directory.

Please, consider this as a friendly suggestion, and consider it for future.

ralyodio commented 12 years ago

+1 for minified version in github. Not everyone has a js minifier compiler handy.

scriptbae commented 12 years ago

You know, guys, that failing, you can always try a site like this. There's plenty of them on the web.

Addvilz commented 12 years ago

Yeah, we could. Only that the process of minifying is manual. This is internet, it's automatic. More, the whole purpose of this library is to do something automatically, so we wouldn't need to.

Addvilz commented 12 years ago

Klaus, please, take this suggestion as a friendly advice to make jquery.cookie more available! I really appreciate Your work, as for me personally - this plugin has saved my sorry ass a lot of times. And I really, really appreciate what You have done. Wheather You decide to follow this advice or not, noone will think any less of You. Thanks!

FagnerMartinsBrack commented 12 years ago

@Addvilz Every build should have its own minify system. Maybe providing a SVN or something else but I am totally against poluting the source repo with minified files, it is up to the author though.

carhartl commented 12 years ago

As I said, not going to happen within the source repository. Is it possible to add it to tags?

Addvilz commented 12 years ago

I solved the problem of minification by creating an automated service for minifying js for jquery.cookie and with time, probably for other projects.

jquery.cookie minified version is available at http://jsmin.eu01.aws.af.cm/?project=jquerycookie , it is cached for 6 hours and updates itself automatically, so Klaus does not even need to update it manually. :)

nevar commented 12 years ago

Maybe you can add minified version on Download project page?

FagnerMartinsBrack commented 12 years ago

@Addvilz Nice service but don't forget to obfuscate the variables.

Addvilz commented 12 years ago

Yes, will rewrite compression script a bit later :+1:

Additionally, particular URL also serves as a CDN. Javascript is given with proper content type header, although use of the service as CDN is discouraged, and one should always have a local copy.

datacow-com commented 12 years ago

very goold plugin . thank you .

2012/10/26 Roberts notifications@github.com

Yes, will rewrite compression script a bit later [image: :+1:]

— Reply to this email directly or view it on GitHubhttps://github.com/carhartl/jquery-cookie/issues/121#issuecomment-9809767.

dream makes life meaningful.

pboling commented 12 years ago

FYI: github raw source links to minified js should NEVER be used by applications. They will be interpreted as text by older versions of IE because it won't set the correct MIME type. If the minified version were kept here it would tempt people to link to it. In fact that seems to be OP's intent.

http://stackoverflow.com/questions/5502540/should-github-be-used-as-a-cdn-for-javascript-libraries

and from jsfiddle:

https://twitter.com/jsfiddle/status/255957925263187969

https://github.com/jsfiddle/jsfiddle-docs-alpha/issues/95

carhartl commented 12 years ago

Oh yes: #119

Addvilz commented 12 years ago

@pboling that is not my intention at all. It's just too much when You have to keep tens of libraries up to date and minfy them by hand just that You could use them in asset management system where libraries for development and production are managed and kept seperately.