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

Include dependencies #511

Closed
ianopolous opened this issue Dec 13, 2017 · 8 comments
Closed

Include dependencies #511

ianopolous opened this issue Dec 13, 2017 · 8 comments
Labels
A-CDN Area: Hosted dependencies

Comments

@ianopolous
Copy link

Thanks for the great tool! I'm very much enjoying it!

It would be great to have an option to include all dependencies like images, fonts and js etc. rather than linking directly to a cdn. So all the required media are included and served locally.

@Michael-F-Bryan
Copy link
Contributor

This is a pretty frequently raised issue (see #463, #46, #271, rust-lang/book#711). The current behaviour is to first try the CDNs when loading 3rd party CSS/JS (to make use of caching and all that), falling back to local versions if they're not available (original copies are here)... What exactly did you have in mind when you say all dependencies should be served locally?

@ianopolous
Copy link
Author

In my case I'm fine with retrieval from the cdn at build time, but I'd rather the generated pages link to local copies. This means I can then also serve the output up without relying on any external resources and without being blocked by more privacy focused browsers.

@anderejd
Copy link

Is this on the roadmap?
I just ran into this issue where the external URLs are extremely slow making my simple documentation unresponsive. Is someone working on this or should I do it?

@Michael-F-Bryan
Copy link
Contributor

The dependencies problem is definitely still on the roadmap. The big three things we want to improve over the coming months are plugin support, dependencies, and juggling multilingual books and translations.

I think progress has stalled due to not knowing the full requirements of all stakeholders (e.g. developers, "normal" users, debian package maintainers, and slow networks) and because we don't know what the right way to go is.

@mattico threw around the idea of bundling all dependencies into a single bundle.js, meaning all required resources can be pulled from the same place you are fetching the book from. In theory it's a good solution and would remove the reliance on CDNs, but in the end we felt like adding an extra build step and the fact that everything mdbook uses is already importable with <script> tags means it's probably not worth it.

@mattico and @sorin-davidoi, what are your thoughts on having an initial PR which removes the need for CDNs altogether? Do we have any tangible evidence that we are benefiting from using a CDN? @steveklabnik, do you know if this would adversely affect The Book?

@anderejd
Copy link

Ok thanks for the reply! I'll hold my horses and see how this issue develops, maybe I'll pitch in later.

@mattico
Copy link
Contributor

mattico commented Mar 15, 2018

I'd be on board with a PR removing CDN links entirely, even before we figure out what else we want to do.

@mattico
Copy link
Contributor

mattico commented Mar 16, 2018

I looked into this a bit. clipboard.js and fontawesome are easy - they already have local fallbacks. MathJax is a huge annoyance since it has 30,000 PNGs and the only options they give you are "CDN" and "ship entire mathjax folder." I assume that the fonts will need many files each since they support different font formats, but I didn't look too closely. I'd prefer to leave MathJax on the CDN since its optional, and just remove the fonts since the system fonts look fine.

@ehuss ehuss added the A-CDN Area: Hosted dependencies label May 17, 2019
@ehuss
Copy link
Contributor

ehuss commented Jan 15, 2023

I'm going to close as a duplicate of the aforementioned issues. I believe mathjax is the only thing loaded remotely.

@ehuss ehuss closed this as not planned Won't fix, can't repro, duplicate, stale Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CDN Area: Hosted dependencies
Projects
None yet
Development

No branches or pull requests

5 participants