-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Remove dependency on jQuery #7405
Comments
+0: I don't have a strong opinion for your proposal. @TimKam Any comments? |
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. |
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. |
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. |
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). |
I got the following errors if I removed the jQuery loading tag. And search form vanished. Is this really a good starting point?
|
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. |
Okay, I understand. I agree the option is worthy if we'll complete the refactoring. So it would be nice if somebody posts a pull request to lessen the usage of jQuery from our JS. |
I have not looked too much into the scope but I can see myself doing this. However I could start at the end of this month at the earliest. |
I'm interested in having Sphinx 5 drop the bundled jQuery entirely, so I'll pick this up! Feel free to move this to the 5.0.0 milestone! :) /cc @humitos so that RTD can prepare for a no-jquery future. |
cc @nienn @agjohnson |
There's an open question here: What are the browsers that Sphinx should target to support? |
I think I'd like to exclude IE 11 from the support matrix, since it'll allow using ES6. Given that IE 11 is not supported even in first-party Microsoft 365 applications and that the end of life of IE 11 is June 15, 2022 -- I think this is acceptable! |
I'd like to hear the opinion of RTD team. They would know the ratio of the browsers in the real world. The EOL of IE11 is good news to us. Sphinx-5.0 will be out in the Apr, 2022. So we can consider the drop of it. It's reasonable and acceptable for me. |
For some data here: all versions of internet explorer represent 0.23% of our traffic in a given month, and 85% of internet explorer traffic is version 11. In real numbers this is about 55k pageviews out of 28M per month. It's hard to pinpoint a number where we aren't concerned about a browser, but this does seem safe. Browsers that can't load JS will still at least be readable by users, just not very usable. The sphinx_rtd_theme has effectively dropped IE11, and will be fully dropped next release. We could aim for a similar deprecation time frame and drop around or before Apr 2022 |
Additionally downstream theme developers could always re-add jQuery on their own if they need it. |
Okay, let's go forward. It's time to say farewell to IE11. |
Hurray! I'll spend some time on this over the next few weeks. |
The three main things that wouldn't work are:
As long as the site is rendered with gettext at build-time, most sites will be pretty usable (minus search) and also degrade somewhat gracefully. |
I've started working on this, and filed #9874 -- which is very much a WIP, but feedback is welcome. I'll clean up the commit messages before marking it ready for review. :) |
Closing this one. #10070 remains open until the actual dependencies are removed. |
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.
The text was updated successfully, but these errors were encountered: