readthedocs / sphinx_rtd_theme

Sphinx theme from Read the Docs
https://sphinx-rtd-theme.readthedocs.io/
MIT License
4.81k stars 1.74k forks source link

Remove dependency on jQuery #1546

Closed kwsp closed 3 months ago

kwsp commented 1 year ago

Problem

jQuery was removed from Sphinx in ~2022 with the release of Sphinx 6.0.0.

I came across this because of broken search functionality at https://pydicom.github.io/pydicom/dev/index.html. I realised the problem is that jQuery is somehow not loaded so searchindex.js isn't loaded. However, this simple need to load a script is trivial in vanilla JS nowadays, as Sphinx by default uses.

If the maintainers don't want to remove jQuery for other downstream projects, at least we can start by porting some of the simply tasks to vanilla JS as Sphinx had done, so when jQuery breaks, it doesn't break the site.

humitos commented 3 months ago

We are depending on sphinxcontrib-jquery now, since this theme requires jQuery. Removing jQuery is not in our roadmap and we cannot prioritize it, but we would accept a PR for this. I think we can include it in the 4.0 release.

humitos commented 3 months ago

By the way, this is dup of https://github.com/readthedocs/sphinx_rtd_theme/issues/1253