Giter VIP home page Giter VIP logo

Comments (5)

ggoodman avatar ggoodman commented on May 14, 2024

Hi @jimaek, I was referred to this issue by @bebraw who suggested that I may be interested in this new api from a http://plnkr.co perspective (I am the creator of that site. which has a mini package repository of its own).

The two main reasons that I do not rely on any existing package managers or CDN APIs are as follows:

  • jsDelivr (and others) show links to all files of a given package. Including every file of a package like Angular (http://www.jsdelivr.com/#!angularjs) would cause both the minified versions and and extraneous files to be added to a user's project. For my site's needs, I need packages to be lean and to contain only the required files since previews are refreshed in near real-time. The proposed mainfile endpoint doesn't quite solve this issue for me as it is quite possible for packages to require both css and js files (and potentially multiple of each). My solution is to store an array of css and js file links.
  • I have a built-in dependency resolution system based on semver. It works a lot like the dependencies field of bower, npm, etc.. For example, a package that relies on the current Angular version might have a dependency of [email protected] or angularjs@~1.2.5. What would happen as a result is that inclusion of the requiring package would automatically also include the Angular package and all of its dependencies (if it had any). This makes it very painless for users to add packages to their projects (plunks). The status quo on CDN hosting sites is not to include this sort of meta-data. Without that, the novelty of my solution (and the user-experience) is lost.

Now, you may be saying, why not just use Bower, but the truth is that would mean hosting the files which is out of the scope of my project and also beyond my level of competency (that's why you guys exist!).

Now, this should not at all detract you from moving ahead with this api since I am not at all representative of your user-base, but my closing suggestions would be:

  1. Consider allowing metadata like dependencies to be added to packages on a per version basis
  2. Consider expanding the concept of mainfile to either an array of files or an array of each of js and css files

from jsdelivr.

jimaek avatar jimaek commented on May 14, 2024

That's a real problem right there. I don't think dependencies would ever make it to the CDN but how about an alternative? I can take care of the hosting but I am not really sure how to do what you need.
For example I can give you access to origin server restricted to your own directory. Would that work?

I would love to help plnkr with anything I can, do you think there is any other way to do it?

from jsdelivr.

tomByrer avatar tomByrer commented on May 14, 2024

I think ggoodman is on to something. There is a trend in the Bower/Node world to include all dependencies inside the Github repo. I have a feeling this trend might spill over to CDN hosting also.

I don't think dependencies would ever make it to the CDN but how about an alternative

A few include dependencies in CDNs now, especially fonts which IMHO should be in a separate CDN repo. Maybe then sym-link those dependencies, & add a filter in the API call to include or exclude sym-linked files?

from jsdelivr.

jimaek avatar jimaek commented on May 14, 2024

@tomByrer Check this out https://github.com/jsdelivr/api We might integrate dependencies in the API.

from jsdelivr.

jimaek avatar jimaek commented on May 14, 2024

Discussion can be continued here https://github.com/jsdelivr/api

from jsdelivr.

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.