-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add /libraries
#16
Comments
Not sure I like this format. It creates some confusion about what data is 'CDN agnostic'. For example, shouldn't 'mainfile' be inside each CDN? Also, I think that everyone who uses those API's will probably need to do some level of processing, so maybe it is better if the format for this API will be identical to the format of specific CDN queries. Just my two cents. |
@shahata Good point about mainfile. CDN agnostic data == package.json/bower.json? This removes some redundancy and provides metadata for CDNs that are missing it entirely (ie. BootstrapCDN, jQuery CDN). If I return just matching cdns, it will remove most of search and filtering power from the API. Technically what you are proposing would be simpler, though. Let's see if we get more opinions on this. :) I'm adding your scheme here so it's easier for others to contribute without having to check #9.
|
I am not too excited by this. Perhaps it is my time using spreadsheet pivot tables; where you don't re-list redundant data to reduce noise. But maybe I'm missing a use-case; why you NEED to the extra data (memory & bandwidth) if you already specified the dataset you're querying please? Otherwise, looks cool to me, cheers! |
Could make it easier for v2 queries, but harder for v1 queries upgrading to v2. Maybe allow including the 'cdns' via [
{
"mainfile": "jquery.min.js",
"name": "jquery"
"cdns": {
"jsdelivr": {
"2.1.0": [
"jquery.js",
"jquery.min.js",
"jquery.min.map"
]
},
}
}
] |
I would rather let |
For some lookups, a simple CDN array would be great, but for others it would be a total of 2-5 (assuming other CDNs are added later) API requests, time to wait, merging of arrays, etc. |
That's true. I guess it makes sense to return CDN info too. |
I found a solid use-case: https://duck.co/duckduckhack/ddh-intro |
It would be super cool to become a source for DuckDuckGo. |
@jimaek Why not? Maybe try contacting DuckDuckGo? Possibly they can provide some further ideas etc. |
I don't see a lot of activity here https://duck.co/ideas |
I was planning on doing it. Just waiting on v2 to stabilize a bit more. |
@tomByrer Awesome, do you want me to create a repo for you in jsDelivr org? Or you prefer doing it as your personal project? |
@tomByrer Any specific issues to resolve in mind? I have some work to do right now but I guess some sort of prototype would be in order. |
Thanks for asking guys! I have 2 ongoing projects (one of which is to find a paid gig/job), so 1st phase is brain-storming & asking DuckDuckGo questions. Then I'll juggle progress between projects. Since this is a real-life use-case, this project can also help hone v2 API. The unified CDN search can be key helpful; that's why I'm posting here. There is also "islands" for Yandex which is similar, but may have an specialized interactive form to hone searches. I think I'll do that after DuckDuckGo, since Yandex's can be more complex, but I'd like to keep my brainstorming & progress public... TIA |
There are no extra logins. I will just give you admin rights on that repo and you will be able to do whatever you want there. Same account, same login. Interested? Regarding extra API feature you can discuss that with @bebraw Let us know if you need anything. |
Thanks, a /jsdelivr/duckduckgo repo would help to get more involved. Let me see if DDG caches API requests, then specific needs can be figured out from there. |
@tomByrer Done. You are now member of jsDelivr Organization and admin of https://github.com/jsdelivr/duckduckgo |
Thanks! Party time 🍰 |
@bebraw how is this going? I was looking into merging the CDNs myself, but I saw it would not be an easy pivot. |
I haven't touched it as I have been busy with paying work. When do you need it? |
Thanks for the reply. I'm somewhat busy also; I'll play with other things &/or figure out a way to merge the datasets until you have the time. Do you have a particular dev stack I need to use to run this locally please? Or is |
and you are good to go. It will take a while to build the in-memory database for each target so you might get blank results for a while. If you need the aggregate fast, maybe it makes most sense just to build another bit in front of the API? Then it becomes just a simple mapping problem and you don't need to care about the insides of the API. |
I could do that, or
Do you want all in here, 1 Issuer per CDN, or 1 issue per item (15+)?
Perhaps, actually one of my use-cases: help people & scripts find a particular version regardless of what CDN it is on. |
@tomByrer Ok. How about I generate the Google |
sure, thanks. I wasn't expecting anything from you aside from planning for a while; take your time please. |
@tomByrer Done. Demo: http://api.jsdelivr.com/v1/google/libraries?name=AngularJS Note that there's a slight irregularity on the paths on Google side at Dojo ( |
Cool ty looks nice so far. |
Note that will be possible only for jsdelivr. In other cases it would be always the same as they don't provide this sort of info. |
jsDelivr |
Yes. That's how I'm mapping it right now. What I'm saying is that in their case it would always point at the same I'm guessing we can do version specific mainfile only for jsdelivr. Doing the same for others seems a little redundant since it's always the same. In jsdelivr's case the top level |
I'm thinking of jsDelivr superseded other CDNs's "mainfile" if both have the same filename/version. I'm indifferent how you do it for CAN-specific queries, but that's how I plan to consume it. I pinged CDNJS about the mainfile issue.
Yes, I assumed that would be best also, assuming you keep historical data as new versions are added? |
The historical data doesn't matter. Latest is latest with or without history. :) |
Sorry I didn't explain well. I mean you store what the |
In jsdelivr's case the sync process takes a look at the directory structure and reconstructs the information every time it syncs. So in case changes are made to any |
Yea I was afraid a total database rebuild happened every time your ran your API script. So really we will [eventually?] need that |
If execution time or something becomes a problem, it's possible to construct the db only once in a while and rely on GitHub pubsubhubbub for changes. That will pretty much resolve the issue. |
Related: #48 Explicit documentation of asset URLs |
As an FYI, one way I was planning to demo v2 is to use a JSON DB PaaS like https://www.firebase.com/ were we can mock how the JSON should be served first, then actually program it. Firebase is really handy for quick demos, & easy to climb the JSON tree via the web interface. |
Further v2 plans if I get to it before others:
|
Due to lack of bulletproof normalized names I think we can close this issue as its very hard to do. |
Do you think this cannot be done well enough through some hybrid matching:
|
yes, we have some pretty big differences in some projects. Some are hosted only on a single CDN as well. I dont see a solution to every single problem we would have |
Or just use all the names in all available CDNs (array)? Might make some projects easier to find. |
What you say sounds more like a |
It would be potentially interesting to add a library oriented resource. Example:
GET
/v2/libraries?normname=jquery/jquery
(need to use a normalized name here to avoid name clashes (just see all color libs))This simply aggregates the current information in a different format. In the beginning you can see common meta (name, description etc.). CDN specific information is stored to
cdns
.Possible additional benefit of the scheme is that it would allow us to aggregate libraries not available in any CDNs yet to the index.
The text was updated successfully, but these errors were encountered: