Problem/Motivation
- Disqus JS (the one that comes from Disqus.com) is not the most optimal JS code and I don't think it's getting optimized any time soon. Thus, we should improve anything else that we can improve, e.g. disqus.js in the Disqus module.
- Not all sites use jQuery these days, mostly because core JS has a ton of new features.
- Disqus doesn't seem to use much jQuery, so ideally, the dependency on jQuery should be removed.
Proposed resolution
- Allow lazy-loading.
- Once that issue is closed, the dependency on jQuery should be removed.
- Possibly, the Disqus comment count and Disqus comment thread JS should be split into 2 files? Thus, sites will only load the code that will actually be used.
If a maintainer promises fast reviews and commits, I'd gladly volunteer to work on this issue to get things done fast :D In that case, feel free to assign the issue to me (Jigarius).
Issue fork disqus-3212045
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
jigariusComment #3
gaurav.kapoor commented@jigarius Please feel to work on the issue which you have raised, I will try my best to review patches whenever I get time.
Comment #4
jigariusI've proposed some changes in this initial pull request which removes jQuery from the visitor-facing javascript.
Once that one is approved, I'll make one more round of small changes to close this issue and I'll create a 3rd pull request to enable lazy-loading of Disqus comments.
My humble request will be to get this tested merged ASAP so that the PR doesn't become obsolete.
Comment #6
gaurav.kapoor commented@jigarius, Sorry, I didn't get much time to review the pull request, Can you open it again?
Comment #7
jigariusHi Gaurav. The merge request is still open. Here's a link to it:
https://git.drupalcode.org/project/disqus/-/merge_requests/1
Comment #8
gaurav.kapoor commentedComment #9
gaurav.kapoor commentedComment #10
gaurav.kapoor commentedComment #11
robloachThis is a great change, though there are some conflicts. Thanks!