-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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 a local jQuery fallback. #16888
Add a local jQuery fallback. #16888
Conversation
@@ -169,6 +169,7 @@ <h2 class="blog-post-title">New feature</h2> | |||
================================================== --> | |||
<!-- Placed at the end of the document so the pages load faster --> | |||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |||
<script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery-1.11.3.min.js"><\/script>')</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps omit the version from the filename for easier upgrading
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it, but I went with this. I don't have any strong opinion since GitHub doesn't really cache the CSS/JS files for a long time, so it should be OK if we use the same filename.
Please find another reviewer for this. |
Not sure what you mean. The patch is pretty straightforward, isn't it? |
Yes, but I DGAF about the underlying issue, so I'm not a good person to review this. |
I know for sure GitHub pages set the cache to like 10 min for CSS and JS files so it's OK (for now at least). Generally, it's always preferable to use a distinct filename for caching issues. |
Right, it's just that having to modify 15 files to upgrade the jQuery version in the future seems potentially annoying. |
True but it'd just be a search and replace. I'll make a new patch tomorrow with this change.
|
Shouldn't really happen, but China for example has blocked Google so this should help.
152c45c
to
abdf41f
Compare
Used |
@XhmikosR Has this been ported to v4's docs? |
I think it has, yes. And I added the missing fallback in 85ab831. |
Superb |
Shouldn't really happen, but China for example has blocked Google so this should help.
Fixes #16886.
/CC @cvrebert
PS. I skipped template.html on purpose.