Comments (5)
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]
orangularjs@~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:
- Consider allowing metadata like dependencies to be added to packages on a per version basis
- Consider expanding the concept of
mainfile
to either an array of files or an array of each of js and css files
from jsdelivr.
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.
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.
@tomByrer Check this out https://github.com/jsdelivr/api We might integrate dependencies in the API.
from jsdelivr.
Discussion can be continued here https://github.com/jsdelivr/api
from jsdelivr.
Related Issues (20)
- cdn error in egypt HOT 1
- The jsDelivr ESM link doesn't work for Box2D-WASM HOT 1
- Unable to import new Dart Sass 1.63.6 with +esm flag
- CJS exports inside if/else blocks are not exposed to ESM code HOT 10
- Failed to bundle [email protected] using Rollup v2.79.1 when using esm flag
- Phishing email payload served by jsdelivr HOT 1
- Package Landing Page is Broken - 404 Not Found HOT 2
- Search for npm package "p5play" doesn't show correct results HOT 4
- Couldn't find the requested file HOT 3
- Unable to download packages from Egypt HOT 3
- renamed npm package does not exist in the CDN HOT 4
- Purging for images (binary files) makes no effect HOT 3
- failed to bundle npm/[email protected]/+esm
- why cdn.jsdelivr.net blocked in egypt HOT 1
- jsDelivr failing at creating a link for our @melonjs/spine-plugin package
- The hash value of the integrity attribute of the script tag in INSTALL area is incorrect HOT 2
- A deprecated package is not shown as deprecated HOT 1
- Verdaccio fixed token HOT 1
- esm.run causing duplicate code to run due to bundling
- Missing redirect => broken import HOT 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 jsdelivr.