mkdocs / mkdocs

Project documentation with Markdown.
https://www.mkdocs.org
BSD 2-Clause "Simplified" License
18.49k stars 2.36k forks source link

Remove jQuery from mkdocs theme #3649

Closed squidfunk closed 1 month ago

squidfunk commented 1 month ago

Since the mkdocs theme updated to Bootstrap 5, jQuery is not necessary anymore. I've replaced all uses of jQuery with common browser APIs and adapted the use of the modals to Bootstrap 5. My testing shows that master behaves exactly as if this PR were merged. If not, please report errors here and I'll fix them.

I don't think jQuery can be removed from the readthedocs theme.

Closes #3648

squidfunk commented 1 month ago

Side note: merging this PR will reduce the payload that the browser needs to download by 90kb (30kb gzipp'd), which is an improvement of -14% (currently 213kb gzipp'd). Thus, the MkDocs core theme should load faster!

squidfunk commented 1 month ago

Thanks for taking the time to look at this! ❤️

Do we want to release this with MkDocs 1.6.0, or afterwards? I've tested all that was apparent to me from reading the code and have found no problems (except for the visual regression mentioned in https://github.com/mkdocs/mkdocs/pull/3493#issuecomment-2060187664, which are not related to the changes in this PR), but I'm also not a heavy user of the mkdocs theme.

If it should go into 1.6.0, we can merge it.

waylan commented 1 month ago

I would include this in 1.6.0 if we can.

tomchristie commented 1 month ago

I would include this in 1.6.0 if we can.

Seems reasonable. See also... https://github.com/mkdocs/mkdocs/issues/3648#issuecomment-2064438424

squidfunk commented 1 month ago

Great! Since everybody seems to agree that we want this in 1.6.0, let's merge it.