Giter VIP home page Giter VIP logo

Comments (8)

thomasdavis avatar thomasdavis commented on May 6, 2024

Will get back to you with a more thorough answer, in the mean time there is
already a Sublime 2 cdnjs package you can check out.

On Thu, Sep 13, 2012 at 8:26 AM, Jannis Gundermann <[email protected]

wrote:

I'm using Sublime Text 2 and the Nettuts Fetch plugin which can fetch
resources via a URL, at the moment trying to get the latest version of
Modernizr proves difficult as there doesn't seem to be a single URL that
would auto server the 'latest' version of this script…

Currently I'm querying the url: "
http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.1/modernizr.min.js"directly but the moment
2.6.2 comes out I will still be referencing 2.6.1.

Is there a better way to grab the "latest" of a given library?

Something like: "
http://cdnjs.cloudflare.com/ajax/libs/modernizr/latest/modernizr.min.js"where the latest folder would always contain the most up to date version of
that lib would be nice.

Any thoughts on this or a better way for me to do what I'd like to do here?

Thanks for reading.


Reply to this email directly or view it on GitHubhttps://github.com//issues/423.

from cdnjs.

jannisg avatar jannisg commented on May 6, 2024

Thanks for the reply Thomas.

I've installed the cdnjs package but noticed that it only adds a script tag with the properly set src attribute to the chosen library file.

While this is nice, I would like to access the contents of said script so that I can quickly dump the entire script (not just a link/reference to the script) into a local file.

Look forward to your reply.

from cdnjs.

pwnall avatar pwnall commented on May 6, 2024

I think this would be very useful. latest might be asking for trouble though. How about supporting URLs like

  • /ajax/libs/library_name/2.6.x - latest 2.6
  • /ajax/libs/library_name/2.x.x - latest 2.x
  • /ajax/libs/library_name/x.x.x - latest

For libraries that use semver, this should work pretty well.

from cdnjs.

jannisg avatar jannisg commented on May 6, 2024

The latest was more for explaining my point than suggesting that it was the best solution, @pwnall's does seem much nicer though as it would allow the locking of a major version which could be very handy.

from cdnjs.

ryankirkman avatar ryankirkman commented on May 6, 2024

I think it would be good to do things Google style, e.g.

http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js
http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js

Notice you can have the latest major, minor or specific version. The nice thing about this strategy is it doesn't make assumptions about semantic versioning, e.g.

http://ajax.googleapis.com/ajax/libs/prototype/1/prototype.js
http://ajax.googleapis.com/ajax/libs/prototype/1.7/prototype.js
http://ajax.googleapis.com/ajax/libs/prototype/1.7.1/prototype.js
http://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js

I'll begin investigating possibilities for achieving this.

from cdnjs.

jannisg avatar jannisg commented on May 6, 2024

That would be my preferred url syntax too.

Thanks @ryankirkman for looking into this.

from cdnjs.

thomasdavis avatar thomasdavis commented on May 6, 2024

@jannisg @ryankirkman because we are running a server for the stats now, we could throw an API on there that could handle this situation.

Would add network request so wouldn't be fantastic for serving files on website.

Or we could throw into the build process a script that copies the latest version into a latest.js file next to package.json...

from cdnjs.

thomasdavis avatar thomasdavis commented on May 6, 2024

Closing this issue for more information visit #360

from cdnjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.