Skip to content
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

chore: add jsdelivr and unpkg support #2443

Merged
merged 1 commit into from
Jan 31, 2020
Merged

chore: add jsdelivr and unpkg support #2443

merged 1 commit into from
Jan 31, 2020

Conversation

JounQin
Copy link
Contributor

@JounQin JounQin commented Sep 30, 2019

As title

@yasuf
Copy link
Collaborator

yasuf commented Nov 4, 2019

I see we have axios already in https://cdnjs.com/libraries/axios ? Also we have main in the package.json already (https://github.com/jsdelivr/jsdelivr#configuring-a-default-file-in-packagejson) which should be supported by jsdelivr and possibly unpkg, the CDNs should adapt to existing package.json files instead of libraries adapting to them I'd say. Let me know if this is good enough or if we should still move forward with this PR

@JounQin
Copy link
Contributor Author

JounQin commented Nov 4, 2019

The main field file is node module, not point to umd or CDN file.

@yasuf
Copy link
Collaborator

yasuf commented Nov 10, 2019

@JounQin as per #1110, axios is already on jsdelivr and unpkg somehow, why do we need to add this as well?

@yasuf
Copy link
Collaborator

yasuf commented Nov 10, 2019

I see https://github.com/jsdelivr/jsdelivr#publishing-packages, so all our versions should be available in jsdelivr as long as we push them to npm

@yasuf
Copy link
Collaborator

yasuf commented Nov 10, 2019

closing unless I'm missing something, feel free to repoen

@yasuf yasuf closed this Nov 10, 2019
@MartinKolarik
Copy link

@yasuf those fields are not required but make it easier to discover and use the correct file. jsDelivr supports main as well but that points to index.js instead of dist/axios.min.js so this PR makes sense.

@JounQin
Copy link
Contributor Author

JounQin commented Nov 10, 2019

。。。

@JounQin
Copy link
Contributor Author

JounQin commented Nov 10, 2019

@yasuf you asked the same question before, and I've answered it like @MartinKolarik 's comment, and then you approved this PR. But now you asked the same question...

@yasuf
Copy link
Collaborator

yasuf commented Nov 10, 2019

sorry @JounQin, I hadn't seen the jsdelivr documentation before, as I see right now, both jsdelivr and unpkg links work, and yes, the current main has a different purpose.

The links for the CDNs work fine right now, the part I'm missing is why we need these explicitly instead of having those services take the files from npm? If so, should it point to the regular dist/axios.js or the minified version?

Current links:
https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js
https://unpkg.com/axios/dist/axios.min.js

Even the non-minified versions are up

@JounQin
Copy link
Contributor Author

JounQin commented Nov 10, 2019

@yasuf Personally I prefer:

https://cdn.jsdelivr.net/npm/axios
https://unpkg.com/axios

So that I don't have to know the exact location of dist file, and it should benefit users who doesn't use npm/package manager.

Maybe .min.js by default would make more sense.

@MartinKolarik
Copy link

@yasuf in case of jsDelivr, that field is used by jsDelivr website/API to indicate which file is the "right one", plus it allows using the shorter link. It should be the minified version (even if you set axios.js, jsDelivr will convert it to axios.min.js)

@yasuf yasuf reopened this Nov 11, 2019
@yasuf
Copy link
Collaborator

yasuf commented Nov 16, 2019

@JounQin can you update it to be the minified file?

@JounQin
Copy link
Contributor Author

JounQin commented Nov 16, 2019

@yasuf Done.

@JounQin
Copy link
Contributor Author

JounQin commented Jan 31, 2020

@yasuf Can we get this PR merged?

@yasuf yasuf merged commit 371d8ea into axios:master Jan 31, 2020
@JounQin JounQin deleted the patch-1 branch February 1, 2020 03:09
@chinesedfan chinesedfan mentioned this pull request Feb 15, 2020
@axios axios locked and limited conversation to collaborators May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants