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

Host jQuery locally #2037

Merged
merged 1 commit into from
Mar 18, 2024
Merged

Host jQuery locally #2037

merged 1 commit into from
Mar 18, 2024

Conversation

nimmolo
Copy link
Contributor

@nimmolo nimmolo commented Mar 18, 2024

This is to shut up the people who have installed browser extensions blocking jquery and then tell us that our images don't load, mysteriously.

I'm reluctant to do this because it locks our version of a frequently changing library, and forces us to manually update the library. jQuery also will load more slowly from our server than from the CDN — if a user has ever downloaded jQuery from the same CDN, they don't even have to load it at all, it will be in the browser cache.

At a certain point we're going to have to tell people to stop blocking public JS repos, or... sorry, Charlie. But maybe this is not so bad in this case, because we're aiming to eliminate the jQuery dependency with Bootstrap 5. Hopefully it's just for a few months.

This is to shut up the people who have installed browser extensions blocking jquery and then tell us that the site doesn't work, mysteriously.

I'm reluctant to do this because it locks our version of a frequently changing library, and forces us to manually update the library. At a certain point we're going to have to tell people to stop blocking public JS repos, or sorry Charlie.

But maybe this is not so bad in this case, because we're aiming to eliminate the jQuery dependency with Bootstrap 5, so maybe it's just for a few months.
@coveralls
Copy link
Collaborator

Coverage Status

coverage: 94.428% (+0.003%) from 94.425%
when pulling b8fdce8 on host-jquery-importmap
into 6ebe9d5 on main.

@nimmolo nimmolo marked this pull request as ready for review March 18, 2024 03:12
Copy link
Member

@JoeCohen JoeCohen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not knowledgeable enough to add anything meaningful to this.
Does hosting jquery increase the load on our system?
@mo-nathan: Is it a good practice to rely on 3rd party services for core functions?

@mo-nathan
Copy link
Member

This seems reasonable to me. Technically, yes, it increases the load on our system, but the jQuery file is less than 300K and I expect it would be aggressively cached.

@nimmolo nimmolo merged commit e1aed1e into main Mar 18, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants