Bootstrap 5 will remove jQuery

The latest version of Bootstrap 4.3.1 has been released. As part of the Bootstrap 4.3 release, the team also announced the development plan for the next major release of Bootstrap 5.

Bootstrap [Public domain], via Wikimedia Commons
The development team said that after the release of v4.3, some key changes will be implemented during the development of Bootstrap 5, which may be a major change, and this will be considered the basis of Bootstrap 5. The development team highlighted the following aspects:

  • Discard jQuery: Bootstrap 5 will remove jQuery as a dependency. The development team has been working on this for a long time, and the PR is in the process of being completed and nearing completion.
  • Improve the development branch: the v3-dev branch will become the master branch; v4-dev will remain the same, but a new master branch will be cut out from the branch to develop the v5 version.
  • Migrating from Jekyll to Hugo: There is already a PR in progress and is nearing completion

After removing the biggest dependency of jQuery, the development team said that in the future it will use native pure JavaScript instead of jQuery. This is a bit like the move to remove jQuery when GitHub refactored the page last year.

At the time, GitHub’s front-end team took the opportunity to redesign, took the opportunity to remove jQuery when refactoring the page, and did not use other frameworks instead of jQuery, but instead used native JavaScript:

  • Query the DOM node with querySelectorAll
  • Use fetch instead of ajax (use XHR on unsupported browsers)
  • Use proxy events for event handling
  • Wrote a polyfill for some unrealized DOM standards
  • Use more custom elements (CustomElement)

As you can see, removing jQuery in Bootstrap 5 has been going through a year and a half since its introduction. It currently contains 74 commits, is in the Open state, and has conflicts to resolve.