[openstreetmap/openstreetmap-website] Remove jQuery (Issue #7142)
Pablo Brasero
notifications at github.com
Tue Jun 9 10:50:29 UTC 2026
pablobm created an issue (openstreetmap/openstreetmap-website#7142)
Is jQuery required in this project? The codebase is old so I'm sure it made sense for a long time, but I have the impression that now it's used for things already provided by browsers at very high level of compatibility.
Trying now, my browser loads 2.68 MB of uncompressed JS (617.35 kB compressed/transferred). Of that 285k (uncompressed) appears to be jQuery.
Dependencies that require JS:
- jquery-ujs (22kB uncompressed): can't remember exactly what this includes. One thing is support for `method="delete"`, etc which I think nowadays is implemented with Turbo, which we also load.
- jquery.throttle-debounce: throttling/debouncing is old hat in JS. There must be a different library we can use that doesn't require jQuery.
Something potentially important that we'd be missing: delegated events. jQuery makes it easy to set events on elements that don't exist on the page yet, and these magically working when the element appears. Some refactoring might be required. Other, smaller libraries might help here.
If we were do decide to remove jQuery, I wouldn't expect it to happen all in one fell swoop, but rather incrementally: discouraging it from new code while slowly removing existing usage module by module.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/7142
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/7142 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260609/4eee0303/attachment.htm>
More information about the rails-dev
mailing list