Skip to content

Remove dependency on jQuery #7405

@septatrix

Description

@septatrix
Contributor

Most things we use jQuery for can now easily be done using vanilla JS even in IE11.

Removing jQuery therefore does not impact browser coverage significantly and instead leads to a smaller website to serve. As this is be a breaking change I would propose to discuss about implementing this for the 4.x release next year.

If the consensus is to go ahead with removing jQuery I would volunteer for this.

Activity

added this to the 4.0.0 milestone on Apr 3, 2020
tk0miya

tk0miya commented on Apr 3, 2020

@tk0miya
Member

+0: I don't have a strong opinion for your proposal.

@TimKam Any comments?

TimKam

TimKam commented on Apr 3, 2020

@TimKam
Member

I like the idea and was actually contemplating it, but we need to make sure we don't introduce bugs on the way, so it will require some effort. Happy to get some help.

mgeier

mgeier commented on Mar 6, 2021

@mgeier
Contributor

What about a configuration setting that allows to select whether jQuery should be loaded or not?

If the default value is to use jQuery, this wouldn't be a breaking change, but if people want a smaller website, they could opt out.

tk0miya

tk0miya commented on Mar 6, 2021

@tk0miya
Member

Not to load jQuery simply causes errors in our JS. It seems the full-text search becomes not working. I think it's broken switch. So we need to refactor our JS before adding such a configuration.

TimKam

TimKam commented on Mar 6, 2021

@TimKam
Member

Still, it could be a starting point to first use a flag, if we are concerned that there could be issues with legacy browsers (most likely, there will be issues with very old browsers, the only question is whether these browsers are relevant at all).

tk0miya

tk0miya commented on Mar 6, 2021

@tk0miya
Member

I got the following errors if I removed the jQuery loading tag. And search form vanished. Is this really a good starting point?

doctools.js:35 Uncaught ReferenceError: jQuery is not defined
    at doctools.js:35
index.html:71 Uncaught ReferenceError: $ is not defined
    at index.html:71
TimKam

TimKam commented on Mar 6, 2021

@TimKam
Member

Sorry, I meant: after an initial refactoring, it could be a good starting point to have flag for a while, so that people can switch back easily. But even there, I am not sure. Looking at the basic template, there are not too many occurrences.

25 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @astrojuanlu@mgeier@tk0miya@agjohnson@pradyunsg

        Issue actions

          Remove dependency on jQuery · Issue #7405 · sphinx-doc/sphinx