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

  1. Allow lazy-loading.
  2. Once that issue is closed, the dependency on jQuery should be removed.
  3. 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

Command icon 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

jigarius created an issue. See original summary.

jigarius’s picture

Issue summary: View changes
gaurav.kapoor’s picture

@jigarius Please feel to work on the issue which you have raised, I will try my best to review patches whenever I get time.

jigarius’s picture

Assigned: Unassigned » jigarius
Status: Active » Needs review

I'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.

gaurav.kapoor’s picture

Status: Needs review » Needs work

@jigarius, Sorry, I didn't get much time to review the pull request, Can you open it again?

jigarius’s picture

Hi Gaurav. The merge request is still open. Here's a link to it:
https://git.drupalcode.org/project/disqus/-/merge_requests/1

gaurav.kapoor’s picture

Status: Needs work » Needs review
gaurav.kapoor’s picture

Version: 8.x-1.x-dev » 2.0.1-alpha4
gaurav.kapoor’s picture

Version: 2.0.1-alpha4 » 2.0.x-dev
Status: Needs review » Needs work
robloach’s picture

This is a great change, though there are some conflicts. Thanks!