Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Remove RawGit dependency (jsDelivr+GitHack) #573

Merged
merged 1 commit into from
Mar 5, 2019
Merged

Remove RawGit dependency (jsDelivr+GitHack) #573

merged 1 commit into from
Mar 5, 2019

Conversation

ncruces
Copy link
Contributor

@ncruces ncruces commented Dec 17, 2018

This removes the RawGit dependency, which is winding down (fixes #564).

PR #570 suggests using GitHack, which "functions exactly the same."
Unfortunately, #570 doesn't fix the issue where it really maters, see #564 (comment).

For the actual scripts, I used jsDelivr, which seems to have an decent backing.

Elsewhere (mostly: samples, documentation) I used GitHack, because jsDelivr does not support serving HTML content with the appropriate Content-Type.
These usages should really be moved to GitHub Pages (would fix #422).
See the next comment for why I didn't use GitHack for everything.

@ncruces
Copy link
Contributor Author

ncruces commented Dec 17, 2018

GitHack, suffers from the same issue RawGit did, which lead to its demise.

Quoting the website:

I need guaranteed 100% uptime. Should I use raw.githack.com?

Probably not.

raw.githack.com is a free service and cannot provide any uptime or support guarantees, even for CDN URLs. While I do my best to keep things running, things sometimes go wrong. Sometimes there are network or provider issues outside my control, sometimes abusive traffic temporarily affects response times, and sometimes I break things (although I try really hard not to).

Since I run raw.githack.com in my spare time, with my own money and with free CDN hosting by CloudFlare, it has a budget that's probably less than you pay for coffee in a given month. My goal is to help other open source developers get their projects up and running, but if you need to serve files that are crucial to your business, you should probably pay for a host with well-funded infrastructure and uptime guarantees.

Hopefully jsDelivr is reliable enough to hard code into the source.

@mikesamuel
Copy link
Contributor

I'll pull this PR locally, check that the generated sources all rebuild nicely, then be ready to merge it into master.

How time sensitive is this? I'd like to post an announcement to https://groups.google.com/forum/#!forum/js-code-prettifier and give people time to read it and be ready in case there's any trouble.

Ideally this change wouldn't happen over the US holidays when many people are out of the office.

How does landing this change second week of January sound?

@ncruces
Copy link
Contributor Author

ncruces commented Dec 18, 2018

I don't think it's time sensitive at all, just something that needs to be fixed, eventually.
RawGit will continue to work until at least October 2019, according to the website.

@danny900714
Copy link

That is good.

@ncruces
Copy link
Contributor Author

ncruces commented Jan 7, 2019

Is this something that can be looked into soonish?

I have an app that depends on code-prettify and I'd like to know if I can upgrade it with new "official" URLs or if I should just use my own fork.

@ncruces
Copy link
Contributor Author

ncruces commented Jan 14, 2019

Nudging @mikesamuel

@mikesamuel
Copy link
Contributor

Sending out email to support group now.

@mikesamuel
Copy link
Contributor

Announcement at https://groups.google.com/forum/#!topic/js-code-prettifier/IFHev_kLm30

Will add link to README.

@mikesamuel
Copy link
Contributor

f20e152 might introduce a merge conflict with this PR since it cherrypicks this PR's changes to the README and adds a link at the top to the migration announcement.

@mikesamuel mikesamuel merged commit b5fa4d1 into googlearchive:master Mar 5, 2019
@EyalLavi
Copy link

jsdelivr is serving version 0.1.0 of code-prettify, which still references rawgit (https://www.jsdelivr.com/package/npm/code-prettify). This is probably because there has not been an official release of this repo since this fix was merged. Is there a planned release date for code-prettify before rawgit goes away?

@ncruces
Copy link
Contributor Author

ncruces commented Apr 15, 2019

I can confirm the issue. It seems jsdelivr caches things pretty much "forever", which I didn't know. I'm sorry.
There's an issue tracking that behavior and I'm trying to figure out the best way forward.

@ncruces
Copy link
Contributor Author

ncruces commented Apr 15, 2019

OK, so this was a bug with jsDelivr.
Previously cached URLs have been purged from the CDN (but, obviously, not client devices).

I can confirm all files are now current and being served with:
cache-control: public, max-age=604800, s-maxage=43200

So, 7 day private, 12h shared cache. Previously was one year, immutable.
@mikesamuel, you can request purge access here, if you're interested.

Clients who got the "immutable" cached version need to purge their caches before October.

@mikesamuel
Copy link
Contributor

@ncruces Will request access. Thanks for investigating.

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.

repo has dependencies on rawgit, which is shutting down Use Github Pages instead of Rawgit
4 participants